summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-09-28 11:25:58 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-10-01 17:47:15 +0200
commite827cc9413abc43d93044bb23066fa81bbcb04be (patch)
tree7739b0f49306bba2ff271f0b61474d3f01cfcb14
parent9ab6ea11e8adde1189d688b6e04953e22c7ca55c (diff)
perf trace: Add an option to disable syscall augmentation
'perf trace' falls back to the raw_syscalls tracepoints, filtering in user space, when the augmentation BPF programs can't be loaded. Add --no-syscall-augment to use that path even when they can, so both can be tested. Suggest it when tasks are lost, as the tracepoints' per-task events don't limit how many tasks are traced. Reviewed-by: Namhyung Kim <namhyung@kernel.org> Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/Documentation/perf-trace.txt6
-rw-r--r--tools/perf/builtin-trace.c10
2 files changed, 15 insertions, 1 deletions
diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt
index d20b43ea3d37..fabb37258751 100644
--- a/tools/perf/Documentation/perf-trace.txt
+++ b/tools/perf/Documentation/perf-trace.txt
@@ -172,6 +172,12 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
Trace system calls. This options is enabled by default, disable with
--no-syscalls.
+--syscall-augment::
+ Augment system call arguments using BPF, the default when BPF support
+ is available. Disable with --no-syscall-augment to use the
+ raw_syscalls tracepoints instead, such as when more tasks are alive
+ at once than augmentation can trace.
+
--call-graph [mode,type,min[,limit],order[,key][,branch]]::
Setup and enable call-graph (stack chain/backtrace) recording.
See `--call-graph` section in perf-record and perf-report
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 1be355a3ae22..c34c9f129836 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -216,6 +216,7 @@ struct trace {
bool print_sample;
bool show_tool_stats;
bool trace_syscalls;
+ bool syscall_augment;
bool libtraceevent_print;
bool kernel_syscallchains;
s16 args_alignment;
@@ -5002,7 +5003,8 @@ out_disable:
lost_tasks = augmented_syscalls__lost_tasks();
if (lost_tasks)
color_fprintf(trace->output, PERF_COLOR_RED,
- "LOST the syscalls of %d tasks, too many to trace at once!\n",
+ "LOST the syscalls of %d tasks, too many to trace at once!\n"
+ "Use --no-syscall-augment to trace them without augmentation.\n",
lost_tasks);
if (!err) {
@@ -5788,6 +5790,7 @@ int cmd_trace(int argc, const char **argv)
.show_arg_names = true,
.args_alignment = 70,
.trace_syscalls = false,
+ .syscall_augment = true,
.kernel_syscallchains = false,
.max_stack = UINT_MAX,
.max_events = ULONG_MAX,
@@ -5843,6 +5846,8 @@ int cmd_trace(int argc, const char **argv)
OPT_CALLBACK_DEFAULT('F', "pf", &trace.trace_pgfaults, "all|maj|min",
"Trace pagefaults", parse_pagefaults, "maj"),
OPT_BOOLEAN(0, "syscalls", &trace.trace_syscalls, "Trace syscalls"),
+ OPT_BOOLEAN(0, "syscall-augment", &trace.syscall_augment,
+ "Augment syscalls using BPF"),
OPT_BOOLEAN('f', "force", &trace.force, "don't complain, do it"),
OPT_CALLBACK(0, "call-graph", &trace.opts,
"record_mode[,record_size]", record_callchain_help,
@@ -5982,6 +5987,9 @@ int cmd_trace(int argc, const char **argv)
goto skip_augmentation;
}
+ if (!trace.syscall_augment)
+ goto skip_augmentation;
+
err = augmented_syscalls__prepare();
if (err < 0)
goto skip_augmentation;