linux_dsm_epyc7002/tools/perf/util
Thomas Richter 93115d32e8 perf report: Display arch specific diagnostic counter sets, starting with s390
On s390 the event bc000 (also named CF_DIAG) extracts the CPU
Measurement Facility diagnostic counter sets and displays them as
counter number and counter value pairs sorted by counter set number.

Output:
 [root@s35lp76 perf]# ./perf report -D --stdio

 [00000000] Counterset:0 Counters:6
   Counter:000 Value:0x000000000085ec36 Counter:001 Value:0x0000000000796c94
   Counter:002 Value:0x0000000000005ada Counter:003 Value:0x0000000000092460
   Counter:004 Value:0x0000000000006073 Counter:005 Value:0x00000000001a9a73
 [0x000038] Counterset:1 Counters:2
   Counter:000 Value:0x000000000007c59f Counter:001 Value:0x000000000002fad6
 [0x000050] Counterset:2 Counters:16
   Counter:000 Value:000000000000000000 Counter:001 Value:000000000000000000
   Counter:002 Value:000000000000000000 Counter:003 Value:000000000000000000
   Counter:004 Value:000000000000000000 Counter:005 Value:000000000000000000
   Counter:006 Value:000000000000000000 Counter:007 Value:000000000000000000
   Counter:008 Value:000000000000000000 Counter:009 Value:000000000000000000
   Counter:010 Value:000000000000000000 Counter:011 Value:000000000000000000
   Counter:012 Value:000000000000000000 Counter:013 Value:000000000000000000
   Counter:014 Value:000000000000000000 Counter:015 Value:000000000000000000
 [0x0000d8] Counterset:3 Counters:128
   Counter:000 Value:0x000000000000020f Counter:001 Value:0x00000000000001d8
   Counter:002 Value:0x000000000000d7fa Counter:003 Value:0x000000000000008b
   ...

The number in brackets is the offset into the raw data field of the
sample.

New functions trace_event_sample_raw__init() and s390_sample_raw() are
introduced in the code path to enable interpretation on non s390
platforms. This event bc000 attached raw data is generated only on s390
platform. Correct display on other platforms requires correct endianness
handling.

Committer notes:

Added a init function that sets up a evlist function pointer to avoid
repeated tests on evlist->env and calls to perf_env__name() that
involves normalizing, etc, for each PERF_RECORD_SAMPLE.

Removed needless __maybe_unused from the trace_event_raw()
prototype in session.h, move it to be an static function in evlist.

The 'offset' variable is a size_t, not an u64, fix it to avoid this on
some arches:

    CC       /tmp/build/perf/util/s390-sample-raw.o
  util/s390-sample-raw.c: In function 's390_cpumcfdg_testctr':
  util/s390-sample-raw.c:77:4: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'size_t' [-Werror=format=]
      pr_err("Invalid counter set entry at %#"  PRIx64 "\n",
      ^
  cc1: all warnings being treated as errors

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Link: https://lkml.kernel.org/r/9c856ac0-ef23-72b5-901d-a1f815508976@linux.ibm.com
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Link: https://lkml.kernel.org/n/tip-s3jhif06et9ug78qhclw41z1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-01-21 17:00:48 -03:00
..
c++ perf tools: Fix a clang 7.0 compilation error 2018-06-25 11:59:37 -03:00
cs-etm-decoder perf cs-etm: Generate branch sample for exception packet 2018-12-18 12:24:00 -03:00
include Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
intel-pt-decoder perf script: Fix LBR skid dump problems in brstackinsn 2018-12-28 16:33:02 -03:00
libunwind
scripting-engines tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
annotate.c perf annotate: Pass filename to objdump via execl 2019-01-04 12:54:49 -03:00
annotate.h perf annotate: Compute average IPC and IPC coverage per symbol 2018-12-17 14:55:32 -03:00
arm-spe-pkt-decoder.c
arm-spe-pkt-decoder.h
arm-spe.c
arm-spe.h
auxtrace.c perf auxtrace: Alter addr_filter__entire_dso() to work if there are no symbols 2018-12-18 12:21:44 -03:00
auxtrace.h perf script: Make itrace script default to all calls 2018-10-24 15:29:54 -03:00
block-range.c
block-range.h
bpf-loader.c perf bpf-loader: Fix debugging message typo 2018-12-17 14:56:39 -03:00
bpf-loader.h perf bpf: Make bpf__setup_output_event() return the bpf-output event 2018-08-08 15:55:58 -03:00
bpf-prologue.c docs: Fix some broken references 2018-06-15 18:10:01 -03:00
bpf-prologue.h
branch.c
branch.h
Build perf report: Display arch specific diagnostic counter sets, starting with s390 2019-01-21 17:00:48 -03:00
build-id.c
build-id.h
cache.h
call-path.c
call-path.h
callchain.c perf report: Fix wrong iteration count in --branch-history 2019-01-04 12:54:49 -03:00
callchain.h perf report: Fix wrong iteration count in --branch-history 2019-01-04 12:54:49 -03:00
cgroup.c perf cgroup: Make evlist__find_cgroup() more compact 2018-06-04 10:28:50 -03:00
cgroup.h
cloexec.c
cloexec.h
color.c
color.h
comm.c perf tools: Fix struct comm_str removal crash 2018-07-24 14:54:03 -03:00
comm.h
compress.h perf tools: Add is_compressed callback to compressions array 2018-08-20 08:54:59 -03:00
config.c perf config: Modify size factor of snprintf 2018-12-17 14:59:40 -03:00
config.h
counts.c
counts.h
cpumap.c
cpumap.h
cs-etm.c perf cs-etm: Generate branch sample for exception packet 2018-12-18 12:24:00 -03:00
cs-etm.h
ctype.c
data-convert-bt.c tools lib traceevent, perf tools: Rename enum format_flags to enum tep_format_flags 2018-09-19 17:14:13 -03:00
data-convert-bt.h
data-convert.h
data.c
data.h
db-export.c perf db-export: Add trace begin / end branch type variants 2018-09-20 11:10:25 -03:00
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 perf dso: Export data_file_size() method there are no symbols 2018-12-18 12:21:44 -03:00
dso.h perf tools: Remove duplicate headers 2019-01-21 15:15:57 -03:00
dump-insn.c perf script: Fix LBR skid dump problems in brstackinsn 2018-12-28 16:33:02 -03:00
dump-insn.h perf script: Fix LBR skid dump problems in brstackinsn 2018-12-28 16:33:02 -03:00
dwarf-aux.c
dwarf-aux.h
dwarf-regs.c
env.c perf env: Also consider env->arch == NULL as local operation 2018-12-17 14:54:02 -03:00
env.h perf record: Encode -k clockid frequency into Perf trace 2018-10-18 11:16:38 -03:00
event.c perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00
event.h perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00
evlist.c perf tools: Add missing sigqueue() prototype for systems lacking it 2018-12-18 12:23:56 -03:00
evlist.h perf report: Display arch specific diagnostic counter sets, starting with s390 2019-01-21 17:00:48 -03:00
evsel_fprintf.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
evsel.c perf tools: Fix crash on synthesizing the unit 2018-11-12 08:37:49 -08:00
evsel.h tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
expr.h
expr.y
find-map.c perf tools: Make find_vdso_map() more modular 2019-01-08 13:28:13 -03:00
genelf_debug.c
genelf.c
genelf.h perf jitdump: Add Sparc support. 2018-10-18 11:16:38 -03:00
generate-cmdlist.sh
get_current_dir_name.c tools build feature: Check if get_current_dir_name() is available 2018-11-19 12:12:17 -08:00
group.h
header.c perf header: Fix up argument to ctime() 2018-12-18 12:23:56 -03:00
header.h perf record: Encode -k clockid frequency into Perf trace 2018-10-18 11:16:38 -03:00
help-unknown-cmd.c
help-unknown-cmd.h
hist.c perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
hist.h perf report: Display average IPC and IPC coverage per symbol 2018-12-17 14:55:44 -03:00
intel-bts.c perf thread-stack: Fix thread stack processing for the idle task 2019-01-02 11:03:17 -03:00
intel-bts.h
intel-pt.c perf thread-stack: Fix thread stack processing for the idle task 2019-01-02 11:03:17 -03:00
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
jitdump.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c perf bpf: Give precedence to bpf header dir 2018-08-30 15:52:20 -03:00
llvm-utils.h perf llvm: Allow passing options to llc in addition to clang 2018-08-20 08:54:58 -03:00
lzma.c perf tools: Add lzma_is_compressed function 2018-08-20 08:54:59 -03:00
machine.c perf report: Fix wrong iteration count in --branch-history 2019-01-04 12:54:49 -03:00
machine.h perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00
map.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
map.h perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
mem2node.c
mem2node.h
mem-events.c
mem-events.h
memswap.c
memswap.h
metricgroup.c perf list: Unify metric group description format with PMU event description 2018-07-31 11:35:44 -03:00
metricgroup.h perf stat: Add transaction flag (-T) support for s390 2018-07-24 14:49:37 -03:00
mmap.c perf record: Fix memory leak on AIO objects deallocation 2018-12-17 14:59:34 -03:00
mmap.h perf record: Extend trace writing to multi AIO 2018-12-17 14:55:11 -03:00
namespaces.c perf tools: Restore proper cwd on return from mnt namespace 2018-11-19 12:12:26 -08:00
namespaces.h perf tools: Restore proper cwd on return from mnt namespace 2018-11-19 12:12:26 -08:00
ordered-events.c perf ordered_events: Add first_time() method 2018-12-17 15:02:17 -03:00
ordered-events.h perf ordered_events: Add first_time() method 2018-12-17 15:02:17 -03:00
parse-branch-options.c
parse-branch-options.h
parse-events.c perf parse-events: Fix unchecked usage of strncpy() 2018-12-17 14:59:30 -03:00
parse-events.h perf evsel: Introduce per event max_events property 2018-10-19 16:31:09 -03:00
parse-events.l perf evsel: Introduce per event max_events property 2018-10-19 16:31:09 -03:00
parse-events.y perf tools: Fix error index for pmu event parser 2018-06-07 15:50:14 -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: Move *_cpuid_str() weak functions to header.c 2018-11-21 22:39:59 -03:00
pmu.h
pmu.l
pmu.y
print_binary.c
print_binary.h
probe-event.c perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
probe-event.h perf probe: Support SDT markers having reference counter (semaphore) 2018-09-24 04:44:54 -04:00
probe-file.c perf probe: Fix unchecked usage of strncpy() 2018-12-17 14:59:28 -03:00
probe-file.h perf probe: Support SDT markers having reference counter (semaphore) 2018-09-24 04:44:54 -04:00
probe-finder.c
probe-finder.h
pstack.c
pstack.h
python-ext-sources
python.c perf python: Do not force closing original perf descriptor in evlist.get_pollfd() 2018-12-28 16:33:02 -03:00
rb_resort.h
rblist.c
rblist.h
record.c
rwsem.c
rwsem.h
s390-cpumcf-kernel.h perf report: Display arch specific diagnostic counter sets, starting with s390 2019-01-21 17:00:48 -03:00
s390-cpumsf-kernel.h perf report: Add raw report support for s390 auxiliary trace 2018-08-08 15:26:48 -03:00
s390-cpumsf.c perf tools: Cast off_t to s64 to avoid warning on bionic libc 2018-12-18 12:23:57 -03:00
s390-cpumsf.h perf auxtrace: Support for perf report -D for s390 2018-08-03 10:34:18 -03:00
s390-sample-raw.c perf report: Display arch specific diagnostic counter sets, starting with s390 2019-01-21 17:00:48 -03:00
sample-raw.c perf report: Display arch specific diagnostic counter sets, starting with s390 2019-01-21 17:00:48 -03:00
sample-raw.h perf report: Display arch specific diagnostic counter sets, starting with s390 2019-01-21 17:00:48 -03:00
sane_ctype.h
session.c perf report: Display arch specific diagnostic counter sets, starting with s390 2019-01-21 17:00:48 -03:00
session.h perf tools: Remove perf_tool from event_op2 2018-09-19 10:25:10 -03:00
setns.c
setup.py perf python: More portable way to make CFLAGS work with clang 2018-10-08 14:30:45 -03:00
smt.c
smt.h
sort.c perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
sort.h perf report: Display average IPC and IPC coverage per symbol 2018-12-17 14:55:44 -03:00
srccode.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
srccode.h perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
srcline.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
srcline.h perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
stat-display.c perf stat: Fix CSV mode column output for non-cgroup events 2018-12-17 14:53:41 -03:00
stat-shadow.c perf stat: Fix shadow stats for clock events 2018-12-17 14:53:30 -03:00
stat.c perf tools: Remove perf_tool from event_op2 2018-09-19 10:25:10 -03:00
stat.h perf tools: Remove perf_tool from event_op2 2018-09-19 10:25:10 -03:00
strbuf.c perf strbuf: Remove redundant va_end() in strbuf_addv() 2019-01-04 12:54:49 -03:00
strbuf.h
strfilter.c
strfilter.h
string2.h
string.c
strlist.c
strlist.h
svghelper.c perf svghelper: Fix unchecked usage of strncpy() 2018-12-17 14:59:20 -03:00
svghelper.h
symbol_fprintf.c
symbol-elf.c Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-11-03 18:13:43 -07:00
symbol-minimal.c
symbol.c perf symbols: Add 'arch_cpu_idle' to the list of kernel idle symbols 2019-01-09 16:21:15 -03:00
symbol.h perf annotate: Create a annotate2 flag in struct symbol 2018-12-17 14:55:40 -03:00
syscalltbl.c perf trace arm64: Use generated syscall table 2018-07-24 14:53:01 -03:00
syscalltbl.h
target.c
target.h
term.c
term.h
thread_map.c
thread_map.h
thread-stack.c perf thread-stack: Fix thread stack processing for the idle task 2019-01-02 11:03:17 -03:00
thread-stack.h perf thread-stack: Fix thread stack processing for the idle task 2019-01-02 11:03:17 -03:00
thread.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
thread.h perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
time-utils.c
time-utils.h
tool.h perf tools: Remove perf_tool from event_op3 2018-09-19 10:25:10 -03:00
top.c perf top: Move perf_top__reset_sample_counters() to after counts display 2018-12-17 14:58:47 -03:00
top.h perf top: Save and display the drop count stats 2018-12-17 14:58:33 -03:00
trace-event-info.c perf tools: Cleanup trace-event-info 'tdata' leak 2018-10-08 14:23:45 -03:00
trace-event-parse.c tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
trace-event-read.c perf tools: traceevent API cleanup, remove __tep_data2host*() 2018-12-17 14:56:08 -03:00
trace-event-scripting.c tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle 2018-08-10 15:29:35 -03:00
trace-event.c tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
trace-event.h tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
trigger.h
tsc.c
tsc.h
units.c
units.h
unwind-libdw.c perf unwind: Take pgoff into account when reporting elf to libdwfl 2018-10-31 09:57:50 -03:00
unwind-libdw.h
unwind-libunwind-local.c perf script: Show correct offsets for DWARF-based unwinding 2018-07-24 14:53:11 -03:00
unwind-libunwind.c
unwind.h
usage.c
util-cxx.h
util.c perf util: Make copyfile_offset() global 2018-09-19 10:25:12 -03:00
util.h tools build feature: Check if get_current_dir_name() is available 2018-11-19 12:12:17 -08:00
values.c
values.h
vdso.c perf tools: Make find_vdso_map() more modular 2019-01-08 13:28:13 -03:00
vdso.h
xyarray.c
xyarray.h
zlib.c perf tools: Remove duplicate headers 2019-01-21 15:15:57 -03:00