Re: [PATCH] perf annotate-data: Support --skip-empty option
From: Namhyung Kim
Date: Sat Aug 10 2024 - 00:16:20 EST
On Fri, Aug 09, 2024 at 06:33:09PM -0300, Arnaldo Carvalho de Melo wrote:
> On Tue, Aug 06, 2024 at 11:17:13PM -0700, Namhyung Kim wrote:
> > The --skip-empty option is to hide dummy events in a group. Like other
> > output mode like perf report and perf annotate, the data-type profiling
> > output should support the option.
>
> Thanks, tested and applied.
Thanks, but I found a bug when a member has multiple histogram entries.
Could you please fold this? Or I can send a format patch if you want.
Thanks,
Namhyung
diff --git a/tools/perf/ui/browsers/annotate-data.c b/tools/perf/ui/browsers/annotate-data.c
index c3db80a7589a..a937b55da736 100644
--- a/tools/perf/ui/browsers/annotate-data.c
+++ b/tools/perf/ui/browsers/annotate-data.c
@@ -46,11 +46,12 @@ static int get_member_overhead(struct annotated_data_type *adt,
struct annotated_member *member = entry->data;
int i, k;
- for (i = 0, k = 0; i < member->size; i++) {
+ for (i = 0; i < member->size; i++) {
struct type_hist *h;
struct evsel *evsel;
int offset = member->offset + i;
+ k = 0;
for_each_group_evsel(evsel, leader) {
if (symbol_conf.skip_empty &&
evsel__hists(evsel)->stats.nr_samples == 0)