Re: [PATCH v4 2/2] perf docs: Add documentation for --force-btf option

From: Arnaldo Carvalho de Melo
Date: Mon Dec 23 2024 - 14:06:27 EST


On Sun, Dec 15, 2024 at 11:07:11AM -0800, Howard Chu wrote:
> The --force-btf option is intended for debugging purposes and is
> currently undocumented. Add documentation for it.
>
> Signed-off-by: Howard Chu <howardchu95@xxxxxxxxx>
> ---
> tools/perf/Documentation/perf-trace.txt | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt
> index 6e0cc50bbc13..fb3d2af33844 100644
> --- a/tools/perf/Documentation/perf-trace.txt
> +++ b/tools/perf/Documentation/perf-trace.txt
> @@ -241,6 +241,11 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
> printing using the existing 'perf trace' syscall arg beautifiers to map integer
> arguments to strings (pid to comm, syscall id to syscall name, etc).
>
> +--force-btf::
> + Use btf_dump to pretty print syscall argument data, instead of using hand-crafted pretty
> + printers. This option is intended for testing BTF integration in perf trace. btf_dump-based
> + pretty-printing serves as a fallback to hand-crafted pretty printers, as the latter can
> + better pretty-print integer flags and struct pointers.

Applied, but for the casual reader the "btf_dump" reference is vague, it
would be interesting to mention that it is part of libbpf and uses
only what is available in the BTF format.

Then talking about the "hand-crafted" pretty printers, it is not all the
time "hand crafted", but automated by all those shell scripts that
convert kernel source code that doesn't get converted into BTF info
(defines) to create tables that then get associated with those syscall
args or even struct members.

But that is something for a followup paches, I'm applying it as is as it
improves the current documentation.

- Arnaldo