1
linux/tools/perf/util/bpf_skel
Howard Chu a68fd6a6cd 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>
2024-09-10 09:52:20 -03:00
..
vmlinux perf bpf-filter: Support filtering on cgroups 2024-08-28 18:21:49 -03:00
.gitignore perf build: Add ability to build with a generated vmlinux.h 2023-06-23 21:35:45 -07:00
augmented_raw_syscalls.bpf.c perf trace: Collect augmented data using BPF 2024-09-10 09:52:20 -03:00
bench_uprobe.bpf.c perf bench uprobe: Add uretprobe variant of uprobe benchmarks 2024-04-12 17:54:02 -03:00
bperf_cgroup.bpf.c perf stat: Constify control data for BPF 2024-09-03 11:43:16 -03:00
bperf_follower.bpf.c
bperf_leader.bpf.c
bperf_u.h
bpf_prog_profiler.bpf.c
func_latency.bpf.c perf ftrace latency: Constify control data for BPF 2024-09-03 11:47:02 -03:00
kwork_top.bpf.c perf kwork: Constify control data for BPF 2024-09-03 11:50:20 -03:00
kwork_trace.bpf.c perf kwork: Constify control data for BPF 2024-09-03 11:50:20 -03:00
lock_contention.bpf.c perf lock contention: Constify control data for BPF 2024-09-03 11:53:15 -03:00
lock_data.h perf lock contention: Change stack_id type to s32 2024-08-12 18:04:35 -03:00
off_cpu.bpf.c perf record offcpu: Constify control data for BPF 2024-09-03 11:54:47 -03:00
sample_filter.bpf.c perf bpf-filter: Support filtering on cgroups 2024-08-28 18:21:49 -03:00
sample-filter.h perf bpf-filter: Support filtering on cgroups 2024-08-28 18:21:49 -03:00