From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8F6939B96A for ; Mon, 28 Sep 2026 18:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790620017; cv=none; b=YH5BcPYRy5MmIXuXuptiFtr49tXnzmVSSrym6Jn1KmbYm0EufNaqHNiqfSo7w1cCGS35GNeeA0iLiI/EXKOBo9/7WZbZRrZmRQhwSN8dFMPPGyjMtBB8hXxhz3bMIZZsJzKFsn1qwIxq4gyPy6zj4BVvcFg6Y6Dtc5PepVHYDHk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790620017; c=relaxed/simple; bh=vzzupWZapnqBF3Icu4bFA3vKUyNYOaUPs9wIBEM04sA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=cyB5fAhkPn7iTovVobPLOIWP9+sLw342QrG49LTMn9jhvvOO7FNKdaugEjEsL7J8V3Jb0WMVhrmsQZquLXex63GncDoIWKAkwJU+gDKUsbmnapyVpfjAkSHwBvXRnst+nzXM9mjyIbFRlACP7Z/0MtICVGP1HLt7GWSftRGYWx8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Lx9t2Vq7; arc=none smtp.client-ip=74.125.82.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Lx9t2Vq7" Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-33c35f5ca6cso5666755eec.1 for ; Mon, 28 Sep 2026 11:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1790620015; x=1791224815; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=FR31L2UgMfcbk0Df5Pn/DTzvOue27NcqfcAwuvviXn4=; b=Lx9t2Vq75CmmzoYratsCD8LX4Dt3oLbKTzexyYsiapJF/xJutg9kAqDUpgx6Msa3XG K0CxII03K5I1/pwAWtLXw6mAbgzKvr3RS8c37AWFNg+dG73Atm3v7ROWWwHo916ECrDd akXW5x2NRZtLQLA6Qpad7D0dAhUD2bTau+0IMhhSVlyh7oUXxt7LBMuukka/ae8imOMt 8qQUoyyanI+u0uyXjiSVAK8Di4lhOir3NJR2W1p1QsRDMWVIbi7sCKawscueNEDeXWAL 9yMe1OHf+68Xj0QtxRxBU9ORf5CjjCt9c3LwilsXDP/ZvSvvTTWoyy4rw2G/RFEc1Hn5 3F/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790620015; x=1791224815; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=FR31L2UgMfcbk0Df5Pn/DTzvOue27NcqfcAwuvviXn4=; b=scES8mI7TVP9qoUc/sFvonoykfn0k0KFPmkHsAKlhZfs/m6/swmuxTXcIVxxrJV/1z EawT1rOvxXE5cYxg285VoFavMJHimz7rkWoYaC7Wy3hXt3yYl+qhidZ5nZW/t2U66XgI rX/3ZgOW8giFRueDYo5udxjGfbgeput57yZC3/UPOoWwmpuFTPlbaINeJ5+UEwqVuiTk txr/+gPq97jjMOzGx01swUlJ+Wecsi+WCVr6OD++L0kCTpDdVhUKtPvQWSgVDGAaNg52 8y3XVp011q3RGv3RlCtw5sf8l7A4Qxh2Wznw+sdAAZnMn4yC7n8BcyXWAai5H2wjU2sJ Du9g== X-Forwarded-Encrypted: i=1; AKwUvBwsNrkU/fKueRYAYqiCuhBg2CczxUEnx33Sj5QTKOZbTKE6a7bogwOvkb9X2N1JwTf5YEAfwLOhi51M924=@vger.kernel.org X-Gm-Message-State: AFuF++lJpU276lQ7FVRzErXXy58niT3YBHjsDCMRg0EJCZoS8+hWMyF5 BFFIrjGIWieQyoL2+EN6ek/gSUB+y7pK0WlmhCjHSyVY66Ix/11fIg0inhbEjcG0SxiQcD6+V5e GkftV9f33GA== X-Received: from dlx9.prod.google.com ([2002:a05:7022:89:b0:144:cdf0:6a43]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:701b:455b:20b0:137:eb26:10d with SMTP id a92af1059eb24-146cb311338mr9543879c88.0.1790620014267; Mon, 28 Sep 2026 11:26:54 -0700 (PDT) Date: Mon, 28 Sep 2026 11:25:58 -0700 In-Reply-To: <20260928182605.3649015-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260928182605.3649015-1-irogers@google.com> X-Mailer: git-send-email 2.56.0.rc1.315.gc6ed9934b7-goog Message-ID: <20260928182605.3649015-20-irogers@google.com> Subject: [PATCH v6 19/26] perf trace: Add an option to disable syscall augmentation From: Ian Rogers To: Arnaldo Carvalho de Melo , Namhyung Kim , Aaron Tomlin Cc: Howard Chu , Jakub Brnak , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Adrian Hunter , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Ian Rogers Content-Type: text/plain; charset="UTF-8" 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. Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers --- tools/perf/Documentation/perf-trace.txt | 6 ++++++ tools/perf/builtin-trace.c | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) 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 @@ static int trace__run(struct trace *trace, int argc, const char **argv) 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; -- 2.56.0.rc1.315.gc6ed9934b7-goog