Skip to contentSkip to conversation

perf/core: Verify we have a single perf_hw_context PMU

tip:perf/core Peter Zijlstra 3 participants 3 messages Apr 4, 2016 – Apr 13, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Peter Zijlstra

author maintainer
#1 lore raw
Quoted 7 lines · tip-bot for Peter Zijlstra
Commit-ID:  26657848502b78474a5f17f9ce2ae6dc8d8d6262
Gitweb:     http://git.kernel.org/tip/26657848502b78474a5f17f9ce2ae6dc8d8d6262
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Tue, 22 Mar 2016 22:09:18 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 31 Mar 2016 10:30:41 +0200
Quoted 8 lines

perf/core: Verify we have a single perf_hw_context PMU

There should (and can) only be a single PMU for perf_hw_context events.

This is because of how we schedule events: once a hardware event fails to schedule (the PMU is 'full') we stop trying to add more. The trivial 'fix' would break the Round-Robin scheduling we do.

This triggered on AMD machines..

---
Subject: perf,amd: Do not register a task ctx for uncore PMUs

Uncore PMUs are per node, they cannot have per-task counters.

---
 arch/x86/events/amd/uncore.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/events/amd/uncore.c +2 -0
index 3db9569..98ac573 100644
@@ -263,6 +263,7 @@ static const struct attribute_group *amd_uncore_attr_groups[] = {
 };
 
 static struct pmu amd_nb_pmu = {
+	.task_ctx_nr	= perf_invalid_context,
 	.attr_groups	= amd_uncore_attr_groups,
 	.name		= "amd_nb",
 	.event_init	= amd_uncore_event_init,
@@ -274,6 +275,7 @@ static struct pmu amd_nb_pmu = {
 };
 
 static struct pmu amd_l2_pmu = {
+	.task_ctx_nr	= perf_invalid_context,
 	.attr_groups	= amd_uncore_attr_groups,
 	.name		= "amd_l2",
 	.event_init	= amd_uncore_event_init,
#2 lore raw
Quoted 8 lines · Peter Zijlstra

This triggered on AMD machines..

---
Subject: perf,amd: Do not register a task ctx for uncore PMUs

Uncore PMUs are per node, they cannot have per-task counters.

	  ^
	  -and-tested-by: moi
Quoted 5 lines
---
 arch/x86/events/amd/uncore.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

...

Signature · 5 lines
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
#3 lore raw

[tip:perf/core] perf/x86/amd/uncore: Do not register a task ctx for uncore PMUs

In reply to Peter Zijlstra
perf/x86/amd/uncore: Do not register a task ctx for uncore PMUs
Commit-ID:  31d50c551e30923b86a1b5b420920dd1927fa63b
Gitweb:     http://git.kernel.org/tip/31d50c551e30923b86a1b5b420920dd1927fa63b
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Mon, 4 Apr 2016 16:02:08 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 13 Apr 2016 11:56:36 +0200

perf/x86/amd/uncore: Do not register a task ctx for uncore PMUs

The new sanity check introduced by:

26657848502b ("perf/core: Verify we have a single perf_hw_context PMU")

... triggered on the AMD uncore driver.

Uncore PMUs are per node, they cannot have per-task counters. Fix it.

---
 arch/x86/events/amd/uncore.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/events/amd/uncore.c +2 -0
index 3db9569..98ac573 100644
@@ -263,6 +263,7 @@ static const struct attribute_group *amd_uncore_attr_groups[] = {
 };
 
 static struct pmu amd_nb_pmu = {
+	.task_ctx_nr	= perf_invalid_context,
 	.attr_groups	= amd_uncore_attr_groups,
 	.name		= "amd_nb",
 	.event_init	= amd_uncore_event_init,
@@ -274,6 +275,7 @@ static struct pmu amd_nb_pmu = {
 };
 
 static struct pmu amd_l2_pmu = {
+	.task_ctx_nr	= perf_invalid_context,
 	.attr_groups	= amd_uncore_attr_groups,
 	.name		= "amd_l2",
 	.event_init	= amd_uncore_event_init,