From: Hengqi Chen Date: Sat, 25 Dec 2021 04:29:07 +0000 (+0800) Subject: libbpf-tools: Make custom libbpf callback function static X-Git-Tag: v0.24.0~26^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79e1ae3cc32358c12907706a9cbcdc98578fb581;p=platform%2Fupstream%2Fbcc.git libbpf-tools: Make custom libbpf callback function static Update all tools to make libbpf_print_fn function static. While at it, also keep the function signature in a single line since they fit in a 100-character line. Signed-off-by: Hengqi Chen --- diff --git a/libbpf-tools/biolatency.c b/libbpf-tools/biolatency.c index dc8f23b2..bc0b0f75 100644 --- a/libbpf-tools/biolatency.c +++ b/libbpf-tools/biolatency.c @@ -133,8 +133,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/biopattern.c b/libbpf-tools/biopattern.c index e963b326..e983ce13 100644 --- a/libbpf-tools/biopattern.c +++ b/libbpf-tools/biopattern.c @@ -97,8 +97,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/biosnoop.c b/libbpf-tools/biosnoop.c index e983de93..c76a2eb9 100644 --- a/libbpf-tools/biosnoop.c +++ b/libbpf-tools/biosnoop.c @@ -102,8 +102,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/biostacks.c b/libbpf-tools/biostacks.c index d002a8b8..f99dc56d 100644 --- a/libbpf-tools/biostacks.c +++ b/libbpf-tools/biostacks.c @@ -83,8 +83,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/bitesize.c b/libbpf-tools/bitesize.c index 36760eb0..c39541b3 100644 --- a/libbpf-tools/bitesize.c +++ b/libbpf-tools/bitesize.c @@ -105,8 +105,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/cachestat.c b/libbpf-tools/cachestat.c index 3769d939..05785251 100644 --- a/libbpf-tools/cachestat.c +++ b/libbpf-tools/cachestat.c @@ -86,8 +86,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/cpudist.c b/libbpf-tools/cpudist.c index 22469722..f76d8a67 100644 --- a/libbpf-tools/cpudist.c +++ b/libbpf-tools/cpudist.c @@ -121,8 +121,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/cpufreq.c b/libbpf-tools/cpufreq.c index e42bca94..c5839560 100644 --- a/libbpf-tools/cpufreq.c +++ b/libbpf-tools/cpufreq.c @@ -112,8 +112,7 @@ static int open_and_attach_perf_event(int freq, struct bpf_program *prog, return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/drsnoop.c b/libbpf-tools/drsnoop.c index 739dbdc7..705db9a4 100644 --- a/libbpf-tools/drsnoop.c +++ b/libbpf-tools/drsnoop.c @@ -104,8 +104,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/execsnoop.c b/libbpf-tools/execsnoop.c index 9166c1bd..38294816 100644 --- a/libbpf-tools/execsnoop.c +++ b/libbpf-tools/execsnoop.c @@ -133,8 +133,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -static int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/filelife.c b/libbpf-tools/filelife.c index 1e834c51..ba6b9440 100644 --- a/libbpf-tools/filelife.c +++ b/libbpf-tools/filelife.c @@ -71,8 +71,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/fsdist.c b/libbpf-tools/fsdist.c index 4fb405db..f411d162 100644 --- a/libbpf-tools/fsdist.c +++ b/libbpf-tools/fsdist.c @@ -194,8 +194,7 @@ static void alias_parse(char *prog) } } -static int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !verbose) return 0; diff --git a/libbpf-tools/fsslower.c b/libbpf-tools/fsslower.c index f5cec983..e96c9efa 100644 --- a/libbpf-tools/fsslower.c +++ b/libbpf-tools/fsslower.c @@ -180,8 +180,7 @@ static void alias_parse(char *prog) } } -static int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !verbose) return 0; diff --git a/libbpf-tools/hardirqs.c b/libbpf-tools/hardirqs.c index ee2bc5a3..a2475ef1 100644 --- a/libbpf-tools/hardirqs.c +++ b/libbpf-tools/hardirqs.c @@ -105,8 +105,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/llcstat.c b/libbpf-tools/llcstat.c index 89b49efe..be437bc2 100644 --- a/libbpf-tools/llcstat.c +++ b/libbpf-tools/llcstat.c @@ -115,8 +115,7 @@ static int open_and_attach_perf_event(__u64 config, int period, return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/numamove.c b/libbpf-tools/numamove.c index ba7454e8..0747f841 100644 --- a/libbpf-tools/numamove.c +++ b/libbpf-tools/numamove.c @@ -51,8 +51,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; @@ -89,7 +88,7 @@ int main(int argc, char **argv) fprintf(stderr, "failed to open and/or load BPF object\n"); return 1; } - + if (!obj->bss) { fprintf(stderr, "Memory-mapping BPF maps is supported starting from Linux 5.7, please upgrade.\n"); goto cleanup; diff --git a/libbpf-tools/offcputime.c b/libbpf-tools/offcputime.c index a9a18721..37a8ec2c 100644 --- a/libbpf-tools/offcputime.c +++ b/libbpf-tools/offcputime.c @@ -176,8 +176,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/opensnoop.c b/libbpf-tools/opensnoop.c index 1754b81e..557a63cd 100644 --- a/libbpf-tools/opensnoop.c +++ b/libbpf-tools/opensnoop.c @@ -160,8 +160,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/readahead.c b/libbpf-tools/readahead.c index c55b0dbb..17079389 100644 --- a/libbpf-tools/readahead.c +++ b/libbpf-tools/readahead.c @@ -64,8 +64,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/runqlat.c b/libbpf-tools/runqlat.c index bcccf0d6..5a60b874 100644 --- a/libbpf-tools/runqlat.c +++ b/libbpf-tools/runqlat.c @@ -123,8 +123,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/runqlen.c b/libbpf-tools/runqlen.c index 43c65246..9cbbc739 100644 --- a/libbpf-tools/runqlen.c +++ b/libbpf-tools/runqlen.c @@ -155,8 +155,7 @@ static int open_and_attach_perf_event(int freq, struct bpf_program *prog, return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/runqslower.c b/libbpf-tools/runqslower.c index c9599595..b038173e 100644 --- a/libbpf-tools/runqslower.c +++ b/libbpf-tools/runqslower.c @@ -105,8 +105,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/softirqs.c b/libbpf-tools/softirqs.c index b634d93a..34cfdb77 100644 --- a/libbpf-tools/softirqs.c +++ b/libbpf-tools/softirqs.c @@ -100,8 +100,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/syscount.c b/libbpf-tools/syscount.c index b677a01d..2d687573 100644 --- a/libbpf-tools/syscount.c +++ b/libbpf-tools/syscount.c @@ -94,8 +94,7 @@ static int get_int(const char *arg, int *ret, int min, int max) return 0; } -static int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/tcpconnect.c b/libbpf-tools/tcpconnect.c index bd3b56b6..101cf72b 100644 --- a/libbpf-tools/tcpconnect.c +++ b/libbpf-tools/tcpconnect.c @@ -186,8 +186,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -static int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/tcpconnlat.c b/libbpf-tools/tcpconnlat.c index c44a7309..8eae76ae 100644 --- a/libbpf-tools/tcpconnlat.c +++ b/libbpf-tools/tcpconnlat.c @@ -97,8 +97,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/tcprtt.c b/libbpf-tools/tcprtt.c index 44a5505a..e847b8d2 100644 --- a/libbpf-tools/tcprtt.c +++ b/libbpf-tools/tcprtt.c @@ -154,8 +154,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -static int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0; diff --git a/libbpf-tools/vfsstat.c b/libbpf-tools/vfsstat.c index 53183fad..5519c366 100644 --- a/libbpf-tools/vfsstat.c +++ b/libbpf-tools/vfsstat.c @@ -78,8 +78,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return 0; } -static int libbpf_print_fn(enum libbpf_print_level level, - const char *format, va_list args) +static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args) { if (level == LIBBPF_DEBUG && !env.verbose) return 0;