perf trace: Disable syscall augmentation with record
authorIan Rogers <irogers@google.com>
Fri, 16 Feb 2024 17:23:57 +0000 (09:23 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 4 May 2024 18:03:58 +0000 (15:03 -0300)
Syscall augmentation is causing samples not to be written to the
perf.data file with "perf trace record". Disabling augmentation is
sub-optimal, but it beats having a totally broken perf trace record.

Closes: https://lore.kernel.org/lkml/CAP-5=fV9Gd1Teak+EOcUSxe13KqSyfZyPNagK97GbLiOQRgGaw@mail.gmail.com/
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240216172357.65037-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c

index e5fef39c34bf40ff4cb66ba02db6a360dc1e8aae..3818d3a627799a65fa6af0c73b872f006112f122 100644 (file)
@@ -4883,6 +4883,11 @@ int cmd_trace(int argc, const char **argv)
        if (!trace.trace_syscalls)
                goto skip_augmentation;
 
+       if ((argc >= 1) && (strcmp(argv[0], "record") == 0)) {
+               pr_debug("Syscall augmentation fails with record, disabling augmentation");
+               goto skip_augmentation;
+       }
+
        trace.skel = augmented_raw_syscalls_bpf__open();
        if (!trace.skel) {
                pr_debug("Failed to open augmented syscalls BPF skeleton");