summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-09-16 10:40:38 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-09-16 10:40:38 +0200
commit116c96ec9ce1b350d852a585ce7b7b900203bc1d (patch)
tree968e9371657883540e68ab91e5bc10ad20df96c7
parent156c2e03aa7d770fce02efec512b65f3fd3c86e5 (diff)
downloadnlplug-116c96ec9ce1b350d852a585ce7b7b900203bc1d.tar.bz2
nlplug-116c96ec9ce1b350d852a585ce7b7b900203bc1d.tar.xz
nlplug: add debug info about total used buffer size
this help us to set kernel buffer size properly
-rw-r--r--nlplug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nlplug.c b/nlplug.c
index 3ed8dbd..5e1ce83 100644
--- a/nlplug.c
+++ b/nlplug.c
@@ -210,6 +210,7 @@ int main(int argc, char *argv[])
char *searchdev = NULL;
int showudev, showkernel;
+ size_t total_bytes;
showudev = 1;
showkernel = 1;
@@ -271,6 +272,7 @@ int main(int argc, char *argv[])
if (len < 32 || len >= sizeof(buf))
continue;
+ total_bytes += len;
chdr = CMSG_FIRSTHDR(&hdr);
if (chdr == NULL || chdr->cmsg_type != SCM_CREDENTIALS)
continue;
@@ -317,8 +319,8 @@ int main(int argc, char *argv[])
if (r == 0)
dbg("exit due to timeout");
- dbg("modaliases: %i, forks: %i, events: %i", modalias_count, fork_count,
- event_count);
+ dbg("modaliases: %i, forks: %i, events: %i, total bufsize: %zu", modalias_count, fork_count,
+ event_count, total_bytes);
return 0;
}