From b22da3d8526a935aa31e086e63f60ff3246cb61c Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Sat, 09 Dec 2023 07:24:11 +0000 Subject: [PATCH] add stmac read mac form eeprom --- kernel/tools/perf/util/callchain.h | 52 ++++++++++++++++++++++++++++++---------------------- 1 files changed, 30 insertions(+), 22 deletions(-) diff --git a/kernel/tools/perf/util/callchain.h b/kernel/tools/perf/util/callchain.h index 99d38ac..5824134 100644 --- a/kernel/tools/perf/util/callchain.h +++ b/kernel/tools/perf/util/callchain.h @@ -2,13 +2,18 @@ #ifndef __PERF_CALLCHAIN_H #define __PERF_CALLCHAIN_H -#include "../perf.h" #include <linux/list.h> #include <linux/rbtree.h> -#include "event.h" -#include "map.h" -#include "symbol.h" +#include "map_symbol.h" #include "branch.h" + +struct addr_location; +struct evsel; +struct ip_callchain; +struct map; +struct perf_sample; +struct thread; +struct hists; #define HELP_PAD "\t\t\t\t" @@ -137,15 +142,22 @@ */ struct callchain_cursor_node { u64 ip; - struct map *map; - struct symbol *sym; + struct map_symbol ms; const char *srcline; + /* Indicate valid cursor node for LBR stitch */ + bool valid; + bool branch; struct branch_flags branch_flags; u64 branch_from; int nr_loop_iter; u64 iter_cycles; struct callchain_cursor_node *next; +}; + +struct stitch_list { + struct list_head node; + struct callchain_cursor_node cursor; }; struct callchain_cursor { @@ -188,23 +200,10 @@ int callchain_merge(struct callchain_cursor *cursor, struct callchain_root *dst, struct callchain_root *src); -/* - * Initialize a cursor before adding entries inside, but keep - * the previously allocated entries as a cache. - */ -static inline void callchain_cursor_reset(struct callchain_cursor *cursor) -{ - struct callchain_cursor_node *node; - - cursor->nr = 0; - cursor->last = &cursor->first; - - for (node = cursor->first; node != NULL; node = node->next) - map__zput(node->map); -} +void callchain_cursor_reset(struct callchain_cursor *cursor); int callchain_cursor_append(struct callchain_cursor *cursor, u64 ip, - struct map *map, struct symbol *sym, + struct map_symbol *ms, bool branch, struct branch_flags *flags, int nr_loop_iter, u64 iter_cycles, u64 branch_from, const char *srcline); @@ -249,7 +248,7 @@ int sample__resolve_callchain(struct perf_sample *sample, struct callchain_cursor *cursor, struct symbol **parent, - struct perf_evsel *evsel, struct addr_location *al, + struct evsel *evsel, struct addr_location *al, int max_stack); int hist_entry__append_callchain(struct hist_entry *he, struct perf_sample *sample); int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node *node, @@ -299,4 +298,13 @@ u64 *branch_count, u64 *predicted_count, u64 *abort_count, u64 *cycles_count); +void callchain_param_setup(u64 sample_type); + +bool callchain_cnode_matched(struct callchain_node *base_cnode, + struct callchain_node *pair_cnode); + +u64 callchain_total_hits(struct hists *hists); + +s64 callchain_avg_cycles(struct callchain_node *cnode); + #endif /* __PERF_CALLCHAIN_H */ -- Gitblit v1.6.2