Skip to content

Commit b169374

Browse files
captain5050namhyung
authored andcommitted
perf list: Fix JSON segfault by setting the used skip_duplicate_pmus callback
Json output didn't set the skip_duplicate_pmus callback yielding a segfault. Fixes: cd4e1ef ("perf pmus: Skip duplicate PMUs and don't print list suffix by default") Signed-off-by: Ian Rogers <[email protected]> Cc: James Clark <[email protected]> Cc: Kan Liang <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] [namhyung: updated subject line according to Arnaldo] Signed-off-by: Namhyung Kim <[email protected]>
1 parent 90fe70d commit b169374

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/perf/builtin-list.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ static void json_print_metric(void *ps __maybe_unused, const char *group,
434434
strbuf_release(&buf);
435435
}
436436

437+
static bool json_skip_duplicate_pmus(void *ps __maybe_unused)
438+
{
439+
return false;
440+
}
441+
437442
static bool default_skip_duplicate_pmus(void *ps)
438443
{
439444
struct print_state *print_state = ps;
@@ -503,6 +508,7 @@ int cmd_list(int argc, const char **argv)
503508
.print_end = json_print_end,
504509
.print_event = json_print_event,
505510
.print_metric = json_print_metric,
511+
.skip_duplicate_pmus = json_skip_duplicate_pmus,
506512
};
507513
ps = &json_ps;
508514
} else {

0 commit comments

Comments
 (0)