Unverified Commit d29f3cb0 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14412 [OLK-6.6]Workaround ARM PMUs cpu maps having offline cpus

Merge Pull Request from: @zhangqizhi3 
 
When PMUs have a cpu map in the 'cpus' or 'cpumask' file, perf will
try to open events on those CPUs. ARM doesn't remove offline CPUs
meaning taking a CPU offline will cause perf commands to fail unless a
CPU map is passed on the command line. 
 
Link:https://gitee.com/openeuler/kernel/pulls/14412

 

Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents ae05f7e5 cea1c281
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -11,12 +11,15 @@

#include "arm-spe.h"
#include "hisi-ptt.h"
#include "../../../util/cpumap.h"
#include "../../../util/pmu.h"
#include "../../../util/cs-etm.h"

struct perf_event_attr
*perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)
*perf_pmu__get_default_config(struct perf_pmu *pmu)
{
	struct perf_cpu_map *intersect;

#ifdef HAVE_AUXTRACE_SUPPORT
	if (!strcmp(pmu->name, CORESIGHT_ETM_PMU_NAME)) {
		/* add ETM default config here */
@@ -31,5 +34,10 @@ struct perf_event_attr
	}

#endif
	/* Workaround some ARM PMU's failing to correctly set CPU maps for online processors. */
	intersect = perf_cpu_map__intersect(cpu_map__online(), pmu->cpus);
	perf_cpu_map__put(pmu->cpus);
	pmu->cpus = intersect;

	return NULL;
}