Commit b6f35ed7 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf record: Add --sample-cpu option

Adding --sample-cpu option to be able to explicitly enable CPU sample
type. Currently it's only enable implicitly in case the target is cpu

It will be useful for following c2c record tool.
Signed-off-by: default avatarJiri Olsa <>
Cc: David Ahern <>
Cc: Namhyung Kim <>
Cc: Peter Zijlstra <>
Link: default avatarArnaldo Carvalho de Melo <>
parent 52c5cc36
......@@ -192,6 +192,9 @@ OPTIONS
Record the sample period.
Record the sample cpu.
Don't sample.
......@@ -1434,6 +1434,7 @@ struct option __record_options[] = {
OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat,
"per thread counts"),
OPT_BOOLEAN('d', "data", &record.opts.sample_address, "Record the sample addresses"),
OPT_BOOLEAN(0, "sample-cpu", &record.opts.sample_cpu, "Record the sample cpu"),
OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time,
"Record the sample timestamps"),
......@@ -52,6 +52,7 @@ struct record_opts {
bool sample_weight;
bool sample_time;
bool sample_time_set;
bool sample_cpu;
bool period;
bool running_time;
bool full_auxtrace;
......@@ -882,7 +882,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
perf_evsel__set_sample_bit(evsel, REGS_INTR);
if (target__has_cpu(&opts->target))
if (target__has_cpu(&opts->target) || opts->sample_cpu)
perf_evsel__set_sample_bit(evsel, CPU);
if (opts->period)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment