]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf trace: Collect augmented data using BPF
authorHoward Chu <howardchu95@gmail.com>
Sat, 24 Aug 2024 16:33:20 +0000 (00:33 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 10 Sep 2024 12:52:20 +0000 (09:52 -0300)
commita68fd6a6cdd309bb51c72df4a39f49aa408728d0
tree921b91efcbf2e86d3dafcd9875cf22dcc2db156b
parentb257fac12f38d7f503b932313d704cee21092350
perf trace: Collect augmented data using BPF

Include trace_augment.h for TRACE_AUG_MAX_BUF, so that BPF reads
TRACE_AUG_MAX_BUF bytes of buffer maximum.

Determine what type of argument and how many bytes to read from user space, us ing the
value in the beauty_map. This is the relation of parameter type and its corres ponding
value in the beauty map, and how many bytes we read eventually:

string: 1                          -> size of string (till null)
struct: size of struct             -> size of struct
buffer: -1 * (index of paired len) -> value of paired len (maximum: TRACE_AUG_ MAX_BUF)

After reading from user space, we output the augmented data using
bpf_perf_event_output().

If the struct augmenter, augment_sys_enter() failed, we fall back to
using bpf_tail_call().

I have to make the payload 6 times the size of augmented_arg, to pass the
BPF verifier.

Signed-off-by: Howard Chu <howardchu95@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240815013626.935097-10-howardchu95@gmail.com
Link: https://lore.kernel.org/r/20240824163322.60796-7-howardchu95@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c