summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/events_stats.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2021-04-27 03:37:13 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-04-29 15:30:58 +0200
commit0f0abbace3cddc92aaed2db3783c9c501354b3be (patch)
tree1cad6ab950fa6638811303a6412dde390581cf01 /tools/perf/util/events_stats.h
parentperf top: Use evlist->events_stat to count events (diff)
downloadlinux-0f0abbace3cddc92aaed2db3783c9c501354b3be.tar.xz
linux-0f0abbace3cddc92aaed2db3783c9c501354b3be.zip
perf hists: Split hists_stats from events_stats
Each struct hists have events_stats but most of the fields were not used. It's to count number of samples and periods whether filtered or not. And other fields are used only by evlist. So it'd be better to split hists_stats and events_stats to reduce wasted memory in the struct hists. This makes the output of event statistics in the perf report compact by skipping 0 events in each evsel/hists. Reviewed-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20210427013717.1651674-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/events_stats.h')
-rw-r--r--tools/perf/util/events_stats.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/util/events_stats.h b/tools/perf/util/events_stats.h
index 631a4af2ed86..e271c8004c89 100644
--- a/tools/perf/util/events_stats.h
+++ b/tools/perf/util/events_stats.h
@@ -26,15 +26,12 @@
* perf_record_sample.period and stash the result in total_period.
*/
struct events_stats {
- u64 total_period;
- u64 total_non_filtered_period;
u64 total_lost;
u64 total_lost_samples;
u64 total_aux_lost;
u64 total_aux_partial;
u64 total_invalid_chains;
u32 nr_events[PERF_RECORD_HEADER_MAX];
- u32 nr_non_filtered_samples;
u32 nr_lost_warned;
u32 nr_unknown_events;
u32 nr_invalid_chains;
@@ -44,6 +41,13 @@ struct events_stats {
u32 nr_proc_map_timeout;
};
+struct hists_stats {
+ u64 total_period;
+ u64 total_non_filtered_period;
+ u32 nr_samples;
+ u32 nr_non_filtered_samples;
+};
+
void events_stats__inc(struct events_stats *stats, u32 type);
size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);