17 #include <sys/types.h> 24 #include <linux/kernel.h> 25 #include <linux/perf_event.h> 26 #include <linux/types.h> 27 #include <linux/bitops.h> 28 #include <linux/log2.h> 29 #include <linux/string.h> 31 #include <sys/param.h> 34 #include <linux/list.h> 48 #include <linux/hash.h> 53 #include <subcmd/parse-options.h> 61 #include "symbol/kallsyms.h" 73 struct perf_event_mmap_page *pc = userpg;
75 WARN_ONCE(mm->
base,
"Uninitialized auxtrace_mmap\n");
90 #if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT) 91 pr_err(
"Cannot use AUX area tracing mmaps\n");
95 pc->aux_offset = mp->
offset;
96 pc->aux_size = mp->
len;
99 if (mm->
base == MAP_FAILED) {
117 off_t auxtrace_offset,
118 unsigned int auxtrace_pages,
119 bool auxtrace_overwrite)
121 if (auxtrace_pages) {
122 mp->
offset = auxtrace_offset;
124 mp->
mask = is_power_of_2(mp->
len) ? mp->
len - 1 : 0;
125 mp->
prot = PROT_READ | (auxtrace_overwrite ? 0 : PROT_WRITE);
150 #define AUXTRACE_INIT_NR_QUEUES 32 155 unsigned int max_nr_queues, i;
158 if (nr_queues > max_nr_queues)
165 for (i = 0; i < nr_queues; i++) {
166 INIT_LIST_HEAD(&queue_array[i].
head);
167 queue_array[i].
priv = NULL;
183 unsigned int new_nr_queues)
185 unsigned int nr_queues = queues->
nr_queues;
192 while (nr_queues && nr_queues < new_nr_queues)
195 if (nr_queues < queues->nr_queues || nr_queues < new_nr_queues)
202 for (i = 0; i < queues->
nr_queues; i++) {
204 &queue_array[i].
head);
220 if (size > SSIZE_MAX)
227 ret =
readn(fd, p, size);
228 if (ret != (ssize_t)size) {
255 }
else if (buffer->
cpu != queue->
cpu || buffer->
tid != queue->
tid) {
256 pr_err(
"auxtrace queue conflict: cpu %d, tid %d vs cpu %d, tid %d\n",
263 list_add_tail(&buffer->
list, &queue->
head);
272 #define BUFFER_LIMIT_FOR_32_BIT (32 * 1024 * 1024) 278 u64 sz = buffer->
size;
279 bool consecutive =
false;
309 return cpu_bitmap && cpu != -1 && !test_bit(cpu, cpu_bitmap);
323 buffer = memdup(buffer,
sizeof(*buffer));
335 }
else if (BITS_PER_LONG == 32 &&
348 *buffer_ptr = buffer;
364 .tid =
event->auxtrace.tid,
365 .cpu =
event->auxtrace.cpu,
367 .offset =
event->auxtrace.offset,
368 .reference =
event->auxtrace.reference,
369 .size =
event->auxtrace.size,
371 unsigned int idx =
event->auxtrace.idx;
379 off_t file_offset,
size_t sz)
392 event->
header.size != sz) {
396 file_offset +=
event->header.size;
408 for (i = 0; i < queues->
nr_queues; i++) {
414 list_del(&buffer->
list);
424 unsigned int pos,
unsigned int queue_nr,
430 parent = (pos - 1) >> 1;
431 if (heap_array[parent].ordinal <= ordinal)
433 heap_array[pos] = heap_array[parent];
436 heap_array[pos].
queue_nr = queue_nr;
437 heap_array[pos].
ordinal = ordinal;
445 if (queue_nr >= heap->
heap_sz) {
448 while (heap_sz <= queue_nr)
472 unsigned int pos, last, heap_cnt = heap->
heap_cnt;
484 unsigned int left, right;
486 left = (pos << 1) + 1;
487 if (left >= heap_cnt)
490 if (right >= heap_cnt) {
491 heap_array[pos] = heap_array[left];
495 heap_array[pos] = heap_array[left];
498 heap_array[pos] = heap_array[right];
518 pr_err(
"AUX area tracing is not supported on this architecture\n");
528 return itr->
info_fill(itr, session, auxtrace_info, priv_size);
554 unsigned char *
data, u64 *head, u64 *old)
586 pr_err(
"No AUX area tracing to snapshot\n");
601 auxtrace_index =
malloc(
sizeof(
struct auxtrace_index));
605 auxtrace_index->
nr = 0;
606 INIT_LIST_HEAD(&auxtrace_index->
list);
608 list_add_tail(&auxtrace_index->
list, head);
617 list_for_each_entry_safe(auxtrace_index, n, head,
list) {
618 list_del(&auxtrace_index->
list);
619 free(auxtrace_index);
628 if (list_empty(head)) {
634 auxtrace_index = list_entry(head->prev,
struct auxtrace_index,
list);
640 auxtrace_index = list_entry(head->prev,
struct auxtrace_index,
644 return auxtrace_index;
657 nr = auxtrace_index->
nr;
659 auxtrace_index->
entries[
nr].
sz =
event->header.size;
660 auxtrace_index->
nr += 1;
671 for (i = 0; i < auxtrace_index->
nr; i++) {
674 if (
writen(fd, &ent,
sizeof(ent)) !=
sizeof(ent))
686 list_for_each_entry(auxtrace_index, head,
list)
687 total += auxtrace_index->
nr;
689 if (
writen(fd, &total,
sizeof(total)) !=
sizeof(total))
692 list_for_each_entry(auxtrace_index, head,
list) {
708 if (
readn(fd, &ent,
sizeof(ent)) !=
sizeof(ent))
715 nr = auxtrace_index->
nr;
725 auxtrace_index->
nr = nr + 1;
736 if (
readn(fd, &nr,
sizeof(u64)) !=
sizeof(u64))
775 list_for_each_entry(auxtrace_index, &session->
auxtrace_index, list) {
776 for (i = 0; i < auxtrace_index->
nr; i++) {
777 ent = &auxtrace_index->
entries[i];
792 if (list_is_last(&buffer->
list, &queue->
head))
797 if (list_empty(&queue->
head))
814 addr = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, file_offset);
815 if (addr == MAP_FAILED)
821 buffer->
data = addr + adj;
855 int code,
int cpu, pid_t
pid, pid_t
tid, u64 ip,
863 auxtrace_error->
type = type;
864 auxtrace_error->
code = code;
865 auxtrace_error->
cpu =
cpu;
866 auxtrace_error->
pid =
pid;
867 auxtrace_error->
tid =
tid;
868 auxtrace_error->
ip = ip;
871 size = (
void *)auxtrace_error->
msg - (
void *)auxtrace_error +
872 strlen(auxtrace_error->
msg) + 1;
873 auxtrace_error->
header.size = PERF_ALIGN(size,
sizeof(u64));
885 pr_debug2(
"Synthesizing auxtrace information\n");
899 err = process(tool, ev, NULL, NULL);
912 fprintf(stdout,
" type: %u\n", type);
936 fprintf(stdout,
" size: %#"PRIx64
" offset: %#"PRIx64
" ref: %#"PRIx64
" idx: %u tid: %d cpu: %d\n",
942 return event->auxtrace.size;
951 return event->auxtrace.size;
954 #define PERF_ITRACE_DEFAULT_PERIOD_TYPE PERF_ITRACE_PERIOD_NANOSECS 955 #define PERF_ITRACE_DEFAULT_PERIOD 100000 956 #define PERF_ITRACE_DEFAULT_CALLCHAIN_SZ 16 957 #define PERF_ITRACE_MAX_CALLCHAIN_SZ 1024 958 #define PERF_ITRACE_DEFAULT_LAST_BRANCH_SZ 64 959 #define PERF_ITRACE_MAX_LAST_BRANCH_SZ 1024 968 synth_opts->
errors =
true;
987 bool period_type_set =
false;
988 bool period_set =
false;
990 synth_opts->
set =
true;
1002 for (p = str; *p;) {
1006 while (*p ==
' ' || *p ==
',')
1009 synth_opts->
period = strtoull(p, &endptr, 10);
1012 while (*p ==
' ' || *p ==
',')
1018 period_type_set =
true;
1023 period_type_set =
true;
1026 synth_opts->
period *= 1000;
1029 synth_opts->
period *= 1000;
1036 period_type_set =
true;
1058 synth_opts->
errors =
true;
1061 synth_opts->
log =
true;
1065 synth_opts->
calls =
true;
1075 while (*p ==
' ' || *p ==
',')
1080 val = strtoul(p, &endptr, 10);
1091 while (*p ==
' ' || *p ==
',')
1096 val = strtoul(p, &endptr, 10);
1119 if (!period_type_set)
1129 pr_err(
"Bad Instruction Tracing options '%s'\n", str);
1139 const char *error_type_name = NULL;
1143 if (!error_type_name)
1144 error_type_name =
"unknown AUX";
1145 return error_type_name;
1153 ret = fprintf(fp,
" %s error type %u",
1155 ret += fprintf(fp,
" cpu %d pid %d tid %d ip %#"PRIx64
" code %u: %s\n",
1196 bool snapshot,
size_t snapshot_size)
1198 u64 head, old = mm->
prev, offset, ref;
1200 size_t size, head_off, old_off, len1, len2, padding;
1202 void *data1, *data2;
1205 head = auxtrace_mmap__read_snapshot_head(mm);
1210 head = auxtrace_mmap__read_head(mm);
1216 pr_debug3(
"auxtrace idx %d old %#"PRIx64
" head %#"PRIx64
" diff %#"PRIx64
"\n",
1217 mm->
idx, old, head, head - old);
1220 head_off = head & mm->
mask;
1221 old_off = old & mm->
mask;
1223 head_off = head % mm->
len;
1224 old_off = old % mm->
len;
1227 if (head_off > old_off)
1228 size = head_off - old_off;
1230 size = mm->
len - (old_off - head_off);
1232 if (snapshot && size > snapshot_size)
1233 size = snapshot_size;
1237 if (head > old || size <= head || mm->mask) {
1238 offset = head -
size;
1245 u64 rem = (0ULL - mm->
len) % mm->
len;
1247 offset = head - size - rem;
1250 if (size > head_off) {
1251 len1 = size - head_off;
1252 data1 = &data[mm->
len - len1];
1257 data1 = &data[head_off - len1];
1263 unsigned int unwanted = len1 % itr->
alignment;
1272 padding = 8 - padding;
1274 memset(&ev, 0,
sizeof(ev));
1284 if (fn(tool, &ev, data1, len1, data2, len2))
1290 auxtrace_mmap__write_tail(mm, head);
1312 size_t snapshot_size)
1337 unsigned int limit_percent)
1340 struct hlist_head *ht;
1349 ht = calloc(sz,
sizeof(
struct hlist_head));
1353 for (i = 0; i <
sz; i++)
1354 INIT_HLIST_HEAD(&ht[i]);
1359 c->
limit = (c->
sz * limit_percent) / 100;
1371 struct auxtrace_cache_entry *
entry;
1372 struct hlist_node *tmp;
1378 for (i = 0; i < c->
sz; i++) {
1379 hlist_for_each_entry_safe(entry, tmp, &c->
hashtable[i], hash) {
1380 hlist_del(&entry->hash);
1410 struct auxtrace_cache_entry *
entry)
1416 hlist_add_head(&entry->hash, &c->
hashtable[hash_32(key, c->
bits)]);
1423 struct auxtrace_cache_entry *
entry;
1424 struct hlist_head *hlist;
1430 hlist_for_each_entry(entry, hlist, hash) {
1431 if (entry->key == key)
1453 INIT_LIST_HEAD(&filt->
list);
1468 list_add_tail(&filt->
list, &filts->
head);
1475 list_del_init(&filt->
list);
1481 INIT_LIST_HEAD(&filts->
head);
1489 list_for_each_entry_safe(filt, n, &filts->
head,
list) {
1496 const char *str_delim)
1498 *inp += strspn(*inp,
" ");
1506 *num = strtoull(*inp, &endptr, 0);
1517 *inp += strspn(*inp,
" ");
1519 n = strcspn(*inp, str_delim);
1533 if (!strcmp(filt->
action,
"filter")) {
1536 }
else if (!strcmp(filt->
action,
"start")) {
1538 }
else if (!strcmp(filt->
action,
"stop")) {
1539 filt->
start =
false;
1540 }
else if (!strcmp(filt->
action,
"tracestop")) {
1541 filt->
start =
false;
1554 *inp += strspn(*inp,
" ");
1561 if (**inp ==
'g' || **inp ==
'G') {
1569 num = strtoul(*inp, &endptr, 0);
1572 if (endptr == *inp || num > INT_MAX)
1596 filt->
str = fstr = strdup(*filter_inp);
1613 fstr += strspn(fstr,
" ");
1624 fstr += strspn(fstr,
" ");
1633 fstr += strspn(fstr,
" ,");
1635 *filter_inp += fstr - filt->
str;
1649 const char *fstr =
filter;
1682 return kallsyms__is_function(type) &&
1683 !strcmp(name, args->
name) &&
1716 pr_err(
"#%d\t0x%"PRIx64
"\t%c\t%s\n",
1717 ++args->
cnt, start, type, name);
1719 }
else if (args->
near) {
1721 pr_err(
"\t\twhich is near\t\t%s\n", name);
1730 pr_err(
"N'th occurrence (N=%d) of symbol '%s' not found.\n",
1733 pr_err(
"Global symbol '%s' not found.\n", sym_name);
1735 pr_err(
"Symbol '%s' not found.\n", sym_name);
1737 pr_err(
"Note that symbols must be functions.\n");
1748 .selected = idx > 0,
1757 pr_err(
"Failed to parse /proc/kallsyms\n");
1762 pr_err(
"Multiple kernel symbols with name '%s'\n", sym_name);
1765 pr_err(
"Disambiguate symbol name by inserting #n after the name e.g. %s #2\n",
1767 pr_err(
"Or select a global symbol by inserting #0 or #g or #G\n");
1772 pr_err(
"Kernel symbol lookup: ");
1776 *start = args.
start;
1783 char type, u64
start)
1787 if (!kallsyms__is_function(type))
1806 if (err < 0 || !args.
started) {
1807 pr_err(
"Failed to parse /proc/kallsyms\n");
1819 if (start + size >= filt->
addr)
1823 pr_err(
"Symbol '%s' (0x%"PRIx64
") comes before '%s' (0x%"PRIx64
")\n",
1826 pr_err(
"Symbol '%s' (0x%"PRIx64
") comes before address 0x%"PRIx64
")\n",
1835 bool no_size =
false;
1840 pr_err(
"Kernel addresses are restricted. Unable to resolve kernel symbols.\n");
1868 filt->
size = start + size - filt->
addr;
1874 pr_err(
"Cannot determine size of symbol '%s'\n",
1905 ((!idx && sym->
binding == STB_GLOBAL) ||
1906 (idx > 0 && ++*cnt == idx) ||
1916 pr_err(
"Multiple symbols with name '%s'\n", sym_name);
1921 pr_err(
"#%d\t0x%"PRIx64
"\t%c\t%s\n",
1923 sym->
binding == STB_GLOBAL ?
'g' :
1924 sym->
binding == STB_LOCAL ?
'l' :
'w',
1929 pr_err(
"\t\twhich is near\t\t%s\n", sym->
name);
1934 pr_err(
"Disambiguate symbol name by inserting #n after the name e.g. %s #2\n",
1936 pr_err(
"Or select a global symbol by inserting #0 or #g or #G\n");
1961 *start = sym->
start;
1978 if (!first_sym || !last_sym) {
1979 pr_err(
"Failed to determine filter for %s\nNo symbols found.\n",
2033 filt->
size = start + size - filt->
addr;
2045 const char *at =
"";
2046 const char *fn =
"";
2052 fn = realpath(filt->
filename, filename_buf);
2058 err = asprintf(&filter,
"%s 0x%"PRIx64
"/0x%"PRIx64
"%s%s",
2061 err = asprintf(&filter,
"%s 0x%"PRIx64
"%s%s",
2065 return err < 0 ? NULL :
filter;
2081 if (filts.
cnt > max_nr) {
2082 pr_err(
"Error: number of address filters (%d) exceeds maximum (%d)\n",
2088 list_for_each_entry(filt, &filts.
head,
list) {
2111 pr_err(
"Failed to parse address filter: '%s'\n", filter);
2112 pr_err(
"Filter format is: filter|start|stop|tracestop <start symbol or address> [/ <end symbol or size>] [@<file name>]\n");
2113 pr_err(
"Where multiple filters are separated by space or comma.\n");
2134 int nr_addr_filters = 0;
2141 return nr_addr_filters;
2153 if (!filter || !max_nr)
static const char * auxtrace_error_name(int type)
void auxtrace_cache__free_entry(struct auxtrace_cache *c __maybe_unused, void *entry)
struct perf_evlist * evlist
int(* snapshot_start)(struct auxtrace_record *itr)
void perf_session__auxtrace_error_inc(struct perf_session *session, union perf_event *event)
static int parse_sym_idx(char **inp, int *idx)
#define PERF_ITRACE_MAX_CALLCHAIN_SZ
struct perf_event_header header
static int auxtrace_queues__split_buffer(struct auxtrace_queues *queues, unsigned int idx, struct auxtrace_buffer *buffer)
static struct auxtrace_index * auxtrace_index__last(struct list_head *head)
int(* perf_event__handler_t)(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
int auxtrace_queues__process_index(struct auxtrace_queues *queues, struct perf_session *session)
void auxtrace_buffer__free(struct auxtrace_buffer *buffer)
static int addr_filter__resolve_syms(struct addr_filter *filt)
static void addr_filter__free_str(struct addr_filter *filt)
struct auxtrace_record * auxtrace_record__init(struct perf_evlist *evlist, int *err)
static void addr_filter__free(struct addr_filter *filt)
void * auxtrace_buffer__get_data(struct auxtrace_buffer *buffer, int fd)
struct auxtrace_queue * queue_array
struct auxtrace * auxtrace
int auxtrace_index__process(int fd, u64 size, struct perf_session *session, bool needs_swap)
int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr, struct perf_tool *tool, struct perf_session *session, perf_event__handler_t process)
void addr_filters__exit(struct addr_filters *filts)
void auxtrace_cache__free(struct auxtrace_cache *c)
struct auxtrace_heap_item * heap_array
ssize_t readn(int fd, void *buf, size_t n)
#define MAX_AUXTRACE_ERROR_MSG
#define PERF_ITRACE_DEFAULT_PERIOD_TYPE
unsigned int callchain_sz
char msg[MAX_AUXTRACE_ERROR_MSG]
int ui__warning(const char *format,...)
struct auxtrace_buffer * auxtrace_buffer__next(struct auxtrace_queue *queue, struct auxtrace_buffer *buffer)
static int auxtrace_index__alloc(struct list_head *head)
int(* snapshot_finish)(struct auxtrace_record *itr)
struct itrace_synth_opts * itrace_synth_opts
static int sym_not_found_error(const char *sym_name, int idx)
static char * addr_filter__to_str(struct addr_filter *filt)
int auxtrace_parse_snapshot_options(struct auxtrace_record *itr, struct record_opts *opts, const char *str)
static int __auxtrace_mmap__read(struct auxtrace_mmap *mm, struct auxtrace_record *itr, struct perf_tool *tool, process_auxtrace_t fn, bool snapshot, size_t snapshot_size)
int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt,...)
#define pr_debug2(fmt,...)
#define PERF_ITRACE_MAX_LAST_BRANCH_SZ
void auxtrace_synth_error(struct auxtrace_error_event *auxtrace_error, int type, int code, int cpu, pid_t pid, pid_t tid, u64 ip, const char *msg)
size_t(* info_priv_size)(struct auxtrace_record *itr, struct perf_evlist *evlist)
static int auxtrace_queues__add_indexed_event(struct auxtrace_queues *queues, struct perf_session *session, off_t file_offset, size_t sz)
size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp)
static int auxtrace_not_supported(void)
int auxtrace_queues__add_event(struct auxtrace_queues *queues, struct perf_session *session, union perf_event *event, off_t data_offset, struct auxtrace_buffer **buffer_ptr)
static int parse_action(struct addr_filter *filt)
int auxtrace_record__options(struct auxtrace_record *itr, struct perf_evlist *evlist, struct record_opts *opts)
struct map * dso__new_map(const char *name)
int auxtrace_mmap__read(struct auxtrace_mmap *mm, struct auxtrace_record *itr, struct perf_tool *tool, process_auxtrace_t fn)
static int auxtrace_queues__grow(struct auxtrace_queues *queues, unsigned int new_nr_queues)
static void addr_filters__del(struct addr_filters *filts, struct addr_filter *filt)
int auxtrace_cache__add(struct auxtrace_cache *c, u32 key, struct auxtrace_cache_entry *entry)
struct thread_map * threads
int auxtrace_record__find_snapshot(struct auxtrace_record *itr, int idx, struct auxtrace_mmap *mm, unsigned char *data, u64 *head, u64 *old)
#define PERF_ITRACE_DEFAULT_CALLCHAIN_SZ
int auxtrace_record__snapshot_finish(struct auxtrace_record *itr)
#define PERF_ITRACE_DEFAULT_PERIOD
static int find_entire_kern_cb(void *arg, const char *name __maybe_unused, char type, u64 start)
static void print_duplicate_syms(struct dso *dso, const char *sym_name)
static int find_kern_sym_cb(void *arg, const char *name, char type, u64 start)
x86 movsq based memset() in arch/x86/lib/memset_64.S") MEMSET_FN(memset_erms
void addr_filters__init(struct addr_filters *filts)
int intel_bts_process_auxtrace_info(union perf_event *event, struct perf_session *session)
int perf_event__process_auxtrace_error(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_session *session)
void map__put(struct map *map)
void dso__put(struct dso *dso)
struct perf_pmu * perf_pmu__scan(struct perf_pmu *pmu)
int perf_evsel__append_addr_filter(struct perf_evsel *evsel, const char *filter)
int auxtrace_record__info_fill(struct auxtrace_record *itr, struct perf_session *session, struct auxtrace_info_event *auxtrace_info, size_t priv_size)
int(* read_finish)(struct auxtrace_record *itr, int idx)
#define AUXTRACE_INIT_NR_QUEUES
int auxtrace_record__snapshot_start(struct auxtrace_record *itr)
int auxtrace_parse_filters(struct perf_evlist *evlist)
u64(* reference)(struct auxtrace_record *itr)
#define pr_debug(fmt,...)
static int auxtrace_index__do_write(int fd, struct auxtrace_index *auxtrace_index)
static int parse_addr_size(char **inp, u64 *num, const char **str, int *idx)
static struct perf_session * session
int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, struct auxtrace_mmap_params *mp, void *userpg, int fd)
#define evlist__for_each_entry(evlist, evsel)
void auxtrace_buffer__put_data(struct auxtrace_buffer *buffer)
static int addr_filter__entire_kernel(struct addr_filter *filt)
static int entry(u64 ip, struct unwind_info *ui)
void(* free)(struct auxtrace_record *itr)
static int auxtrace_queues__process_index_entry(struct auxtrace_queues *queues, struct perf_session *session, struct auxtrace_index_entry *ent)
static bool filter_cpu(struct perf_session *session, int cpu)
void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts)
static int addr_filter__entire_dso(struct addr_filter *filt, struct dso *dso)
static struct perf_tool tool
int itrace_parse_synth_opts(const struct option *opt, const char *str, int unset)
int(* recording_options)(struct auxtrace_record *itr, struct perf_evlist *evlist, struct record_opts *opts)
void auxtrace_index__free(struct list_head *head)
static int parse_num_or_str(char **inp, u64 *num, const char **str, const char *str_delim)
static int str(yyscan_t scanner, int token)
static void * auxtrace_copy_data(u64 size, struct perf_session *session)
struct auxtrace_index_entry entries[PERF_AUXTRACE_INDEX_ENTRY_COUNT]
struct dso * dso__get(struct dso *dso)
unsigned long long period
void auxtrace_heap__free(struct auxtrace_heap *heap)
struct symbol * dso__last_symbol(struct dso *dso)
struct auxtrace_cache * auxtrace_cache__new(unsigned int bits, size_t entry_size, unsigned int limit_percent)
#define PERF_AUXTRACE_INDEX_ENTRY_COUNT
void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp, struct perf_evlist *evlist, int idx, bool per_cpu)
void auxtrace_buffer__drop_data(struct auxtrace_buffer *buffer)
int intel_pt_process_auxtrace_info(union perf_event *event, struct perf_session *session)
s64 perf_event__process_auxtrace(struct perf_tool *tool, union perf_event *event, struct perf_session *session)
int perf_event__process_auxtrace_info(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_session *session)
u32 nr_auxtrace_errors[PERF_AUXTRACE_ERROR_MAX]
void auxtrace_record__free(struct auxtrace_record *itr)
int auxtrace_mmap__read_snapshot(struct auxtrace_mmap *mm, struct auxtrace_record *itr, struct perf_tool *tool, process_auxtrace_t fn, size_t snapshot_size)
static int addr_filter__resolve_kernel_syms(struct addr_filter *filt)
static int perf_data__fd(struct perf_data *data)
int(* parse_snapshot_options)(struct auxtrace_record *itr, struct record_opts *opts, const char *str)
static struct addr_filter * addr_filter__new(void)
int(* find_snapshot)(struct auxtrace_record *itr, int idx, struct auxtrace_mmap *mm, unsigned char *data, u64 *head, u64 *old)
unsigned int last_branch_sz
void auxtrace_mmap__munmap(struct auxtrace_mmap *mm)
struct perf_event_header header
#define PERF_ITRACE_DEFAULT_LAST_BRANCH_SZ
unsigned long initial_skip
static int parse_one_filter(struct addr_filter *filt, const char **filter_inp)
int arm_spe_process_auxtrace_info(union perf_event *event, struct perf_session *session)
void * auxtrace_cache__lookup(struct auxtrace_cache *c, u32 key)
static const char *const auxtrace_error_type_name[]
static int perf_data__is_pipe(struct perf_data *data)
struct strfilter * filter
static struct perf_pmu * perf_evsel__find_pmu(struct perf_evsel *evsel)
int auxtrace_index__write(int fd, struct list_head *head)
static int perf_evsel__nr_addr_filter(struct perf_evsel *evsel)
static int print_kern_sym_cb(void *arg, const char *name, char type, u64 start)
static struct dso * load_dso(const char *name)
struct hlist_head * hashtable
static int auxtrace_queues__queue_buffer(struct auxtrace_queues *queues, unsigned int idx, struct auxtrace_buffer *buffer)
static int find_dso_sym(struct dso *dso, const char *sym_name, u64 *start, u64 *size, int idx)
struct perf_event_header header
static int auxtrace_index__process_entry(int fd, struct list_head *head, bool needs_swap)
unsigned long * cpu_bitmap
static int find_kern_sym(const char *sym_name, u64 *start, u64 *size, int idx)
struct list_head auxtrace_index
#define BUFFER_LIMIT_FOR_32_BIT
void events_stats__auxtrace_error_warn(const struct events_stats *stats)
static int sym(yyscan_t scanner, int type, int config)
struct auxtrace_event auxtrace
struct events_stats stats
struct perf_event_header header
u64 auxtrace_record__reference(struct auxtrace_record *itr)
void auxtrace_heap__pop(struct auxtrace_heap *heap)
static int auxtrace_queues__add_buffer(struct auxtrace_queues *queues, struct perf_session *session, unsigned int idx, struct auxtrace_buffer *buffer, struct auxtrace_buffer **buffer_ptr)
static bool auxtrace__dont_decode(struct perf_session *session)
int auxtrace_index__auxtrace_event(struct list_head *head, union perf_event *event, off_t file_offset)
#define PERF_SAMPLE_MAX_SIZE
void auxtrace_queues__free(struct auxtrace_queues *queues)
static int parse_addr_filter(struct perf_evsel *evsel, const char *filter, int max_nr)
static bool kern_sym_match(struct sym_args *args, const char *name, char type)
static pid_t thread_map__pid(struct thread_map *map, int thread)
int auxtrace_heap__add(struct auxtrace_heap *heap, unsigned int queue_nr, u64 ordinal)
struct auxtrace_info_event auxtrace_info
ssize_t writen(int fd, const void *buf, size_t n)
static bool dso_sym_match(struct symbol *sym, const char *name, int *cnt, int idx)
static struct auxtrace_queue * auxtrace_alloc_queue_array(unsigned int nr_queues)
int perf_session__peek_event(struct perf_session *session, off_t file_offset, void *buf, size_t buf_sz, union perf_event **event_ptr, struct perf_sample *sample)
int auxtrace_queues__init(struct auxtrace_queues *queues)
struct symbol * dso__next_symbol(struct symbol *sym)
int arch__compare_symbol_names(const char *namea, const char *nameb)
static int check_end_after_start(struct addr_filter *filt, u64 start, u64 size)
void * auxtrace_cache__alloc_entry(struct auxtrace_cache *c)
static void addr_filters__add(struct addr_filters *filts, struct addr_filter *filt)
int map__load(struct map *map)
static void auxtrace_cache__drop(struct auxtrace_cache *c)
int(* info_fill)(struct auxtrace_record *itr, struct perf_session *session, struct auxtrace_info_event *auxtrace_info, size_t priv_size)
int cs_etm__process_auxtrace_info(union perf_event *event, struct perf_session *session)
size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr, struct perf_evlist *evlist)
static void auxtrace_heapify(struct auxtrace_heap_item *heap_array, unsigned int pos, unsigned int queue_nr, u64 ordinal)
#define pr_debug3(fmt,...)
struct symbol * dso__first_symbol(struct dso *dso)
void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp, off_t auxtrace_offset, unsigned int auxtrace_pages, bool auxtrace_overwrite)
struct perf_event_attr attr
int addr_filters__parse_bare_filter(struct addr_filters *filts, const char *filter)
int(* process_auxtrace_event)(struct perf_session *session, union perf_event *event, struct perf_tool *tool)
void static void * zalloc(size_t size)
enum itrace_period_type period_type