Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'perf-tools-fixes-for-v6.7-2-2023-12-08' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools

Pull perf tools fixes from Namhyung Kim:
"A random set of small bug fixes including:

- Fix segfault on AmpereOne due to missing default metricgroup name

- Fix segfault on `perf list --json` due to NULL pointer"

* tag 'perf-tools-fixes-for-v6.7-2-2023-12-08' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools:
perf list: Fix JSON segfault by setting the used skip_duplicate_pmus callback
perf vendor events arm64: AmpereOne: Add missing DefaultMetricgroupName fields
perf metrics: Avoid segv if default metricgroup isn't set

+9 -1
+6
tools/perf/builtin-list.c
··· 434 434 strbuf_release(&buf); 435 435 } 436 436 437 + static bool json_skip_duplicate_pmus(void *ps __maybe_unused) 438 + { 439 + return false; 440 + } 441 + 437 442 static bool default_skip_duplicate_pmus(void *ps) 438 443 { 439 444 struct print_state *print_state = ps; ··· 508 503 .print_end = json_print_end, 509 504 .print_event = json_print_event, 510 505 .print_metric = json_print_metric, 506 + .skip_duplicate_pmus = json_skip_duplicate_pmus, 511 507 }; 512 508 ps = &json_ps; 513 509 } else {
+2
tools/perf/pmu-events/arch/arm64/ampere/ampereone/metrics.json
··· 231 231 "MetricName": "slots_lost_misspeculation_fraction", 232 232 "MetricExpr": "100 * ((OP_SPEC - OP_RETIRED) / (CPU_CYCLES * #slots))", 233 233 "BriefDescription": "Fraction of slots lost due to misspeculation", 234 + "DefaultMetricgroupName": "TopdownL1", 234 235 "MetricGroup": "Default;TopdownL1", 235 236 "ScaleUnit": "1percent of slots" 236 237 }, ··· 239 238 "MetricName": "retired_fraction", 240 239 "MetricExpr": "100 * (OP_RETIRED / (CPU_CYCLES * #slots))", 241 240 "BriefDescription": "Fraction of slots retiring, useful work", 241 + "DefaultMetricgroupName": "TopdownL1", 242 242 "MetricGroup": "Default;TopdownL1", 243 243 "ScaleUnit": "1percent of slots" 244 244 },
+1 -1
tools/perf/util/metricgroup.c
··· 225 225 226 226 m->pmu = pm->pmu ?: "cpu"; 227 227 m->metric_name = pm->metric_name; 228 - m->default_metricgroup_name = pm->default_metricgroup_name; 228 + m->default_metricgroup_name = pm->default_metricgroup_name ?: ""; 229 229 m->modifier = NULL; 230 230 if (modifier) { 231 231 m->modifier = strdup(modifier);