strace/perf_event_struct.h
Eugene Syromyatnikov 6ed2a84aab 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.
2016-10-31 04:59:10 +03:00

74 lines
2.0 KiB
C

#ifndef STRACE_LINUX_PERF_EVENT_STRUCT_H
#define STRACE_LINUX_PERF_EVENT_STRUCT_H
#include <stdint.h>
struct perf_event_attr {
uint32_t type;
uint32_t size;
uint64_t config;
union {
uint64_t sample_period;
uint64_t sample_freq;
};
uint64_t sample_type;
uint64_t read_format;
uint64_t disabled :1,
inherit :1,
pinned :1,
exclusive :1,
exclude_user :1,
exclude_kernel :1,
exclude_hv :1,
exclude_idle :1,
mmap :1,
comm :1,
freq :1,
inherit_stat :1,
enable_on_exec :1,
task :1,
watermark :1,
precise_ip :2,
mmap_data :1,
sample_id_all :1,
exclude_host :1,
exclude_guest :1,
exclude_callchain_kernel :1,
exclude_callchain_user :1,
mmap2 :1,
comm_exec :1,
use_clockid :1,
context_switch :1,
write_backward :1,
__reserved_1 :36;
union {
uint32_t wakeup_events;
uint32_t wakeup_watermark;
};
uint32_t bp_type;
union {
uint64_t bp_addr;
uint64_t config1;
};
/* End of ver 0 - 64 bytes */
union {
uint64_t bp_len;
uint64_t config2;
};
/* End of ver 1 - 72 bytes */
uint64_t branch_sample_type;
/* End of ver 2 - 80 bytes */
uint64_t sample_regs_user;
uint32_t sample_stack_user;
int32_t clockid;
/* End of ver 3 - 96 bytes */
uint64_t sample_regs_intr;
/* End of ver 4 - 104 bytes */
uint32_t aux_watermark;
uint16_t sample_max_stack;
uint16_t __reserved_2;
/* End of ver 5 - 112 bytes */
};
#endif /* !STRACE_LINUX_PERF_EVENT_STRUCT_H */