Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d64b25b6 authored by Stephane Eranian's avatar Stephane Eranian Committed by Thomas Gleixner
Browse files

perf/x86/uncore: add ability to customize pmu callbacks



This patch enables custom struct pmu callbacks per uncore
PMU types. This feature may be used to simplify counter
setup for certain uncore PMUs which have free running
counters for instance. It becomes possible to bypass
the event scheduling phase of the configuration.

Cc: mingo@elte.hu
Cc: acme@redhat.com
Cc: ak@linux.intel.com
Cc: zheng.z.yan@intel.com
Cc: peterz@infradead.org
Signed-off-by: default avatarStephane Eranian <eranian@google.com>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1392132015-14521-3-git-send-email-eranian@google.com


Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 411cf180
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -3271,6 +3271,7 @@ static int __init uncore_pmu_register(struct intel_uncore_pmu *pmu)
{
	int ret;

	if (!pmu->type->pmu) {
		pmu->pmu = (struct pmu) {
			.attr_groups	= pmu->type->attr_groups,
			.task_ctx_nr	= perf_invalid_context,
@@ -3281,6 +3282,10 @@ static int __init uncore_pmu_register(struct intel_uncore_pmu *pmu)
			.stop		= uncore_pmu_event_stop,
			.read		= uncore_pmu_event_read,
		};
	} else {
		pmu->pmu = *pmu->type->pmu;
		pmu->pmu.attr_groups = pmu->type->attr_groups;
	}

	if (pmu->type->num_boxes == 1) {
		if (strlen(pmu->type->name) > 0)
+1 −0
Original line number Diff line number Diff line
@@ -440,6 +440,7 @@ struct intel_uncore_type {
	struct intel_uncore_ops *ops;
	struct uncore_event_desc *event_descs;
	const struct attribute_group *attr_groups[4];
	struct pmu *pmu; /* for custom pmu ops */
};

#define pmu_group attr_groups[0]