* [PATCH 1/2] perf, tools: Support direct --user-regs arguments @ 2017-09-05 17:00 Andi Kleen 2017-09-05 17:00 ` [PATCH 2/2] perf, tools: Support user regs in perf script Andi Kleen 2017-09-22 16:33 ` [tip:perf/core] perf record: Support direct --user-regs arguments tip-bot for Andi Kleen 0 siblings, 2 replies; 7+ messages in thread From: Andi Kleen @ 2017-09-05 17:00 UTC (permalink / raw) To: acme; +Cc: jolsa, linux-kernel, Andi Kleen From: Andi Kleen <ak@linux.intel.com> USER_REGS can currently only collected implicitely with call graph recording. Sometimes it is useful to see them separately, and filter them. Add a new --user-regs option to record that is similar to --intr-regs, but acts on user regs. Signed-off-by: Andi Kleen <ak@linux.intel.com> --- tools/perf/Documentation/perf-record.txt | 2 ++ tools/perf/builtin-record.c | 3 +++ tools/perf/perf.h | 1 + tools/perf/util/evsel.c | 7 ++++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 9bdea047c5db..5cd9ba09bdf1 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -374,6 +374,8 @@ symbolic names, e.g. on x86, ax, si. To list the available registers use --intr-regs=\?. To name registers, pass a comma separated list such as --intr-regs=ax,bx. The list of register is architecture dependent. +--user-regs:: +Capture user registers at sample time. Same arguments as -I. --running-time:: Record running and enabled time for read events (:S) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 36d7117a7562..ebd34273430e 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1641,6 +1641,9 @@ static struct option __record_options[] = { OPT_CALLBACK_OPTARG('I', "intr-regs", &record.opts.sample_intr_regs, NULL, "any register", "sample selected machine registers on interrupt," " use -I ? to list register names", parse_regs), + OPT_CALLBACK_OPTARG(0, "user-regs", &record.opts.sample_user_regs, NULL, "any register", + "sample selected machine registers on interrupt," + " use -I ? to list register names", parse_regs), OPT_BOOLEAN(0, "running-time", &record.opts.running_time, "Record running/enabled time of read (:S) events"), OPT_CALLBACK('k', "clockid", &record.opts, diff --git a/tools/perf/perf.h b/tools/perf/perf.h index 2c010dd6a79d..ed2ab6a2f833 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -64,6 +64,7 @@ struct record_opts { unsigned int user_freq; u64 branch_stack; u64 sample_intr_regs; + u64 sample_user_regs; u64 default_interval; u64 user_interval; size_t auxtrace_snapshot_size; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index d9bd632ed7db..bc17779d5892 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -678,7 +678,7 @@ void perf_evsel__config_callchain(struct perf_evsel *evsel, if (!function) { perf_evsel__set_sample_bit(evsel, REGS_USER); perf_evsel__set_sample_bit(evsel, STACK_USER); - attr->sample_regs_user = PERF_REGS_MASK; + attr->sample_regs_user |= PERF_REGS_MASK; attr->sample_stack_user = param->dump_size; attr->exclude_callchain_user = 1; } else { @@ -931,6 +931,11 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, perf_evsel__set_sample_bit(evsel, REGS_INTR); } + if (opts->sample_user_regs) { + attr->sample_regs_user |= opts->sample_user_regs; + perf_evsel__set_sample_bit(evsel, REGS_USER); + } + if (target__has_cpu(&opts->target) || opts->sample_cpu) perf_evsel__set_sample_bit(evsel, CPU); -- 2.9.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] perf, tools: Support user regs in perf script 2017-09-05 17:00 [PATCH 1/2] perf, tools: Support direct --user-regs arguments Andi Kleen @ 2017-09-05 17:00 ` Andi Kleen 2017-09-05 17:48 ` Arnaldo Carvalho de Melo 2017-09-22 16:33 ` [tip:perf/core] perf record: Support direct --user-regs arguments tip-bot for Andi Kleen 1 sibling, 1 reply; 7+ messages in thread From: Andi Kleen @ 2017-09-05 17:00 UTC (permalink / raw) To: acme; +Cc: jolsa, linux-kernel, Andi Kleen From: Andi Kleen <ak@linux.intel.com> Teach perf script to print user regs. % perf record --user-regs=ip,sp ... % perf script -F ip,sym,uregs ... ffffffff9e060c24 native_write_msr ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 ffffffff9e060c24 native_write_msr ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 ffffffff9e060c24 native_write_msr ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 ffffffff9e060c24 native_write_msr ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 ffffffff9e00cc12 intel_pmu_handle_irq ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 Signed-off-by: Andi Kleen <ak@linux.intel.com> --- tools/perf/Documentation/perf-script.txt | 2 +- tools/perf/builtin-script.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt index 5ee8796be96e..d816c62379ee 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt @@ -116,7 +116,7 @@ OPTIONS --fields:: Comma separated list of fields to print. Options are: comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff, - srcline, period, iregs, brstack, brstacksym, flags, bpf-output, brstackinsn, brstackoff, + srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, brstackinsn, brstackoff, callindent, insn, insnlen, synth. Field list can be prepended with the type, trace, sw or hw, to indicate to which event type the field list applies. diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 378f76cdf923..dff7d0566487 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -87,6 +87,7 @@ enum perf_output_field { PERF_OUTPUT_BRSTACKINSN = 1U << 23, PERF_OUTPUT_BRSTACKOFF = 1U << 24, PERF_OUTPUT_SYNTH = 1U << 25, + PERF_OUTPUT_UREGS = 1U << 26, }; struct output_option { @@ -108,6 +109,7 @@ struct output_option { {.str = "srcline", .field = PERF_OUTPUT_SRCLINE}, {.str = "period", .field = PERF_OUTPUT_PERIOD}, {.str = "iregs", .field = PERF_OUTPUT_IREGS}, + {.str = "uregs", .field = PERF_OUTPUT_UREGS}, {.str = "brstack", .field = PERF_OUTPUT_BRSTACK}, {.str = "brstacksym", .field = PERF_OUTPUT_BRSTACKSYM}, {.str = "data_src", .field = PERF_OUTPUT_DATA_SRC}, @@ -382,6 +384,11 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel, PERF_OUTPUT_IREGS)) return -EINVAL; + if (PRINT_FIELD(UREGS) && + perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_USER, "UREGS", + PERF_OUTPUT_UREGS)) + return -EINVAL; + return 0; } @@ -501,6 +508,24 @@ static void print_sample_iregs(struct perf_sample *sample, } } +static void print_sample_uregs(struct perf_sample *sample, + struct perf_event_attr *attr) +{ + struct regs_dump *regs = &sample->user_regs; + uint64_t mask = attr->sample_regs_user; + unsigned i = 0, r; + + if (!regs || !regs->regs) + return; + + printf(" ABI:%lu ", regs->abi); + + for_each_set_bit(r, (unsigned long *) &mask, sizeof(mask) * 8) { + u64 val = regs->regs[i++]; + printf("%5s:0x%"PRIx64" ", perf_reg_name(r), val); + } +} + static void print_sample_start(struct perf_sample *sample, struct thread *thread, struct perf_evsel *evsel) @@ -1436,6 +1461,9 @@ static void process_event(struct perf_script *script, if (PRINT_FIELD(IREGS)) print_sample_iregs(sample, attr); + if (PRINT_FIELD(UREGS)) + print_sample_uregs(sample, attr); + if (PRINT_FIELD(BRSTACK)) print_sample_brstack(sample, thread, attr); else if (PRINT_FIELD(BRSTACKSYM)) @@ -2728,7 +2756,7 @@ int cmd_script(int argc, const char **argv) "+field to add and -field to remove." "Valid types: hw,sw,trace,raw,synth. " "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," - "addr,symoff,period,iregs,brstack,brstacksym,flags," + "addr,symoff,period,iregs,uregs,brstack,brstacksym,flags," "bpf-output,callindent,insn,insnlen,brstackinsn,synth", parse_output_fields), OPT_BOOLEAN('a', "all-cpus", &system_wide, -- 2.9.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] perf, tools: Support user regs in perf script 2017-09-05 17:00 ` [PATCH 2/2] perf, tools: Support user regs in perf script Andi Kleen @ 2017-09-05 17:48 ` Arnaldo Carvalho de Melo 2017-09-05 18:28 ` Andi Kleen 0 siblings, 1 reply; 7+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-09-05 17:48 UTC (permalink / raw) To: Andi Kleen; +Cc: jolsa, linux-kernel, Andi Kleen Em Tue, Sep 05, 2017 at 10:00:29AM -0700, Andi Kleen escreveu: > From: Andi Kleen <ak@linux.intel.com> > > Teach perf script to print user regs. > > % perf record --user-regs=ip,sp ... > % perf script -F ip,sym,uregs Applied the first patch, but this one isn't applying, please check. Last changes here on builtin-script.c: [acme@jouet linux]$ git log --oneline -10 tools/perf/builtin-script.c 49d58f04eb6c perf script: Support physical address 2ec5cab604b2 perf script: Remove some bogus error handling e9def1b2e74e perf tools: Add feature header record to pipe-mode 114f709e01e6 perf tool: Add show_feature_header to perf_tool 644e0840ad46 (tag: perf-core-for-mingo-4.13-20170630) perf auxtrace: Add CPU filter support 65c5e18f9df0 perf script: Add synthesized Intel PT power and ptwrite events 47e780848e62 perf script: Add 'synth' field for synthesized event payloads 1405720d4f26 perf script: Add 'synth' event type for synthesized events 701516ae3dec (tag: perf-core-for-mingo-4.13-20170621) perf script: Fix message because field list option is -F not -f 106dacd86f04 perf script: Support -F brstackoff,dso [acme@jouet linux]$ > ffffffff9e060c24 native_write_msr ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 > ffffffff9e060c24 native_write_msr ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 > ffffffff9e060c24 native_write_msr ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 > ffffffff9e060c24 native_write_msr ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 > ffffffff9e00cc12 intel_pmu_handle_irq ABI:2 SP:0x7ffd0ea06c38 IP:0x7fe77f55b637 > > Signed-off-by: Andi Kleen <ak@linux.intel.com> > --- > tools/perf/Documentation/perf-script.txt | 2 +- > tools/perf/builtin-script.c | 30 +++++++++++++++++++++++++++++- > 2 files changed, 30 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt > index 5ee8796be96e..d816c62379ee 100644 > --- a/tools/perf/Documentation/perf-script.txt > +++ b/tools/perf/Documentation/perf-script.txt > @@ -116,7 +116,7 @@ OPTIONS > --fields:: > Comma separated list of fields to print. Options are: > comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff, > - srcline, period, iregs, brstack, brstacksym, flags, bpf-output, brstackinsn, brstackoff, > + srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, brstackinsn, brstackoff, > callindent, insn, insnlen, synth. > Field list can be prepended with the type, trace, sw or hw, > to indicate to which event type the field list applies. > diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c > index 378f76cdf923..dff7d0566487 100644 > --- a/tools/perf/builtin-script.c > +++ b/tools/perf/builtin-script.c > @@ -87,6 +87,7 @@ enum perf_output_field { > PERF_OUTPUT_BRSTACKINSN = 1U << 23, > PERF_OUTPUT_BRSTACKOFF = 1U << 24, > PERF_OUTPUT_SYNTH = 1U << 25, > + PERF_OUTPUT_UREGS = 1U << 26, > }; > > struct output_option { > @@ -108,6 +109,7 @@ struct output_option { > {.str = "srcline", .field = PERF_OUTPUT_SRCLINE}, > {.str = "period", .field = PERF_OUTPUT_PERIOD}, > {.str = "iregs", .field = PERF_OUTPUT_IREGS}, > + {.str = "uregs", .field = PERF_OUTPUT_UREGS}, > {.str = "brstack", .field = PERF_OUTPUT_BRSTACK}, > {.str = "brstacksym", .field = PERF_OUTPUT_BRSTACKSYM}, > {.str = "data_src", .field = PERF_OUTPUT_DATA_SRC}, > @@ -382,6 +384,11 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel, > PERF_OUTPUT_IREGS)) > return -EINVAL; > > + if (PRINT_FIELD(UREGS) && > + perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_USER, "UREGS", > + PERF_OUTPUT_UREGS)) > + return -EINVAL; > + > return 0; > } > > @@ -501,6 +508,24 @@ static void print_sample_iregs(struct perf_sample *sample, > } > } > > +static void print_sample_uregs(struct perf_sample *sample, > + struct perf_event_attr *attr) > +{ > + struct regs_dump *regs = &sample->user_regs; > + uint64_t mask = attr->sample_regs_user; > + unsigned i = 0, r; > + > + if (!regs || !regs->regs) > + return; > + > + printf(" ABI:%lu ", regs->abi); > + > + for_each_set_bit(r, (unsigned long *) &mask, sizeof(mask) * 8) { > + u64 val = regs->regs[i++]; > + printf("%5s:0x%"PRIx64" ", perf_reg_name(r), val); > + } > +} > + > static void print_sample_start(struct perf_sample *sample, > struct thread *thread, > struct perf_evsel *evsel) > @@ -1436,6 +1461,9 @@ static void process_event(struct perf_script *script, > if (PRINT_FIELD(IREGS)) > print_sample_iregs(sample, attr); > > + if (PRINT_FIELD(UREGS)) > + print_sample_uregs(sample, attr); > + > if (PRINT_FIELD(BRSTACK)) > print_sample_brstack(sample, thread, attr); > else if (PRINT_FIELD(BRSTACKSYM)) > @@ -2728,7 +2756,7 @@ int cmd_script(int argc, const char **argv) > "+field to add and -field to remove." > "Valid types: hw,sw,trace,raw,synth. " > "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," > - "addr,symoff,period,iregs,brstack,brstacksym,flags," > + "addr,symoff,period,iregs,uregs,brstack,brstacksym,flags," > "bpf-output,callindent,insn,insnlen,brstackinsn,synth", > parse_output_fields), > OPT_BOOLEAN('a', "all-cpus", &system_wide, > -- > 2.9.5 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] perf, tools: Support user regs in perf script 2017-09-05 17:48 ` Arnaldo Carvalho de Melo @ 2017-09-05 18:28 ` Andi Kleen 2017-09-05 18:47 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 7+ messages in thread From: Andi Kleen @ 2017-09-05 18:28 UTC (permalink / raw) To: Arnaldo Carvalho de Melo; +Cc: Andi Kleen, jolsa, linux-kernel On Tue, Sep 05, 2017 at 02:48:30PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Sep 05, 2017 at 10:00:29AM -0700, Andi Kleen escreveu: > > From: Andi Kleen <ak@linux.intel.com> > > > > Teach perf script to print user regs. > > > > % perf record --user-regs=ip,sp ... > > % perf script -F ip,sym,uregs > > Applied the first patch, but this one isn't applying, please check. It conflicts with the physical address patches, will rebase and resend. Or it's usually just trivial conflicts with the perf script options if you want to take a stab. -Andi ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] perf, tools: Support user regs in perf script 2017-09-05 18:28 ` Andi Kleen @ 2017-09-05 18:47 ` Arnaldo Carvalho de Melo 2017-09-05 18:49 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 7+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-09-05 18:47 UTC (permalink / raw) To: Andi Kleen; +Cc: Andi Kleen, jolsa, linux-kernel Em Tue, Sep 05, 2017 at 11:28:20AM -0700, Andi Kleen escreveu: > On Tue, Sep 05, 2017 at 02:48:30PM -0300, Arnaldo Carvalho de Melo wrote: > > Em Tue, Sep 05, 2017 at 10:00:29AM -0700, Andi Kleen escreveu: > > > From: Andi Kleen <ak@linux.intel.com> > > > > > > Teach perf script to print user regs. > > > > > > % perf record --user-regs=ip,sp ... > > > % perf script -F ip,sym,uregs > > > > Applied the first patch, but this one isn't applying, please check. > > It conflicts with the physical address patches, will rebase > and resend. > > Or it's usually just trivial conflicts with the perf script options > if you want to take a stab. yeah, done. - Arnaldo ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] perf, tools: Support user regs in perf script 2017-09-05 18:47 ` Arnaldo Carvalho de Melo @ 2017-09-05 18:49 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 7+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-09-05 18:49 UTC (permalink / raw) To: Andi Kleen; +Cc: Andi Kleen, jolsa, linux-kernel Em Tue, Sep 05, 2017 at 03:47:35PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Tue, Sep 05, 2017 at 11:28:20AM -0700, Andi Kleen escreveu: > > On Tue, Sep 05, 2017 at 02:48:30PM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Tue, Sep 05, 2017 at 10:00:29AM -0700, Andi Kleen escreveu: > > > > From: Andi Kleen <ak@linux.intel.com> > > > > > > > > Teach perf script to print user regs. > > > > > > > > % perf record --user-regs=ip,sp ... > > > > % perf script -F ip,sym,uregs > > > > > > Applied the first patch, but this one isn't applying, please check. > > > > It conflicts with the physical address patches, will rebase > > and resend. > > > > Or it's usually just trivial conflicts with the perf script options > > if you want to take a stab. > > yeah, done. But you did it in a different order, i.e. in some hunks you put it before the code handling phys_addr, so I'll use your patch instead, since you did it anyway. - Arnaldo ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip:perf/core] perf record: Support direct --user-regs arguments 2017-09-05 17:00 [PATCH 1/2] perf, tools: Support direct --user-regs arguments Andi Kleen 2017-09-05 17:00 ` [PATCH 2/2] perf, tools: Support user regs in perf script Andi Kleen @ 2017-09-22 16:33 ` tip-bot for Andi Kleen 1 sibling, 0 replies; 7+ messages in thread From: tip-bot for Andi Kleen @ 2017-09-22 16:33 UTC (permalink / raw) To: linux-tip-commits; +Cc: mingo, jolsa, tglx, hpa, acme, ak, linux-kernel Commit-ID: 84c417422798c897f637b0249f64a52807b4a61b Gitweb: http://git.kernel.org/tip/84c417422798c897f637b0249f64a52807b4a61b Author: Andi Kleen <ak@linux.intel.com> AuthorDate: Tue, 5 Sep 2017 10:00:28 -0700 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Wed, 13 Sep 2017 09:49:14 -0300 perf record: Support direct --user-regs arguments USER_REGS can currently only collected implicitely with call graph recording. Sometimes it is useful to see them separately, and filter them. Add a new --user-regs option to record that is similar to --intr-regs, but acts on user regs. Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Link: http://lkml.kernel.org/r/20170905170029.19722-1-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-record.txt | 2 ++ tools/perf/builtin-record.c | 3 +++ tools/perf/perf.h | 1 + tools/perf/util/evsel.c | 7 ++++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index e397453..68a1ffb 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -377,6 +377,8 @@ symbolic names, e.g. on x86, ax, si. To list the available registers use --intr-regs=\?. To name registers, pass a comma separated list such as --intr-regs=ax,bx. The list of register is architecture dependent. +--user-regs:: +Capture user registers at sample time. Same arguments as -I. --running-time:: Record running and enabled time for read events (:S) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 56f8142..9b379f3 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1643,6 +1643,9 @@ static struct option __record_options[] = { OPT_CALLBACK_OPTARG('I', "intr-regs", &record.opts.sample_intr_regs, NULL, "any register", "sample selected machine registers on interrupt," " use -I ? to list register names", parse_regs), + OPT_CALLBACK_OPTARG(0, "user-regs", &record.opts.sample_user_regs, NULL, "any register", + "sample selected machine registers on interrupt," + " use -I ? to list register names", parse_regs), OPT_BOOLEAN(0, "running-time", &record.opts.running_time, "Record running/enabled time of read (:S) events"), OPT_CALLBACK('k', "clockid", &record.opts, diff --git a/tools/perf/perf.h b/tools/perf/perf.h index dc442ba..fbb0a9c 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -65,6 +65,7 @@ struct record_opts { unsigned int user_freq; u64 branch_stack; u64 sample_intr_regs; + u64 sample_user_regs; u64 default_interval; u64 user_interval; size_t auxtrace_snapshot_size; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4bb8937..7389746 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -678,7 +678,7 @@ void perf_evsel__config_callchain(struct perf_evsel *evsel, if (!function) { perf_evsel__set_sample_bit(evsel, REGS_USER); perf_evsel__set_sample_bit(evsel, STACK_USER); - attr->sample_regs_user = PERF_REGS_MASK; + attr->sample_regs_user |= PERF_REGS_MASK; attr->sample_stack_user = param->dump_size; attr->exclude_callchain_user = 1; } else { @@ -931,6 +931,11 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, perf_evsel__set_sample_bit(evsel, REGS_INTR); } + if (opts->sample_user_regs) { + attr->sample_regs_user |= opts->sample_user_regs; + perf_evsel__set_sample_bit(evsel, REGS_USER); + } + if (target__has_cpu(&opts->target) || opts->sample_cpu) perf_evsel__set_sample_bit(evsel, CPU); ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-09-22 16:34 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-09-05 17:00 [PATCH 1/2] perf, tools: Support direct --user-regs arguments Andi Kleen 2017-09-05 17:00 ` [PATCH 2/2] perf, tools: Support user regs in perf script Andi Kleen 2017-09-05 17:48 ` Arnaldo Carvalho de Melo 2017-09-05 18:28 ` Andi Kleen 2017-09-05 18:47 ` Arnaldo Carvalho de Melo 2017-09-05 18:49 ` Arnaldo Carvalho de Melo 2017-09-22 16:33 ` [tip:perf/core] perf record: Support direct --user-regs arguments tip-bot for Andi Kleen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox