aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/env.c
diff options
context:
space:
mode:
authorRavi Bangoria <[email protected]>2022-06-04 04:45:15 +0000
committerArnaldo Carvalho de Melo <[email protected]>2022-06-24 16:18:55 +0000
commitff34eaa820231dfaecca9c048637bd86ba294bc7 (patch)
tree236c7eda53333cdbdba91bacdd83c077ed79202e /tools/perf/util/env.c
parentperf header: Pass "cpu" pmu name while printing caps (diff)
downloadkernel-ff34eaa820231dfaecca9c048637bd86ba294bc7.tar.gz
kernel-ff34eaa820231dfaecca9c048637bd86ba294bc7.zip
perf header: Store PMU caps in an array of strings
Currently all capabilities are stored in a single string separated by NULL character. Instead, store them in an array which makes searching of capability easier. Reviewed-by: Kan Liang <[email protected]> Signed-off-by: Ravi Bangoria <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Ananth Narayan <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kim Phillips <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Robert Richter <[email protected]> Cc: Sandipan Das <[email protected]> Cc: Santosh Shukla <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/env.c')
-rw-r--r--tools/perf/util/env.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 579e44c59914..7d3aeb2e4622 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -179,7 +179,7 @@ static void perf_env__purge_bpf(struct perf_env *env __maybe_unused)
void perf_env__exit(struct perf_env *env)
{
- int i;
+ int i, j;
perf_env__purge_bpf(env);
perf_env__purge_cgroups(env);
@@ -196,6 +196,8 @@ void perf_env__exit(struct perf_env *env)
zfree(&env->sibling_threads);
zfree(&env->pmu_mappings);
zfree(&env->cpu);
+ for (i = 0; i < env->nr_cpu_pmu_caps; i++)
+ zfree(&env->cpu_pmu_caps[i]);
zfree(&env->cpu_pmu_caps);
zfree(&env->numa_map);
@@ -218,6 +220,8 @@ void perf_env__exit(struct perf_env *env)
zfree(&env->hybrid_nodes);
for (i = 0; i < env->nr_hybrid_cpc_nodes; i++) {
+ for (j = 0; j < env->hybrid_cpc_nodes[i].nr_cpu_pmu_caps; j++)
+ zfree(&env->hybrid_cpc_nodes[i].cpu_pmu_caps[j]);
zfree(&env->hybrid_cpc_nodes[i].cpu_pmu_caps);
zfree(&env->hybrid_cpc_nodes[i].pmu_name);
}