diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-09-16 10:40:38 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-09-16 10:40:38 +0200 |
commit | 116c96ec9ce1b350d852a585ce7b7b900203bc1d (patch) | |
tree | 968e9371657883540e68ab91e5bc10ad20df96c7 | |
parent | 156c2e03aa7d770fce02efec512b65f3fd3c86e5 (diff) | |
download | nlplug-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } |