5 #include <linux/mman.h> 14 #include <traceevent/event-parse.h> 16 #include <linux/kernel.h> 48 n = vsnprintf(bf, size, fmt, ap);
66 static int64_t
cmp_null(
const void *l,
const void *r)
85 size_t size,
unsigned int width)
89 width = max(7U, width) - 8;
91 width, width, comm ?:
"");
96 const struct thread *th = arg;
101 return th && he->
thread != th;
138 size_t size,
unsigned int width)
157 struct dso *dso_l = map_l ? map_l->
dso : NULL;
158 struct dso *dso_r = map_r ? map_r->
dso : NULL;
159 const char *dso_name_l, *dso_name_r;
161 if (!dso_l || !dso_r)
172 return strcmp(dso_name_l, dso_name_r);
182 size_t size,
unsigned int width)
184 if (map && map->
dso) {
194 size_t size,
unsigned int width)
201 const struct dso *
dso = arg;
221 return (int64_t)(right_ip - left_ip);
226 if (!sym_l || !sym_r)
233 return strcmp(sym_l->
name, sym_r->
name);
236 return (int64_t)(sym_r->
start - sym_l->
start);
238 return (int64_t)(sym_r->
end - sym_l->
end);
272 u64 ip,
char level,
char *bf,
size_t size,
280 BITS_PER_LONG / 4 + 2, ip, o);
285 if (sym->
type == STT_OBJECT) {
298 size_t len = BITS_PER_LONG / 4;
307 size_t size,
unsigned int width)
310 he->
level, bf, size, width);
315 const char *
sym = arg;
351 size_t size,
unsigned int width)
386 size_t size,
unsigned int width)
413 size_t size,
unsigned int width)
438 e->
ms.
sym,
false,
true,
true, e->
ip);
462 size_t size,
unsigned int width)
485 if (!sym_l || !sym_r)
488 return strcmp(sym_r->
name, sym_l->
name);
492 size_t size,
unsigned int width)
510 return right->
cpu - left->
cpu;
514 size_t size,
unsigned int width)
530 return (int64_t)(right_dev - left_dev);
535 return (int64_t)(right_ino - left_ino);
552 char *bf,
size_t size,
553 unsigned int width __maybe_unused)
575 size_t size,
unsigned int width)
582 int sk = *(
const int *)arg;
587 return sk >= 0 && he->
socket != sk;
602 struct trace_seq seq;
604 struct pevent_record rec = {
611 trace_seq_init(&seq);
616 pevent_event_info(&seq, evsel->
tp_format, &rec);
622 return realloc(seq.buffer, seq.len + 1);
631 if (evsel->
attr.type != PERF_TYPE_TRACEPOINT)
643 size_t size,
unsigned int width)
648 if (evsel->
attr.type != PERF_TYPE_TRACEPOINT)
649 return scnprintf(bf, size,
"%-.*s", width,
"N/A");
676 size_t size,
unsigned int width)
688 const struct dso *
dso = arg;
708 size_t size,
unsigned int width)
720 const struct dso *
dso = arg;
741 if (!from_l->
sym && !from_r->
sym)
758 if (!to_l->
sym && !to_r->
sym)
765 size_t size,
unsigned int width)
771 he->
level, bf, size, width);
778 size_t size,
unsigned int width)
784 he->
level, bf, size, width);
793 const char *
sym = arg;
805 const char *
sym = arg;
860 size_t size,
unsigned int width){
861 static const char *out =
"N/A";
884 size_t size,
unsigned int width)
887 return scnprintf(bf, size,
"%-.*s", width,
"N/A");
905 uint64_t l = 0, r = 0;
912 return (int64_t)(r - l);
916 size_t size,
unsigned int width)
934 uint64_t l = 0, r = 0;
941 return (int64_t)(r - l);
945 size_t size,
unsigned int width)
963 struct map *map_l = NULL;
964 struct map *map_r = NULL;
975 size_t size,
unsigned int width)
988 union perf_mem_data_src data_src_l;
989 union perf_mem_data_src data_src_r;
994 data_src_l.mem_lock = PERF_MEM_LOCK_NA;
999 data_src_r.mem_lock = PERF_MEM_LOCK_NA;
1001 return (int64_t)(data_src_r.mem_lock - data_src_l.mem_lock);
1005 size_t size,
unsigned int width)
1016 union perf_mem_data_src data_src_l;
1017 union perf_mem_data_src data_src_r;
1022 data_src_l.mem_dtlb = PERF_MEM_TLB_NA;
1027 data_src_r.mem_dtlb = PERF_MEM_TLB_NA;
1029 return (int64_t)(data_src_r.mem_dtlb - data_src_l.mem_dtlb);
1033 size_t size,
unsigned int width)
1044 union perf_mem_data_src data_src_l;
1045 union perf_mem_data_src data_src_r;
1050 data_src_l.mem_lvl = PERF_MEM_LVL_NA;
1055 data_src_r.mem_lvl = PERF_MEM_LVL_NA;
1057 return (int64_t)(data_src_r.mem_lvl - data_src_l.mem_lvl);
1061 size_t size,
unsigned int width)
1072 union perf_mem_data_src data_src_l;
1073 union perf_mem_data_src data_src_r;
1078 data_src_l.mem_snoop = PERF_MEM_SNOOP_NA;
1083 data_src_r.mem_snoop = PERF_MEM_SNOOP_NA;
1085 return (int64_t)(data_src_r.mem_snoop - data_src_l.mem_snoop);
1089 size_t size,
unsigned int width)
1101 struct map *l_map, *r_map;
1114 if (!l_map && !r_map)
1117 if (!l_map)
return -1;
1118 if (!r_map)
return 1;
1120 if (l_map->
maj > r_map->
maj)
return -1;
1121 if (l_map->
maj < r_map->
maj)
return 1;
1123 if (l_map->
min > r_map->
min)
return -1;
1124 if (l_map->
min < r_map->
min)
return 1;
1126 if (l_map->
ino > r_map->
ino)
return -1;
1127 if (l_map->
ino < r_map->
ino)
return 1;
1140 if ((left->
cpumode != PERF_RECORD_MISC_KERNEL) &&
1141 (!(l_map->
flags & MAP_SHARED)) &&
1142 !l_map->
maj && !l_map->
min && !l_map->
ino &&
1155 if (l > r)
return -1;
1156 if (l < r)
return 1;
1162 size_t size,
unsigned int width)
1168 char level = he->
level;
1176 if ((he->
cpumode != PERF_RECORD_MISC_KERNEL) &&
1177 map && !(map->
prot & PROT_EXEC) &&
1178 (map->
flags & MAP_SHARED) &&
1208 size_t size,
unsigned int width)
1227 size_t size,
unsigned int width)
1298 uint64_t l = 0, r = 0;
1305 return (int64_t)(r - l);
1309 size_t size,
unsigned int width)
1313 size_t len = BITS_PER_LONG / 4;
1321 ret +=
repsep_snprintf(bf + ret, size - ret,
"%-*s", width - ret,
"");
1347 size_t size,
unsigned int width)
1349 static const char *out =
"N/A";
1379 size_t size,
unsigned int width)
1381 static const char *out =
"N/A";
1409 return p + strlen(str);
1417 { PERF_TXN_ELISION,
"EL ", 0 },
1418 { PERF_TXN_TRANSACTION,
"TX ", 1 },
1419 { PERF_TXN_SYNC,
"SYNC ", 1 },
1420 { PERF_TXN_ASYNC,
"ASYNC ", 0 },
1421 { PERF_TXN_RETRY,
"RETRY ", 0 },
1422 { PERF_TXN_CONFLICT,
"CON ", 0 },
1423 { PERF_TXN_CAPACITY_WRITE,
"CAP-WRITE ", 1 },
1424 { PERF_TXN_CAPACITY_READ,
"CAP-READ ", 0 },
1442 size_t size,
unsigned int width)
1453 if (t && !(t & (PERF_TXN_SYNC|PERF_TXN_ASYNC)))
1455 if (t & PERF_TXN_ABORT_MASK) {
1456 sprintf(p,
":%" PRIx64,
1457 (t & PERF_TXN_ABORT_MASK) >>
1458 PERF_TXN_ABORT_SHIFT);
1476 int64_t size_l = sym_l != NULL ?
symbol__size(sym_l) : 0;
1477 int64_t size_r = sym_r != NULL ?
symbol__size(sym_r) : 0;
1479 return size_l < size_r ? -1 :
1480 size_l == size_r ? 0 : 1;
1490 size_t bf_size,
unsigned int width)
1499 size_t size,
unsigned int width)
1515 int64_t size_l = map_l != NULL ?
map__size(map_l) : 0;
1516 int64_t size_r = map_r != NULL ?
map__size(map_r) : 0;
1518 return size_l < size_r ? -1 :
1519 size_l == size_r ? 0 : 1;
1529 size_t bf_size,
unsigned int width)
1531 if (map && map->
dso)
1539 size_t size,
unsigned int width)
1558 #define DIM(d, n, func) [d] = { .name = n, .entry = &(func) } 1581 #define DIM(d, n, func) [d - __SORT_BRANCH_STACK] = { .name = n, .entry = &(func) } 1598 #define DIM(d, n, func) [d - __SORT_MEMORY_MODE] = { .name = n, .entry = &(func) } 1620 #define DIM(d, n) { .name = n, .fmt = &perf_hpp__format[d], } 1652 struct hists *
hists,
int line __maybe_unused,
1653 int *span __maybe_unused)
1663 return scnprintf(hpp->
buf, hpp->
size,
"%-*.*s", len, len, fmt->
name);
1712 return collapse_fn(a, b);
1723 return sort_fn(a, b);
1731 #define MK_SORT_ENTRY_CHK(key) \ 1732 bool perf_hpp__is_ ## key ## _entry(struct perf_hpp_fmt *fmt) \ 1734 struct hpp_sort_entry *hse; \ 1736 if (!perf_hpp__is_sort_entry(fmt)) \ 1739 hse = container_of(fmt, struct hpp_sort_entry, hpp); \ 1740 return hse->se == &sort_ ## key ; \ 1763 return hse_a->
se == hse_b->
se;
1779 hse =
malloc(
sizeof(*hse));
1781 pr_err(
"Memory allocation failed\n");
1798 INIT_LIST_HEAD(&hse->
hpp.
list);
1818 fmt = memdup(hd->
fmt,
sizeof(*fmt));
1820 INIT_LIST_HEAD(&fmt->
list);
1896 int namelen = strlen(hde->
field->name);
1897 int fieldlen = hde->
field->size;
1902 if (!(hde->
field->flags & FIELD_IS_STRING)) {
1904 fieldlen = hde->
field->size * 2 + 2;
1929 namelen = strlen(field->name);
1933 pos = strchr(str,
' ');
1936 pos = str + strlen(str);
1939 if (!strncmp(str, field->name, namelen)) {
1959 int line __maybe_unused,
1960 int *span __maybe_unused)
1970 return scnprintf(hpp->
buf, hpp->
size,
"%*.*s", len, len, hde->
field->name);
2003 struct format_field *
field;
2020 namelen = strlen(field->name);
2024 pos = strchr(str,
' ');
2027 pos = str + strlen(str);
2030 if (!strncmp(str, field->name, namelen)) {
2032 str = strndup(str, pos - str);
2035 return scnprintf(hpp->
buf, hpp->
size,
2036 "%*.*s", len, len,
"ERROR");
2047 struct trace_seq seq;
2049 trace_seq_init(&seq);
2054 ret = scnprintf(hpp->
buf, hpp->
size,
"%*.*s", len, len, str);
2063 struct format_field *
field;
2064 unsigned offset,
size;
2074 if (field->flags & FIELD_IS_DYNAMIC) {
2075 unsigned long long dyn;
2077 pevent_read_number_field(field, a->
raw_data, &dyn);
2078 offset = dyn & 0xffff;
2079 size = (dyn >> 16) & 0xffff;
2085 offset = field->offset;
2125 hde =
malloc(
sizeof(*hde));
2127 pr_debug(
"Memory allocation failed\n");
2147 INIT_LIST_HEAD(&hde->
hpp.
list);
2165 new_hse = memdup(hse,
sizeof(*hse));
2167 new_fmt = &new_hse->
hpp;
2172 new_hde = memdup(hde,
sizeof(*hde));
2174 new_fmt = &new_hde->
hpp;
2176 new_fmt = memdup(fmt,
sizeof(*fmt));
2179 INIT_LIST_HEAD(&new_fmt->
list);
2190 field_name = strchr(str,
'.');
2193 *field_name++ =
'\0';
2199 opt_name = strchr(field_name,
'/');
2204 *field = field_name;
2222 if (event_name[0] ==
'%') {
2223 int nr = strtol(event_name+1, NULL, 0);
2235 full_name = !!strchr(event_name,
':');
2238 if (full_name && !strcmp(pos->
name, event_name))
2241 if (!full_name && strstr(pos->
name, event_name)) {
2243 pr_debug(
"'%s' event is ambiguous: it can be %s or %s\n",
2244 event_name, evsel->
name, pos->
name);
2255 struct format_field *
field,
2256 bool raw_trace,
int level)
2273 struct format_field *
field;
2275 field = evsel->
tp_format->format.fields;
2281 field = field->next;
2293 if (evsel->
attr.type != PERF_TYPE_TRACEPOINT)
2304 char *field_name,
bool raw_trace,
int level)
2308 struct format_field *
field;
2311 if (evsel->
attr.type != PERF_TYPE_TRACEPOINT)
2314 field = pevent_find_any_field(evsel->
tp_format, field_name);
2330 struct format_field *
field;
2347 if (strcmp(opt_name,
"raw")) {
2348 pr_debug(
"unsupported field option %s\n", opt_name);
2355 if (!strcmp(field_name,
"trace_fields")) {
2360 if (event_name == NULL) {
2366 if (evsel == NULL) {
2367 pr_debug(
"Cannot find event: %s\n", event_name);
2372 if (evsel->
attr.type != PERF_TYPE_TRACEPOINT) {
2373 pr_debug(
"%s is not a tracepoint event\n", event_name);
2378 if (!strcmp(field_name,
"*")) {
2381 field = pevent_find_any_field(evsel->
tp_format, field_name);
2382 if (field == NULL) {
2383 pr_debug(
"Cannot find event field for %s.%s\n",
2384 event_name, field_name);
2474 for (i = 0; i < ARRAY_SIZE(common_sort_dimensions); i++) {
2477 if (strncasecmp(tok, sd->
name, strlen(tok)))
2480 if (sd->
entry == &sort_parent) {
2490 }
else if (sd->
entry == &sort_sym) {
2501 }
else if (sd->
entry == &sort_dso) {
2503 }
else if (sd->
entry == &sort_socket) {
2505 }
else if (sd->
entry == &sort_thread) {
2507 }
else if (sd->
entry == &sort_comm) {
2514 for (i = 0; i < ARRAY_SIZE(hpp_sort_dimensions); i++) {
2517 if (strncasecmp(tok, hd->
name, strlen(tok)))
2523 for (i = 0; i < ARRAY_SIZE(bstack_sort_dimensions); i++) {
2526 if (strncasecmp(tok, sd->
name, strlen(tok)))
2532 if (sd->
entry == &sort_sym_from || sd->
entry == &sort_sym_to)
2539 for (i = 0; i < ARRAY_SIZE(memory_sort_dimensions); i++) {
2542 if (strncasecmp(tok, sd->
name, strlen(tok)))
2551 if (sd->
entry == &sort_mem_daddr_sym)
2571 bool in_group =
false;
2575 tmp = strpbrk(str,
"{}, ");
2580 next_level = level + 1;
2584 else if (*tmp ==
'}')
2593 if (ret == -EINVAL) {
2594 if (!
cacheline_size() && !strncasecmp(tok,
"dcacheline", strlen(tok)))
2595 pr_err(
"The \"dcacheline\" --sort key needs to know the cacheline size and it couldn't be determined on this system");
2597 pr_err(
"Invalid --sort key: `%s'", tok);
2599 }
else if (ret == -ESRCH) {
2600 pr_err(
"Unknown --sort key: `%s'", tok);
2613 const char *default_sort_orders[] = {
2621 bool use_trace =
true;
2624 BUG_ON(
sort__mode >= ARRAY_SIZE(default_sort_orders));
2630 if (evsel->
attr.type != PERF_TYPE_TRACEPOINT) {
2639 return "trace_fields";
2647 char *new_sort_order;
2657 pr_err(
"Invalid --sort key: `+'");
2665 if (asprintf(&new_sort_order,
"%s,%s",
2667 pr_err(
"Not enough memory to set up --sort");
2683 if (!str || strstr(str, pre))
2686 if (asprintf(&n,
"%s,%s", pre, str) < 0)
2709 const char *sort_keys;
2717 if (sort_keys == NULL) {
2729 str = strdup(sort_keys);
2731 pr_err(
"Not enough memory to setup sort keys");
2741 pr_err(
"Not enough memory to setup overhead keys");
2773 fprintf(fp,
"# %s: %s\n", list_name,
2849 for (i = 0; i < ARRAY_SIZE(common_sort_dimensions); i++) {
2852 if (strncasecmp(tok, sd->
name, strlen(tok)))
2858 for (i = 0; i < ARRAY_SIZE(hpp_sort_dimensions); i++) {
2861 if (strncasecmp(tok, hd->
name, strlen(tok)))
2867 for (i = 0; i < ARRAY_SIZE(bstack_sort_dimensions); i++) {
2870 if (strncasecmp(tok, sd->
name, strlen(tok)))
2876 for (i = 0; i < ARRAY_SIZE(memory_sort_dimensions); i++) {
2879 if (strncasecmp(tok, sd->
name, strlen(tok)))
2893 for (tok = strtok_r(str,
", ", &tmp);
2894 tok; tok = strtok_r(NULL,
", ", &tmp)) {
2896 if (ret == -EINVAL) {
2897 ui__error(
"Invalid --fields key: `%s'", tok);
2899 }
else if (ret == -ESRCH) {
2900 ui__error(
"Unknown --fields key: `%s'", tok);
2912 for (i = 0; i < ARRAY_SIZE(common_sort_dimensions); i++)
2913 common_sort_dimensions[i].
taken = 0;
2915 for (i = 0; i < ARRAY_SIZE(hpp_sort_dimensions); i++)
2916 hpp_sort_dimensions[i].
taken = 0;
2918 for (i = 0; i < ARRAY_SIZE(bstack_sort_dimensions); i++)
2919 bstack_sort_dimensions[i].
taken = 0;
2921 for (i = 0; i < ARRAY_SIZE(memory_sort_dimensions); i++)
2922 memory_sort_dimensions[i].
taken = 0;
2927 return order && (*order !=
'+');
2940 pr_err(
"Not enough memory to setup output fields");
2947 if (!strlen(strp)) {
2948 pr_err(
"Invalid --fields key: `+'");
static int64_t sort__lvl_cmp(struct hist_entry *left, struct hist_entry *right)
static int64_t sort__in_tx_cmp(struct hist_entry *left, struct hist_entry *right)
static int hist_entry__comm_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
void perf_hpp__setup_output_field(struct perf_hpp_list *list)
char dso__symtab_origin(const struct dso *dso)
struct sort_entry sort_cgroup_id
bool is_strict_order(const char *order)
static int setup_sort_order(struct perf_evlist *evlist)
static int hist_entry__daddr_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct sort_entry sort_dso
static int64_t sort__parent_cmp(struct hist_entry *left, struct hist_entry *right)
static int __sort__hde_width(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp __maybe_unused, struct hists *hists __maybe_unused)
static int64_t _sort__cgroup_dev_cmp(u64 left_dev, u64 right_dev)
int(* width)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hists *hists)
static int64_t sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
static int64_t __sort__hpp_sort(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
static int hist_entry__dcacheline_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static bool __sort__hde_equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
static int hist_entry__cpu_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct strlist * comm_list
const char default_top_sort_order[]
const char default_branch_sort_order[]
static int hist_entry__dso_to_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int hist_entry__srcline_from_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
void reset_dimensions(void)
static const char * get_default_sort_order(struct perf_evlist *evlist)
struct sort_entry sort_thread
static int64_t sort__dso_size_cmp(struct hist_entry *left, struct hist_entry *right)
struct sort_entry sort_mem_snoop
void reset_output_field(void)
struct sort_entry sort_comm
enum sort_mode sort__mode
int ui__error(const char *format,...)
static int64_t sort__comm_sort(struct hist_entry *left, struct hist_entry *right)
struct strlist * sym_to_list
struct sort_entry sort_local_weight
static int __sort__hde_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hists *hists __maybe_unused, int line __maybe_unused, int *span __maybe_unused)
int64_t(* se_collapse)(struct hist_entry *, struct hist_entry *)
struct perf_hpp_fmt * fmt
int(* entry)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
struct sort_entry sort_mem_daddr_sym
static int _hist_entry__dso_snprintf(struct map *map, char *bf, size_t size, unsigned int width)
static char * prefix_if_not_in(const char *pre, char *str)
static int64_t sort__srcfile_cmp(struct hist_entry *left, struct hist_entry *right)
static int64_t sort__phys_daddr_cmp(struct hist_entry *left, struct hist_entry *right)
static int hist_entry__sym_filter(struct hist_entry *he, int type, const void *arg)
static int64_t __sort__hpp_cmp(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
static int __sort__hpp_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hists *hists, int line __maybe_unused, int *span __maybe_unused)
int64_t(* se_cmp)(struct hist_entry *, struct hist_entry *)
int hist_entry__filter(struct hist_entry *he, int type, const void *arg)
static int add_all_dynamic_fields(struct perf_evlist *evlist, bool raw_trace, int level)
static void hpp_free(struct perf_hpp_fmt *fmt)
static int __sort_dimension__add(struct sort_dimension *sd, struct perf_hpp_list *list, int level)
struct perf_hpp_list * hpp_list
static int hist_entry__srcline_to_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
char * __get_srcline(struct dso *dso, u64 addr, struct symbol *sym, bool show_sym, bool show_addr, bool unwind_inlines, u64 ip)
static struct perf_hpp_fmt * __hpp_dimension__alloc_hpp(struct hpp_dimension *hd, int level)
void perf_hpp_list__register_sort_field(struct perf_hpp_list *list, struct perf_hpp_fmt *format)
static int64_t sort__srcline_to_cmp(struct hist_entry *left, struct hist_entry *right)
static int64_t sort__cgroup_id_cmp(struct hist_entry *left, struct hist_entry *right)
static int64_t sort__mispredict_cmp(struct hist_entry *left, struct hist_entry *right)
static int parse_field_name(char *str, char **event, char **field, char **opt)
int(* se_snprintf)(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int hist_entry__thread_filter(struct hist_entry *he, int type, const void *arg)
static int64_t sort__tlb_cmp(struct hist_entry *left, struct hist_entry *right)
struct addr_map_symbol daddr
struct list_head sort_list
static int hist_entry__srcfile_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int hist_entry__socket_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct namespace_id cgroup_id
static int64_t sort__sym_to_cmp(struct hist_entry *left, struct hist_entry *right)
struct sort_entry sort_sym_to
static char * add_str(char *p, const char *str)
static int repsep_snprintf(char *bf, size_t size, const char *fmt,...)
int64_t sort__iaddr_cmp(struct hist_entry *left, struct hist_entry *right)
void(* free)(struct perf_hpp_fmt *fmt)
static int hist_entry__sym_from_filter(struct hist_entry *he, int type, const void *arg)
struct branch_flags flags
struct sort_entry sort_mem_iaddr_sym
void perf_hpp__init(void)
struct strlist * sym_from_list
static int64_t sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right)
bool perf_hpp__defined_dynamic_entry(struct perf_hpp_fmt *fmt, struct hists *hists)
struct sort_entry sort_mem_locked
static int hist_entry__trace_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static unsigned int strlist__nr_entries(const struct strlist *slist)
int setup_sorting(struct perf_evlist *evlist)
static int64_t _sort__dso_cmp(struct map *map_l, struct map *map_r)
int64_t(* sort)(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
struct sort_entry sort_sym_size
static int hist_entry__mispredict_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int __sort__hpp_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
#define perf_hpp_list__for_each_format(_list, format)
struct sort_entry sort_dso_to
const char default_tracepoint_sort_order[]
static int64_t sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
static int __hpp_dimension__add(struct hpp_dimension *hd, struct perf_hpp_list *list, int level)
static int64_t sort__thread_cmp(struct hist_entry *left, struct hist_entry *right)
struct sort_entry sort_abort
struct sort_entry sort_global_weight
char * map__srcline(struct map *map, u64 addr, struct symbol *sym)
int perf_mem__snp_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
struct sort_entry sort_srcfile
int sort_dimension__add(struct perf_hpp_list *list, const char *tok, struct perf_evlist *evlist, int level)
void perf_hpp__set_elide(int idx, bool elide)
static int hist_entry__snoop_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int hist_entry__dso_daddr_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static void perf_hpp__register_sort_field(struct perf_hpp_fmt *format)
bool(* equal)(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
static int __sort_dimension__add_hpp_output(struct sort_dimension *sd, struct perf_hpp_list *list)
int64_t(* cmp)(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
static int hist_entry__phys_daddr_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct sort_entry sort_in_tx
int(* header)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hists *hists, int line, int *span)
static struct perf_evsel * perf_evsel__next(struct perf_evsel *evsel)
static int64_t sort__sym_sort(struct hist_entry *left, struct hist_entry *right)
static int64_t __sort__hpp_collapse(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
static struct sort_dimension memory_sort_dimensions[]
const char * thread__comm_str(const struct thread *thread)
struct sort_entry sort_transaction
static struct perf_evsel * hists_to_evsel(struct hists *hists)
static int64_t sort__trace_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t map__size(const struct map *map)
int output_field_add(struct perf_hpp_list *list, char *tok)
struct perf_evlist * evlist
struct sort_entry sort_mem_daddr_dso
#define pr_debug(fmt,...)
static int64_t _sort__addr_cmp(u64 left_ip, u64 right_ip)
static int64_t sort__dso_to_cmp(struct hist_entry *left, struct hist_entry *right)
int perf_mem__tlb_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
static int64_t sort__comm_collapse(struct hist_entry *left, struct hist_entry *right)
static struct txbit txbits[]
static struct sort_dimension bstack_sort_dimensions[]
static int64_t _sort__dso_size_cmp(struct map *map_l, struct map *map_r)
static int hist_entry__sym_to_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int hist_entry__sym_to_filter(struct hist_entry *he, int type, const void *arg)
static int _hist_entry__sym_size_snprintf(struct symbol *sym, char *bf, size_t bf_size, unsigned int width)
void perf_hpp__append_sort_keys(struct perf_hpp_list *list)
static int add_evsel_fields(struct perf_evsel *evsel, bool raw_trace, int level)
static bool __get_elide(struct strlist *list, const char *list_name, FILE *fp)
#define evlist__for_each_entry(evlist, evsel)
struct sort_entry sort_mem_tlb
static int64_t sort__cycles_cmp(struct hist_entry *left, struct hist_entry *right)
void sort__setup_elide(FILE *output)
static int hist_entry__cycles_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
const char default_diff_sort_order[]
bool hists__new_col_len(struct hists *hists, enum hist_column col, u16 len)
const char * default_sort_order
static int hist_entry__dso_to_filter(struct hist_entry *he, int type, const void *arg)
static char * setup_overhead(char *keys)
struct sort_entry sort_socket
static int hist_entry__tlb_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
u16 hists__col_len(struct hists *hists, enum hist_column col)
struct str_node * strlist__entry(const struct strlist *slist, unsigned int idx)
static int setup_sort_list(struct perf_hpp_list *list, char *str, struct perf_evlist *evlist)
int64_t(* collapse)(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
struct strlist * dso_to_list
static char * addr_map_symbol__srcline(struct addr_map_symbol *ams)
void perf_hpp__reset_output_field(struct perf_hpp_list *list)
struct sort_entry sort_mispredict
struct event_format * tp_format
const char * parent_pattern
int perf_hpp__setup_hists_formats(struct perf_hpp_list *list, struct perf_evlist *evlist)
static int __dynamic_dimension__add(struct perf_evsel *evsel, struct format_field *field, bool raw_trace, int level)
static int str(yyscan_t scanner, int token)
static int64_t sort__snoop_cmp(struct hist_entry *left, struct hist_entry *right)
static int64_t _sort__sym_size_cmp(struct symbol *sym_l, struct symbol *sym_r)
const char * comm__str(const struct comm *comm)
static bool __sort__hpp_equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
union perf_mem_data_src data_src
struct sort_entry sort_mem_lvl
static int64_t sort__dso_daddr_cmp(struct hist_entry *left, struct hist_entry *right)
#define hists__has(__h, __f)
const char default_mem_sort_order[]
struct strlist * dso_from_list
struct sort_entry sort_sym_from
const char default_parent_pattern[]
int perf_mem__lck_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
static int __setup_output_field(void)
static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok, int level)
static int hist_entry__transaction_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int64_t _sort__cgroup_inode_cmp(u64 left_ino, u64 right_ino)
static int hde_width(struct hpp_dynamic_entry *hde)
struct sort_entry sort_dso_from
static int __hpp_dimension__add_output(struct perf_hpp_list *list, struct hpp_dimension *hd)
u64 map__rip_2objdump(struct map *map, u64 rip)
struct strlist * sym_list
int64_t(* se_sort)(struct hist_entry *, struct hist_entry *)
static int64_t sort__local_weight_cmp(struct hist_entry *left, struct hist_entry *right)
void perf_hpp__reset_sort_width(struct perf_hpp_fmt *fmt, struct hists *hists)
static struct hpp_dynamic_entry * __alloc_dynamic_entry(struct perf_evsel *evsel, struct format_field *field, int level)
static struct perf_evsel * find_evsel(struct perf_evlist *evlist, char *event_name)
static int64_t sort__sym_size_cmp(struct hist_entry *left, struct hist_entry *right)
static int hist_entry__locked_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int hist_entry__socket_filter(struct hist_entry *he, int type, const void *arg)
struct sort_entry sort_parent
struct sort_entry sort_cpu
static int64_t sort__sym_from_cmp(struct hist_entry *left, struct hist_entry *right)
static void hse_free(struct perf_hpp_fmt *fmt)
static struct @9 output[OUTPUT_TYPE_MAX]
static int64_t sort__global_weight_cmp(struct hist_entry *left, struct hist_entry *right)
static int __setup_sorting(struct perf_evlist *evlist)
struct branch_info * branch_info
static int __sort__hpp_width(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp __maybe_unused, struct hists *hists)
static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
int(* se_filter)(struct hist_entry *he, int type, const void *arg)
struct mem_info * mem_info
static struct perf_evsel * perf_evlist__first(struct perf_evlist *evlist)
static int add_all_matching_fields(struct perf_evlist *evlist, char *field_name, bool raw_trace, int level)
static int hist_entry__sym_size_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int64_t sort__transaction_cmp(struct hist_entry *left, struct hist_entry *right)
struct sort_entry sort_srcline
struct sort_entry sort_dso_size
static int hist_entry__cgroup_id_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width __maybe_unused)
static char * hist_entry__get_srcfile(struct hist_entry *e)
regex_t ignore_callees_regex
static int hist_entry__abort_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct sort_entry sort_sym
bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format)
static char * get_trace_output(struct hist_entry *he)
struct sort_entry * entry
static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int sym(yyscan_t scanner, int type, int config)
static u64 he_weight(struct hist_entry *he)
int hpp_dimension__add_output(unsigned col)
static int64_t sort__dso_from_cmp(struct hist_entry *left, struct hist_entry *right)
static int hist_entry__sym_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int64_t sort__locked_cmp(struct hist_entry *left, struct hist_entry *right)
int(* color)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static int64_t sort__abort_cmp(struct hist_entry *left, struct hist_entry *right)
struct sort_entry sort_srcline_from
static struct hpp_sort_entry * __sort_dimension__alloc_hpp(struct sort_dimension *sd, int level)
#define MK_SORT_ENTRY_CHK(key)
void perf_hpp_list__column_register(struct perf_hpp_list *list, struct perf_hpp_fmt *format)
static int hist_entry__parent_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static u64 cl_address(u64 address)
static struct sort_dimension common_sort_dimensions[]
static int64_t sort__srcline_from_cmp(struct hist_entry *left, struct hist_entry *right)
struct perf_evsel * evsel
struct sort_entry sort_mem_dcacheline
static void update_dynamic_len(struct hpp_dynamic_entry *hde, struct hist_entry *he)
static int _hist_entry__dso_size_snprintf(struct map *map, char *bf, size_t bf_size, unsigned int width)
struct addr_map_symbol to
struct format_field * field
struct addr_map_symbol from
static int hist_entry__dso_from_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
int64_t sort__daddr_cmp(struct hist_entry *left, struct hist_entry *right)
struct addr_map_symbol iaddr
static struct hpp_dimension hpp_sort_dimensions[]
u64(* unmap_ip)(struct map *, u64)
static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym, u64 ip, char level, char *bf, size_t size, unsigned int width)
static int64_t _sort__sym_cmp(struct symbol *sym_l, struct symbol *sym_r)
static int hist_entry__iaddr_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct sort_entry sort_trace
static size_t symbol__size(const struct symbol *sym)
int hist_entry__transaction_len(void)
static int __sort_dimension__add_output(struct perf_hpp_list *list, struct sort_dimension *sd)
static int64_t sort__socket_cmp(struct hist_entry *left, struct hist_entry *right)
static bool perf_evlist__empty(struct perf_evlist *evlist)
static int hist_entry__in_tx_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct perf_hpp_fmt * perf_hpp_fmt__dup(struct perf_hpp_fmt *fmt)
static int hist_entry__thread_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static char no_srcfile[1]
static int hist_entry__dso_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
bool perf_hpp__is_dynamic_entry(struct perf_hpp_fmt *fmt)
static bool get_elide(int idx, FILE *output)
static int hist_entry__dso_filter(struct hist_entry *he, int type, const void *arg)
static void hde_free(struct perf_hpp_fmt *fmt)
struct sort_entry sort_mem_phys_daddr
static int hist_entry__local_weight_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int hist_entry__lvl_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
static int hist_entry__sym_from_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct strlist * dso_list
static int hist_entry__dso_size_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct perf_event_attr attr
static int setup_output_list(struct perf_hpp_list *list, char *str)
char * hist_entry__srcline(struct hist_entry *he)
static int hist_entry__dso_from_filter(struct hist_entry *he, int type, const void *arg)
static int64_t sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
static int hist_entry__global_weight_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width)
struct sort_entry sort_srcline_to
static int64_t sort__cpu_cmp(struct hist_entry *left, struct hist_entry *right)
static int __sort_dimension__add_hpp_sort(struct sort_dimension *sd, struct perf_hpp_list *list, int level)
int64_t sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right)
static int64_t cmp_null(const void *l, const void *r)
struct sort_entry sort_cycles