linux/tools/perf/tests
Kan Liang ffe59788e6 perf test: Add test case for pmu event new style format
Add test case in automated tests suite. It checks not only the two types
of pmu event stytle formats "pmu_event_name" and "cpu/pmu_event_name/",
but also the different formats mixtures which are more likely to trigger
parse issue.

The patch set including this one has been tested by the perf automated
test:

   ./perf test parse -v"

On haswell, ivybridge and Romley platform.

The patch set also has been tested on haswell by the following script.

Note: please make sure that your test system support TSX and
L1-dcache-loads events. Otherwise, you may want to change the events to
other pmu events.

  [lk@localhost ~]$ cat perf_style_test.sh
  # hardware events + kernel pmu event with different style
  perf stat -x, -e cycles,mem-stores,tx-start sleep 2
  perf stat -x, -e cpu-cycles,cycles-ct,cycles-t sleep 2
  perf stat -x, -e cycles,cpu/cycles-ct/,cpu/cycles-t/ sleep 2
  perf stat -x, -e instructions,cpu/tx-start/ sleep 2
  perf stat -x, -e '{cycles,tx-start}' sleep 2
  perf stat -x, -e '{cycles,cpu/tx-start/}' sleep 2

  # HW Cache event + kernel pmu event with different style
  perf stat -x, -e L1-dcache-loads,cpu/mem-stores/,tx-start sleep 2
  perf stat -x, -e L1-dcache-loads,mem-stores,cpu/tx-start/ sleep 2
  perf stat -x, -e '{L1-dcache-loads,mem-stores}' sleep 2
  perf stat -x, -e '{L1-dcache-loads,cpu/tx-start/}' sleep 2

  # Raw event + kernel pmu event with different style:
  perf stat -x, -e cpu/event=0xc0,umask=0x00/,mem-loads,cpu/mem-stores/ sleep 2
  perf stat -x, -e cpu/event=0xc0,umask=0x00/,tx-start,cpu/el-start/ sleep 2
  perf stat -x, -e '{cpu/event=0xc0,umask=0x00/,tx-start}' sleep 2

Signed-off-by: Kan Liang <kan.liang@intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1412694532-23391-5-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-10-15 16:10:24 -03:00
..
attr perf tests: Update attr test with PERF_FLAG_FD_CLOEXEC flag 2014-07-18 09:09:53 +02:00
attr.c tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
attr.py perf tests: Make attr script test event cpu 2013-03-15 13:06:00 -03:00
bp_signal_overflow.c perf tools: Enable close-on-exec flag on perf file descriptor 2014-07-18 09:09:34 +02:00
bp_signal.c perf tools: Enable close-on-exec flag on perf file descriptor 2014-07-18 09:09:34 +02:00
builtin-test.c perf tools: Remove hists from evsel 2014-10-14 17:32:52 -03:00
code-reading.c perf tools: Use tid for finding thread 2014-05-12 11:09:50 +02:00
dso-data.c perf tools: Move pr_* debug macros into debug object 2014-07-17 12:58:39 -03:00
dwarf-unwind.c Revert "perf: Disable PERF_RECORD_MMAP2 support" 2014-06-09 13:34:46 +02:00
evsel-roundtrip-name.c perf tools: Move pr_* debug macros into debug object 2014-07-17 12:58:39 -03:00
evsel-tp-sched.c perf tools: Move pr_* debug macros into debug object 2014-07-17 12:58:39 -03:00
fdarray.c tools lib fd array: Allow associating an integer cookie with each entry 2014-09-25 16:46:55 -03:00
hists_common.c perf tests: Add a test case for cumulating callchains 2014-06-01 14:35:11 +02:00
hists_common.h perf tests: Define and use symbolic names for fake symbols 2014-06-01 14:35:11 +02:00
hists_cumulate.c perf evsel: Add hists helper 2014-10-09 13:13:41 -03:00
hists_filter.c perf evsel: Add hists helper 2014-10-09 13:13:41 -03:00
hists_link.c perf evsel: Add hists helper 2014-10-09 13:13:41 -03:00
hists_output.c perf evsel: Add hists helper 2014-10-09 13:13:41 -03:00
keep-tracking.c tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
make perf tests: Show the inner make output when an error happens 2014-06-09 12:14:22 -03:00
mmap-basic.c perf test: Use strerror_r instead of strerror 2014-08-15 13:07:28 -03:00
mmap-thread-lookup.c perf tests: Add thread maps lookup automated tests 2014-04-28 13:42:52 +02:00
open-syscall-all-cpus.c perf test: Use strerror_r instead of strerror 2014-08-15 13:07:28 -03:00
open-syscall-tp-fields.c perf evlist: Introduce poll method for common code idiom 2014-09-25 16:46:55 -03:00
open-syscall.c perf test: Use strerror_r instead of strerror 2014-08-15 13:07:28 -03:00
parse-events.c perf test: Add test case for pmu event new style format 2014-10-15 16:10:24 -03:00
parse-no-sample-id-all.c perf tools: Move pr_* debug macros into debug object 2014-07-17 12:58:39 -03:00
perf-record.c perf evlist: Introduce poll method for common code idiom 2014-09-25 16:46:55 -03:00
perf-targz-src-pkg perf tools: Add test for building detached source tarballs 2014-01-13 10:06:26 -03:00
perf-time-to-tsc.c perf tools: Move rdtsc() function 2014-07-23 11:48:11 -03:00
pmu.c perf tools: Let default config be defined for a PMU 2014-09-17 17:08:08 -03:00
python-use.c perf tests: Check python path on attr and binding test 2013-01-24 16:40:10 -03:00
rdpmc.c perf test: Use strerror_r instead of strerror 2014-08-15 13:07:28 -03:00
sample-parsing.c perf tools: Move pr_* debug macros into debug object 2014-07-17 12:58:39 -03:00
sw-clock.c perf test: Use strerror_r instead of strerror 2014-08-15 13:07:28 -03:00
switch-tracking.c perf tests: Add a test for tracking with sched_switch 2014-08-22 13:10:35 -03:00
task-exit.c perf evlist: Introduce poll method for common code idiom 2014-09-25 16:46:55 -03:00
tests.h tools lib api: Adopt fdarray class from perf's evlist 2014-09-25 16:46:55 -03:00
thread-mg-share.c perf tools: Move pr_* debug macros into debug object 2014-07-17 12:58:39 -03:00
vmlinux-kallsyms.c perf tests: No need to set up ref_reloc_sym 2014-01-31 17:21:52 -03:00