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

!12315 perf pmu: resolve CPU map for "cpu" PMUs

Merge Pull Request from: @zhangqizhi3 
 
Resolve perf integration
perf arm: Workaround ARM PMUs cpu maps having offline cpus
perf pmu: Add CPU map for "cpu" PMUs
perf cpumap: Add intersect function
perf cpumap: Add is_subset function
The issue of make failure caused by patching

zhangqizhi (8):
  Revert "perf arm: Workaround ARM PMUs cpu maps having offline cpus"
  Revert "perf pmu: Add CPU map for "cpu" PMUs"
  Revert "perf cpumap: Add intersect function"
  Revert "perf cpumap: Add is_subset function"
  perf cpumap: Add is_subset function
  perf cpumap: Add intersect function
  perf pmu: Add CPU map for "cpu" PMUs
  perf arm: Workaround ARM PMUs cpu maps having offline cpus

 tools/lib/perf/cpumap.c                  | 92 ++++++++++++------------
 tools/lib/perf/include/internal/cpumap.h |  2 +-
 tools/lib/perf/include/perf/cpumap.h     |  2 +-
 tools/perf/arch/arm/util/pmu.c           | 12 ++--
 tools/perf/tests/cpumap.c                | 45 ------------
 tools/perf/util/cpumap.h                 |  8 ---
 tools/perf/util/pmu.c                    |  2 +-
 7 files changed, 55 insertions(+), 108 deletions(-)

 
 
Link:https://gitee.com/openeuler/kernel/pulls/12315

 

Reviewed-by: default avatarXu Kuohai <xukuohai@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parents c93f7899 f99aef79
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -147,8 +147,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| Hisilicon      | Hip08 SMMU PMCG | #162001800      | N/A                         |
+----------------+-----------------+-----------------+-----------------------------+
| Hisilicon      | Hip08 SMMU PMCG | #162001900      | N/A                         |
|                | Hip09 SMMU PMCG |                 |                             |
| Hisilicon      | Hip{08,09,10,10C| #162001900      | N/A                         |
|                | ,11} SMMU PMCG  |                 |                             |
+----------------+-----------------+-----------------+-----------------------------+
| Hisilicon      | TSV{110,200}    | #1980005        | HISILICON_ERRATUM_1980005   |
+----------------+-----------------+-----------------+-----------------------------+
+7 −0
Original line number Diff line number Diff line
@@ -1481,6 +1481,13 @@ static struct acpi_platform_list pmcg_plat_info[] __initdata = {
	/* HiSilicon Hip09 Platform */
	{"HISI  ", "HIP09   ", 0, ACPI_SIG_IORT, greater_than_or_equal,
	 "Erratum #162001900", IORT_SMMU_V3_PMCG_HISI_HIP09},
	/* HiSilicon Hip10/11 Platform uses the same SMMU IP with Hip09 */
	{"HISI  ", "HIP10   ", 0, ACPI_SIG_IORT, greater_than_or_equal,
	 "Erratum #162001900", IORT_SMMU_V3_PMCG_HISI_HIP09},
	{"HISI  ", "HIP10C  ", 0, ACPI_SIG_IORT, greater_than_or_equal,
	 "Erratum #162001900", IORT_SMMU_V3_PMCG_HISI_HIP09},
	{"HISI  ", "HIP11   ", 0, ACPI_SIG_IORT, greater_than_or_equal,
	 "Erratum #162001900", IORT_SMMU_V3_PMCG_HISI_HIP09},
	{ }
};

+46 −46
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ struct perf_cpu_map *perf_cpu_map__intersect(struct perf_cpu_map *orig,
               }
       }
       if (k)
		merged = cpu_map__trim_new(k, tmp_cpus);
               merged = cpu_map__trim_new(k, &tmp_cpus->cpu);
       free(tmp_cpus);
       return merged;
}
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ struct perf_cpu_map {
#define MAX_NR_CPUS	2048
#endif

int perf_cpu_map__idx(const struct perf_cpu_map *cpus, struct perf_cpu cpu);
int perf_cpu_map__idx(struct perf_cpu_map *cpus, int cpu);
bool perf_cpu_map__is_subset(const struct perf_cpu_map *a, const struct perf_cpu_map *b);

#endif /* __LIBPERF_INTERNAL_CPUMAP_H */
+6 −6
Original line number Diff line number Diff line
@@ -13,8 +13,6 @@
#include "hisi-ptt.h"
#include "../../../util/cpumap.h"
#include "../../../util/pmu.h"
#include "../../../util/cs-etm.h"
#include "../../arm64/util/mem-events.h"

struct perf_event_attr
*perf_pmu__get_default_config(struct perf_pmu *pmu)
@@ -32,10 +30,12 @@ struct perf_event_attr
		pmu->selectable = true;
#endif
	}

#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;
}
Loading