]> granicus.if.org Git - strace/commit
Implement decoding of perf_event_attr structure in perf_event_open syscall
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sat, 3 Sep 2016 11:44:48 +0000 (14:44 +0300)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 31 Oct 2016 01:59:10 +0000 (04:59 +0300)
commit6ed2a84aabdcfceb7a41e557fd5819abb21024ed
treee53f11c948e7ebe47ee87714a0f41b4b9d003f31
parent48dd98ba814e57bedbf952f6e284989b1030dbed
Implement decoding of perf_event_attr structure in perf_event_open syscall

* linux/perf_event_struct.h: New file, definition of struct perf_event_attr
from Linux 4.8
* Makefile.am (strace_SOURCES): Add it.
* xlat/hw_breakpoint_len.in: New file.
* xlat/hw_breakpoint_type.in: Likewise.
* xlat/perf_attr_size.in: Likewise.
* xlat/perf_branch_sample_type.in: Likewise.
* xlat/perf_event_read_format.in: Likewise.
* xlat/perf_event_sample_format.in: Likewise.
* xlat/perf_hw_cache_id.in: Likewise.
* xlat/perf_hw_cache_op_id.in: Likewise.
* xlat/perf_hw_cache_op_result_id.in: Likewise.
* xlat/perf_hw_id.in: Likewise.
* xlat/perf_sw_ids.in: Likewise.
* xlat/perf_type_id.in: Likewise.
* perf.c [HAVE_LINUX_PERF_EVENT_H]: Remove inclusion of
<linux/perf_event.h>.
(PRINT_XLAT): New macro for simplifying printing values from
sorted xlat.
(printxlat_search): New function, wrapper for xlat_search with behaviour
similar to printval.
(print_perf_event_attr): New print_event_attr structure fetching and
printing function.
(SYS_FUNC(perf_event_open)): Use print_perf_event_attr for displaying
attr argument contents.
* tests/perf_event_open.c: Renamed to
tests/perf_event_open_nonverbose.c.
* tests/perf_event_open.test: add -e verbose=none in order to preserve
output format being checked (in case verbose output is enabled,
contents of attr arguments are shown now); rename to
tests/perf_event_open_nonverbose.test; add -e trace=perf_event_open.
19 files changed:
Makefile.am
perf.c
perf_event_struct.h [new file with mode: 0644]
tests/.gitignore
tests/Makefile.am
tests/perf_event_open_nonverbose.c [moved from tests/perf_event_open.c with 100% similarity]
tests/perf_event_open_nonverbose.test [moved from tests/perf_event_open.test with 54% similarity]
xlat/hw_breakpoint_len.in [new file with mode: 0644]
xlat/hw_breakpoint_type.in [new file with mode: 0644]
xlat/perf_attr_size.in [new file with mode: 0644]
xlat/perf_branch_sample_type.in [new file with mode: 0644]
xlat/perf_event_read_format.in [new file with mode: 0644]
xlat/perf_event_sample_format.in [new file with mode: 0644]
xlat/perf_hw_cache_id.in [new file with mode: 0644]
xlat/perf_hw_cache_op_id.in [new file with mode: 0644]
xlat/perf_hw_cache_op_result_id.in [new file with mode: 0644]
xlat/perf_hw_id.in [new file with mode: 0644]
xlat/perf_sw_ids.in [new file with mode: 0644]
xlat/perf_type_id.in [new file with mode: 0644]