diff options
author | Yonghong Song <yhs@fb.com> | 2019-02-02 01:14:17 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-02-04 18:40:59 +0100 |
commit | 6f1ae8b6628b9e054d3a8c959cf472234944a578 (patch) | |
tree | a06e49a2ac5d5a35f3fb6a25c1ea689f3c6bfe40 /tools/testing/selftests/bpf/test_btf.c | |
parent | tools/bpf: print out btf log at LIBBPF_WARN level (diff) | |
download | linux-6f1ae8b6628b9e054d3a8c959cf472234944a578.tar.xz linux-6f1ae8b6628b9e054d3a8c959cf472234944a578.zip |
tools/bpf: simplify libbpf API function libbpf_set_print()
Currently, the libbpf API function libbpf_set_print()
takes three function pointer parameters for warning, info
and debug printout respectively.
This patch changes the API to have just one function pointer
parameter and the function pointer has one additional
parameter "debugging level". So if in the future, if
the debug level is increased, the function signature
won't change.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_btf.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_btf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/test_btf.c b/tools/testing/selftests/bpf/test_btf.c index 179f1d8ec5bf..aebaeff5a5a0 100644 --- a/tools/testing/selftests/bpf/test_btf.c +++ b/tools/testing/selftests/bpf/test_btf.c @@ -54,8 +54,9 @@ static int count_result(int err) #define __printf(a, b) __attribute__((format(printf, a, b))) -__printf(1, 2) -static int __base_pr(const char *format, ...) +__printf(2, 3) +static int __base_pr(enum libbpf_print_level level __attribute__((unused)), + const char *format, ...) { va_list args; int err; @@ -5650,7 +5651,7 @@ int main(int argc, char **argv) return err; if (args.always_log) - libbpf_set_print(__base_pr, __base_pr, __base_pr); + libbpf_set_print(__base_pr); if (args.raw_test) err |= test_raw(); |