perf report: Prevent segfault with --no-parent
PATCH 1/1 perf report: Prevent segfault with --no-parent
Prevent a perf report segfault with the (non sensical) --no-parent option
Signed-off-by Andi Kleen <[email protected]>
--- tools/perf/util/sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/sort.c +1 -1
@@ -3372,7 +3372,7 @@ int sort_dimension__add(struct perf_hpp_list *list, const char *tok,sort_dimension_add_dynamic_header (sd); } -if (sd->entry == &sort_parent) { +if (sd->entry == &sort_parent && parent_pattern) {int ret =regcomp (&parent_regex, parent_pattern,REG_EXTENDED );if (ret) {char err[BUFSIZ ];
Signature · 1 line
2.43.0
Hi Andi,
Quoted 5 lines · Andi Kleen
Prevent a perf report segfault with the (non sensical) --no-parent option
Signed-off-by Andi Kleen <[email protected]>
Acked-by Namhyung <[email protected]>
Thanks,
Namhyung
Quoted 21 lines
--- tools/perf/util/sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/sort.c +1
-2@@ -3372,7 +3372,7 @@ int sort_dimension__add(struct perf_hpp_list *list, const char *tok,sort_dimension_add_dynamic_header (sd); } -if (sd->entry == &sort_parent) { +if (sd->entry == &sort_parent && parent_pattern) {int ret =regcomp (&parent_regex, parent_pattern,REG_EXTENDED );if (ret) {char err[BUFSIZ ]; --2.43.0
Quoted 4 lines · Andi Kleen
Prevent a perf report segfault with the (non sensical) --no-parent option
Applied to perf-tools-next, thanks!
Best regards,
Signature · 1 line
Namhyung Kim <[email protected]>