Commit 75b37db0 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf hist: Add nr_lost_samples to hist_stats

This is a preparation to display accurate lost sample counts for
each evsel.
Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220901195739.668604-5-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent e3a23261
...@@ -47,6 +47,7 @@ struct hists_stats { ...@@ -47,6 +47,7 @@ struct hists_stats {
u64 total_non_filtered_period; u64 total_non_filtered_period;
u32 nr_samples; u32 nr_samples;
u32 nr_non_filtered_samples; u32 nr_non_filtered_samples;
u32 nr_lost_samples;
}; };
void events_stats__inc(struct events_stats *stats, u32 type); void events_stats__inc(struct events_stats *stats, u32 type);
......
...@@ -2335,6 +2335,11 @@ void hists__inc_nr_samples(struct hists *hists, bool filtered) ...@@ -2335,6 +2335,11 @@ void hists__inc_nr_samples(struct hists *hists, bool filtered)
hists->stats.nr_non_filtered_samples++; hists->stats.nr_non_filtered_samples++;
} }
void hists__inc_nr_lost_samples(struct hists *hists, u32 lost)
{
hists->stats.nr_lost_samples += lost;
}
static struct hist_entry *hists__add_dummy_entry(struct hists *hists, static struct hist_entry *hists__add_dummy_entry(struct hists *hists,
struct hist_entry *pair) struct hist_entry *pair)
{ {
......
...@@ -201,6 +201,7 @@ void hists__reset_stats(struct hists *hists); ...@@ -201,6 +201,7 @@ void hists__reset_stats(struct hists *hists);
void hists__inc_stats(struct hists *hists, struct hist_entry *h); void hists__inc_stats(struct hists *hists, struct hist_entry *h);
void hists__inc_nr_events(struct hists *hists); void hists__inc_nr_events(struct hists *hists);
void hists__inc_nr_samples(struct hists *hists, bool filtered); void hists__inc_nr_samples(struct hists *hists, bool filtered);
void hists__inc_nr_lost_samples(struct hists *hists, u32 lost);
size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
int max_cols, float min_pcnt, FILE *fp, int max_cols, float min_pcnt, FILE *fp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment