Re: [PATCH bpf-next v3 0/5] bpftool: Make probes which emit dmesg warnings optional

From: Michal Rostecki
Date: Wed Feb 26 2020 - 07:17:16 EST


On 2/26/20 12:17 PM, Quentin Monnet wrote:
> 2020-02-25 20:44 UTC+0100 ~ Michal Rostecki <mrostecki@xxxxxxxxxxxx>
>> Feature probes in bpftool related to bpf_probe_write_user and
>> bpf_trace_printk helpers emit dmesg warnings which might be confusing
>> for people running bpftool on production environments. This patch series
>> addresses that by filtering them out by default and introducing the new
>> positional argument "full" which enables all available probes.
>>
>> The main motivation behind those changes is ability the fact that some
>> probes (for example those related to "trace" or "write_user" helpers)
>> emit dmesg messages which might be confusing for people who are running
>> on production environments. For details see the Cilium issue[0].
>>
>> v1 -> v2:
>> - Do not expose regex filters to users, keep filtering logic internal,
>> expose only the "full" option for including probes which emit dmesg
>> warnings.
>>
>> v2 -> v3:
>> - Do not use regex for filtering out probes, use function IDs directly.
>> - Fix bash completion - in v2 only "prefix" was proposed after "macros",
>> ÂÂ "dev" and "kernel" were not.
>> - Rephrase the man page paragraph, highlight helper function names.
>> - Remove tests which parse the plain output of bpftool (except the
>> ÂÂ header/macros test), focus on testing JSON output instead.
>> - Add test which compares the output with and without "full" option.
>>
>> [0] https://github.com/cilium/cilium/issues/10048
>>
>> Michal Rostecki (5):
>> ÂÂ bpftool: Move out sections to separate functions
>> ÂÂ bpftool: Make probes which emit dmesg warnings optional
>> ÂÂ bpftool: Update documentation of "bpftool feature" command
>> ÂÂ bpftool: Update bash completion for "bpftool feature" command
>> ÂÂ selftests/bpf: Add test for "bpftool feature" command
>>
>> Â .../bpftool/Documentation/bpftool-feature.rst |Â 19 +-
>> Â tools/bpf/bpftool/bash-completion/bpftoolÂÂÂÂ |ÂÂ 3 +-
>> Â tools/bpf/bpftool/feature.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ | 283 +++++++++++-------
>> Â tools/testing/selftests/.gitignoreÂÂÂÂÂÂÂÂÂÂÂ |ÂÂ 5 +-
>> Â tools/testing/selftests/bpf/MakefileÂÂÂÂÂÂÂÂÂ |ÂÂ 3 +-
>> Â tools/testing/selftests/bpf/test_bpftool.pyÂÂ | 179 +++++++++++
>> Â tools/testing/selftests/bpf/test_bpftool.shÂÂ |ÂÂ 5 +
>> Â 7 files changed, 374 insertions(+), 123 deletions(-)
>> Â create mode 100644 tools/testing/selftests/bpf/test_bpftool.py
>> Â create mode 100755 tools/testing/selftests/bpf/test_bpftool.sh
>>
>
> This version looks good to me, thanks!
>
> Reviewed-by: Quentin Monnet <quentin@xxxxxxxxxxxxx>
>
> (Please keep Acked-by/Reviewed-by tags between versions if there are no
> significant changes, here for patch 1.)

Sorry, I will do that next time.

> That's a lot of tests now that we don't have the regex and filtering is
> very straightforward, but it does not hurt. I checked and they all pass
> on my system.

I know that those tests were necessary with the regex implementation and
now they may seem to be an overkill. But on the other hand, I think that
having selftests for bpftool in general is a good thing, so I didn't
want throw them away despite the easier implementation of my patches. I
might follow up with some more tests covering the other subcommands in
future.

Cheers,
Michal