[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1720700179-22839-3-git-send-email-ajay.kaher@broadcom.com>
Date: Thu, 11 Jul 2024 17:46:18 +0530
From: Ajay Kaher <ajay.kaher@...adcom.com>
To: peterz@...radead.org,
mingo@...hat.com,
acme@...nel.org,
namhyung@...nel.org
Cc: mark.rutland@....com,
rostedt@...dmis.org,
alexander.shishkin@...ux.intel.com,
jolsa@...nel.org,
irogers@...gle.com,
adrian.hunter@...el.com,
kan.liang@...ux.intel.com,
yangjihong1@...wei.com,
zegao2021@...il.com,
leo.yan@...ux.dev,
asmadeus@...ewreck.org,
siyanteng@...ngson.cn,
sunhaiyong@...ngson.cn,
linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org,
ajay.kaher@...adcom.com,
alexey.makhalov@...adcom.com,
vasavi.sirnapalli@...adcom.com
Subject: [PATCH RFC 2/3] perf/record: add options --off-cpu-kernel
--off-cpu-kernel to collect off cpu samples using on/off cpu time.
Signed-off-by: Ajay Kaher <ajay.kaher@...adcom.com>
---
tools/perf/builtin-record.c | 2 ++
tools/perf/util/evsel.c | 2 ++
tools/perf/util/record.h | 1 +
3 files changed, 5 insertions(+)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 0a8ba1323d64..5be172537330 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -3571,6 +3571,8 @@ static struct option __record_options[] = {
"write collected trace data into several data files using parallel threads",
record__parse_threads),
OPT_BOOLEAN(0, "off-cpu", &record.off_cpu, "Enable off-cpu analysis"),
+ OPT_BOOLEAN(0, "off-cpu-kernel", &record.opts.off_cpu_kernel,
+ "Enable kernel based off-cpu analysis"),
OPT_END()
};
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 4f818ab6b662..8ba890a5ac6e 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -862,6 +862,8 @@ static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *o
attr->exclude_callchain_user = 1;
if (opts->user_callchains)
attr->exclude_callchain_kernel = 1;
+ if (opts->off_cpu_kernel)
+ attr->off_cpu = 1;
if (param->record_mode == CALLCHAIN_LBR) {
if (!opts->branch_stack) {
if (attr->exclude_user) {
diff --git a/tools/perf/util/record.h b/tools/perf/util/record.h
index a6566134e09e..cfa5e34b78ad 100644
--- a/tools/perf/util/record.h
+++ b/tools/perf/util/record.h
@@ -52,6 +52,7 @@ struct record_opts {
bool kcore;
bool text_poke;
bool build_id;
+ bool off_cpu_kernel;
unsigned int freq;
unsigned int mmap_pages;
unsigned int auxtrace_mmap_pages;
--
2.39.0
Powered by blists - more mailing lists