kernel_optimize_test/tools/perf/util
Kan Liang 80ee8c588a perf stat: Fix duplicate PMU name for interval print
PMU name is printed repeatedly for interval print, for example:

  perf stat --no-merge -e 'unc_m_clockticks' -a -I 1000
  #           time             counts unit events
     1.001053069        243,702,144      unc_m_clockticks [uncore_imc_4]
     1.001053069        244,268,304      unc_m_clockticks [uncore_imc_2]
     1.001053069        244,427,386      unc_m_clockticks [uncore_imc_0]
     1.001053069        244,583,760      unc_m_clockticks [uncore_imc_5]
     1.001053069        244,738,971      unc_m_clockticks [uncore_imc_3]
     1.001053069        244,880,309      unc_m_clockticks [uncore_imc_1]
     2.002024821        240,818,200      unc_m_clockticks [uncore_imc_4] [uncore_imc_4]
     2.002024821        240,767,812      unc_m_clockticks [uncore_imc_2] [uncore_imc_2]
     2.002024821        240,764,215      unc_m_clockticks [uncore_imc_0] [uncore_imc_0]
     2.002024821        240,759,504      unc_m_clockticks [uncore_imc_5] [uncore_imc_5]
     2.002024821        240,755,992      unc_m_clockticks [uncore_imc_3] [uncore_imc_3]
     2.002024821        240,750,403      unc_m_clockticks [uncore_imc_1] [uncore_imc_1]

For each print, the PMU name is unconditionally appended to the
counter->name.

Need to check the counter->name first. If the PMU name is already
appended, do nothing.

Committer notes:

Add and use perf_evsel->uniquified_name bool instead of doing the more
expensive strstr(event->name, pmu->name).

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Agustin Vega-Frias <agustinv@codeaurora.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Fixes: 8c5421c016 ("perf pmu: Display pmu name when printing unmerged events in stat")
Link: http://lkml.kernel.org/r/1524594014-79243-5-git-send-email-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-04-24 16:12:00 -03:00
..
c++ perf tests clang: Fix function name for clang IR test 2018-04-09 11:13:09 -03:00
cs-etm-decoder coresight: Move to SPDX identifier 2018-04-19 12:29:41 -03:00
include
intel-pt-decoder
libunwind
scripting-engines
annotate.c perf annotate: Allow setting the offset level in .perfconfig 2018-04-13 10:00:05 -03:00
annotate.h perf annotate: Allow showing offsets in more than just jump targets 2018-04-12 10:32:39 -03:00
arm-spe-pkt-decoder.c
arm-spe-pkt-decoder.h
arm-spe.c
arm-spe.h
auxtrace.c perf auxtrace: Make auxtrace_queues__add_buffer() do CPU filtering 2018-04-06 09:40:41 -03:00
auxtrace.h
block-range.c
block-range.h
bpf-loader.c
bpf-loader.h
bpf-prologue.c
bpf-prologue.h
branch.c
branch.h
Build
build-id.c
build-id.h
cache.h
call-path.c
call-path.h
callchain.c
callchain.h
cgroup.c
cgroup.h
cloexec.c
cloexec.h
color.c
color.h
comm.c
comm.h
compress.h
config.c
config.h
counts.c
counts.h
cpumap.c
cpumap.h
cs-etm.c coresight: Move to SPDX identifier 2018-04-19 12:29:41 -03:00
cs-etm.h coresight: Move to SPDX identifier 2018-04-19 12:29:41 -03:00
ctype.c
data-convert-bt.c
data-convert-bt.h
data-convert.h
data.c
data.h
db-export.c
db-export.h
debug.c
debug.h
demangle-java.c
demangle-java.h
demangle-rust.c
demangle-rust.h
drv_configs.c
drv_configs.h
dso.c
dso.h
dump-insn.c
dump-insn.h
dwarf-aux.c
dwarf-aux.h
dwarf-regs.c
env.c
env.h
event.c perf report: Extend raw dump (-D) out with switch out event type 2018-04-17 09:47:39 -03:00
event.h
evlist.c
evlist.h
evsel_fprintf.c
evsel.c perf evsel: Only fall back group read for leader 2018-04-24 16:11:59 -03:00
evsel.h perf stat: Fix duplicate PMU name for interval print 2018-04-24 16:12:00 -03:00
expr.h
expr.y
find-vdso-map.c
genelf_debug.c
genelf.c
genelf.h
generate-cmdlist.sh perf tools: Rename HAVE_SYSCALL_TABLE to HAVE_SYSCALL_TABLE_SUPPORT 2018-04-12 10:33:31 -03:00
group.h
header.c perf record: Change warning for missing sysfs entry to debug 2018-04-13 09:59:56 -03:00
header.h
help-unknown-cmd.c
help-unknown-cmd.h
hist.c perf hists: Move hists__scnprintf_title() away from the TUI code 2018-04-03 10:23:32 -03:00
hist.h perf hists: Introduce hists__scnprint_title() 2018-04-03 10:23:18 -03:00
intel-bts.c
intel-bts.h
intel-pt.c
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c
jitdump.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c
llvm-utils.h
lzma.c
machine.c perf machine: Set main kernel end address properly 2018-04-23 10:52:55 -03:00
machine.h
map.c
map.h
mem-events.c
mem-events.h
mem2node.c
mem2node.h
memswap.c
memswap.h
metricgroup.c
metricgroup.h
mmap.c
mmap.h
namespaces.c
namespaces.h
ordered-events.c
ordered-events.h
parse-branch-options.c
parse-branch-options.h
parse-events.c
parse-events.h
parse-events.l
parse-events.y perf pmu: Fix pmu events parsing rule 2018-04-23 11:17:27 -03:00
parse-regs-options.c
parse-regs-options.h
path.c
path.h
perf_regs.c
perf_regs.h
perf-hooks-list.h
perf-hooks.c
perf-hooks.h
PERF-VERSION-GEN
pmu.c perf pmu: Fix core PMU alias list for X86 platform 2018-04-24 16:02:29 -03:00
pmu.h
pmu.l
pmu.y
print_binary.c
print_binary.h
probe-event.c
probe-event.h
probe-file.c
probe-file.h
probe-finder.c
probe-finder.h
pstack.c
pstack.h
python-ext-sources
python.c
quote.c
quote.h
rb_resort.h
rblist.c
rblist.h
record.c
rwsem.c
rwsem.h
sane_ctype.h
session.c perf report: Remove duplicated 'samples' in lost samples warning 2018-04-05 14:34:09 -03:00
session.h
setns.c
setup.py
smt.c
smt.h
sort.c
sort.h
srcline.c
srcline.h
stat-shadow.c
stat.c
stat.h
strbuf.c
strbuf.h
strfilter.c
strfilter.h
string.c
string2.h
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol_fprintf.c
symbol-elf.c
symbol-minimal.c
symbol.c perf report: Fix switching to another perf.data file 2018-04-13 10:00:04 -03:00
symbol.h
syscalltbl.c perf tools: Rename HAVE_SYSCALL_TABLE to HAVE_SYSCALL_TABLE_SUPPORT 2018-04-12 10:33:31 -03:00
syscalltbl.h
target.c
target.h
term.c
term.h
thread_map.c
thread_map.h
thread-stack.c
thread-stack.h
thread.c
thread.h
time-utils.c
time-utils.h
tool.h
top.c
top.h
trace-event-info.c
trace-event-parse.c
trace-event-read.c
trace-event-scripting.c perf script: Use HAVE_LIBXXX_SUPPORT to replace NO_LIBXXX 2018-04-12 10:33:29 -03:00
trace-event.c
trace-event.h
trigger.h
tsc.c
tsc.h
units.c
units.h
unwind-libdw.c
unwind-libdw.h
unwind-libunwind-local.c
unwind-libunwind.c
unwind.h
usage.c
util-cxx.h
util.c
util.h perf tools: No need to include namespaces.h in util.h 2018-04-09 10:57:50 -03:00
values.c
values.h
vdso.c
vdso.h
xyarray.c
xyarray.h
zlib.c