perf parse-events: Add new "metric-id" term
Add a new "metric-id" term to events so that metric parsing can set an ID that can be reliably looked up. Metric parsing currently will turn a metric like "instructions/cycles" into a parse events string of "{instructions,cycles}:W". However, parse-events may change "instructions" into "instructions:u" if perf_event_paranoid=2. When this happens expr__resolve_id currently fails as stat-shadow adds the ID "instructions:u" to match with the counter value and the metric tries to look up the ID just "instructions". A later patch will use the new term. An example of the current problem: $ echo -1 > /proc/sys/kernel/perf_event_paranoid $ perf stat -M IPC /bin/true Performance counter stats for '/bin/true': 1,217,161 inst_retired.any # 0.97 IPC 1,250,389 cpu_clk_unhalted.thread 0.002064773 seconds time elapsed 0.002378000 seconds user 0.000000000 seconds sys $ echo 2 > /proc/sys/...
Showing
- tools/perf/util/evsel.c 17 additions, 0 deletionstools/perf/util/evsel.c
- tools/perf/util/evsel.h 2 additions, 0 deletionstools/perf/util/evsel.h
- tools/perf/util/parse-events-hybrid.c 15 additions, 10 deletionstools/perf/util/parse-events-hybrid.c
- tools/perf/util/parse-events-hybrid.h 2 additions, 2 deletionstools/perf/util/parse-events-hybrid.h
- tools/perf/util/parse-events.c 64 additions, 31 deletionstools/perf/util/parse-events.c
- tools/perf/util/parse-events.h 4 additions, 1 deletiontools/perf/util/parse-events.h
- tools/perf/util/parse-events.l 1 addition, 0 deletionstools/perf/util/parse-events.l
- tools/perf/util/pfm.c 2 additions, 1 deletiontools/perf/util/pfm.c
Please register or sign in to comment