Skip to content

Commit

Permalink
perf intel-pt: decoder: Add config bit definitions
Browse files Browse the repository at this point in the history
Tidy up config bit constants to use #define.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20220124084201.2699795-6-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
ahunter6 authored and acmel committed Feb 15, 2022
1 parent f793447 commit cd9111e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/perf/util/intel-pt.c
Expand Up @@ -46,6 +46,10 @@

#define MAX_TIMESTAMP (~0ULL)

#define INTEL_PT_CFG_PASS_THRU BIT_ULL(0)
#define INTEL_PT_CFG_PWR_EVT_EN BIT_ULL(4)
#define INTEL_PT_CFG_BRANCH_EN BIT_ULL(13)

struct range {
u64 start;
u64 end;
Expand Down Expand Up @@ -953,7 +957,8 @@ static bool intel_pt_branch_enable(struct intel_pt *pt)

evlist__for_each_entry(pt->session->evlist, evsel) {
if (intel_pt_get_config(pt, &evsel->core.attr, &config) &&
(config & 1) && !(config & 0x2000))
(config & INTEL_PT_CFG_PASS_THRU) &&
!(config & INTEL_PT_CFG_BRANCH_EN))
return false;
}
return true;
Expand Down Expand Up @@ -3429,7 +3434,7 @@ static int intel_pt_synth_events(struct intel_pt *pt,
id += 1;
}

if (pt->synth_opts.pwr_events && (evsel->core.attr.config & 0x10)) {
if (pt->synth_opts.pwr_events && (evsel->core.attr.config & INTEL_PT_CFG_PWR_EVT_EN)) {
attr.config = PERF_SYNTH_INTEL_MWAIT;
err = intel_pt_synth_event(session, "mwait", &attr, id);
if (err)
Expand Down

0 comments on commit cd9111e

Please sign in to comment.