From cb6e92c764272ca288398ad6442bbb0f064c2da8 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Thu, 15 Dec 2022 11:28:14 -0800 Subject: perf hist: Add perf_hpp_fmt->init() callback In __hists__insert_output_entry(), it calls fmt->sort() for dynamic entries with NULL to update column width for tracepoint fields. But it's a hacky abuse of the sort callback, better to have a proper callback for that. I'll add more use cases later. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Leo Yan Cc: Milian Wolff Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20221215192817.2734573-7-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/sort.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/perf/util/sort.h') diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 04ff8b61a2a7..921715e6aec4 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h @@ -282,6 +282,7 @@ struct sort_entry { int (*se_snprintf)(struct hist_entry *he, char *bf, size_t size, unsigned int width); int (*se_filter)(struct hist_entry *he, int type, const void *arg); + void (*se_init)(struct hist_entry *he); u8 se_width_idx; }; -- cgit