* [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg
@ 2013-06-04 9:45 Mischa Jonker
2013-06-04 9:58 ` Peter Zijlstra
2013-06-19 18:38 ` [tip:perf/core] perf: Add " tip-bot for Mischa Jonker
0 siblings, 2 replies; 8+ messages in thread
From: Mischa Jonker @ 2013-06-04 9:45 UTC (permalink / raw)
To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo, James Hogan, linux-kernel,
Vineet.Gupta1
Cc: Mischa Jonker
This allows us to use pdev->name for registering a PMU device.
IMO the name is not supposed to be changed anyway.
Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
---
arch/metag/kernel/perf/perf_event.c | 2 +-
include/linux/perf_event.h | 4 ++--
kernel/events/core.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/metag/kernel/perf/perf_event.c b/arch/metag/kernel/perf/perf_event.c
index 3665694..5b18888 100644
--- a/arch/metag/kernel/perf/perf_event.c
+++ b/arch/metag/kernel/perf/perf_event.c
@@ -882,7 +882,7 @@ static int __init init_hw_perf_events(void)
}
register_cpu_notifier(&metag_pmu_notifier);
- ret = perf_pmu_register(&pmu, (char *)metag_pmu->name, PERF_TYPE_RAW);
+ ret = perf_pmu_register(&pmu, metag_pmu->name, PERF_TYPE_RAW);
out:
return ret;
}
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index f463a46..65a462c 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -188,7 +188,7 @@ struct pmu {
struct device *dev;
const struct attribute_group **attr_groups;
- char *name;
+ const char *name;
int type;
int * __percpu pmu_disable_count;
@@ -518,7 +518,7 @@ struct perf_output_handle {
#ifdef CONFIG_PERF_EVENTS
-extern int perf_pmu_register(struct pmu *pmu, char *name, int type);
+extern int perf_pmu_register(struct pmu *pmu, const char *name, int type);
extern void perf_pmu_unregister(struct pmu *pmu);
extern int perf_num_counters(void);
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 9dc297f..7003d6f 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5952,7 +5952,7 @@ free_dev:
static struct lock_class_key cpuctx_mutex;
static struct lock_class_key cpuctx_lock;
-int perf_pmu_register(struct pmu *pmu, char *name, int type)
+int perf_pmu_register(struct pmu *pmu, const char *name, int type)
{
int cpu, ret;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg
2013-06-04 9:45 [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg Mischa Jonker
@ 2013-06-04 9:58 ` Peter Zijlstra
2013-06-04 10:02 ` Vineet Gupta
2013-06-19 18:38 ` [tip:perf/core] perf: Add " tip-bot for Mischa Jonker
1 sibling, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2013-06-04 9:58 UTC (permalink / raw)
To: Mischa Jonker
Cc: Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo,
James Hogan, linux-kernel, Vineet.Gupta1
On Tue, Jun 04, 2013 at 11:45:48AM +0200, Mischa Jonker wrote:
> This allows us to use pdev->name for registering a PMU device.
> IMO the name is not supposed to be changed anyway.
>
Indeed, and thanks!
PS. WTH is a metag?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg
2013-06-04 9:58 ` Peter Zijlstra
@ 2013-06-04 10:02 ` Vineet Gupta
2013-06-04 11:03 ` Peter Zijlstra
0 siblings, 1 reply; 8+ messages in thread
From: Vineet Gupta @ 2013-06-04 10:02 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Mischa Jonker, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo, James Hogan, linux-kernel
On 06/04/2013 03:28 PM, Peter Zijlstra wrote:
> On Tue, Jun 04, 2013 at 11:45:48AM +0200, Mischa Jonker wrote:
>> This allows us to use pdev->name for registering a PMU device.
>> IMO the name is not supposed to be changed anyway.
>>
> Indeed, and thanks!
>
> PS. WTH is a metag?
It's the cpu core from Imagination Tech - their port got merged in 3.9 (along with
ARC from Synopsys).
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg
2013-06-04 10:02 ` Vineet Gupta
@ 2013-06-04 11:03 ` Peter Zijlstra
2013-06-04 11:09 ` Vineet Gupta
0 siblings, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2013-06-04 11:03 UTC (permalink / raw)
To: Vineet Gupta
Cc: Mischa Jonker, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo, James Hogan, linux-kernel
On Tue, Jun 04, 2013 at 03:32:05PM +0530, Vineet Gupta wrote:
> On 06/04/2013 03:28 PM, Peter Zijlstra wrote:
> > On Tue, Jun 04, 2013 at 11:45:48AM +0200, Mischa Jonker wrote:
> >> This allows us to use pdev->name for registering a PMU device.
> >> IMO the name is not supposed to be changed anyway.
> >>
> > Indeed, and thanks!
> >
> > PS. WTH is a metag?
>
> It's the cpu core from Imagination Tech - their port got merged in 3.9 (along with
> ARC from Synopsys).
So its Meta-G, not me-tag :-) Google gave me the below, its not exactly
clear what kind of animal it is or what the G stands for. Too much
marketing speak, too little useful information.
http://www.imgtec.com/meta/meta-technology.asp
Simlar 'complaint' for the ARC stuff really, only marketing speak :-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg
2013-06-04 11:03 ` Peter Zijlstra
@ 2013-06-04 11:09 ` Vineet Gupta
2013-06-04 11:18 ` Peter Zijlstra
0 siblings, 1 reply; 8+ messages in thread
From: Vineet Gupta @ 2013-06-04 11:09 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Mischa Jonker, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo, James Hogan, linux-kernel
On 06/04/2013 04:33 PM, Peter Zijlstra wrote:
> Simlar 'complaint' for the ARC stuff really, only marketing speak :-)
You mean lack of prefix in this case (as opposed to MetaG).
Anyhow, this patch served a lot more purpose than Mischa really wanted - formally
introduced you to two new architectures ;-)
-Vineet
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg
2013-06-04 11:09 ` Vineet Gupta
@ 2013-06-04 11:18 ` Peter Zijlstra
2013-06-12 11:49 ` James Hogan
0 siblings, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2013-06-04 11:18 UTC (permalink / raw)
To: Vineet Gupta
Cc: Mischa Jonker, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo, James Hogan, linux-kernel
On Tue, Jun 04, 2013 at 04:39:05PM +0530, Vineet Gupta wrote:
> On 06/04/2013 04:33 PM, Peter Zijlstra wrote:
> > Simlar 'complaint' for the ARC stuff really, only marketing speak :-)
>
> You mean lack of prefix in this case (as opposed to MetaG).
Nah, lack of proper (!markting speak) introduction to the arch ;-)
Is there something like the Intel SDM for these archs, if so, do we want
to make it easier to find them for people?
> Anyhow, this patch served a lot more purpose than Mischa really wanted - formally
> introduced you to two new architectures ;-)
Yah.. it seems archs sneak up on you these days.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg
2013-06-04 11:18 ` Peter Zijlstra
@ 2013-06-12 11:49 ` James Hogan
0 siblings, 0 replies; 8+ messages in thread
From: James Hogan @ 2013-06-12 11:49 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Vineet Gupta, Mischa Jonker, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo, linux-kernel
On 04/06/13 12:18, Peter Zijlstra wrote:
> On Tue, Jun 04, 2013 at 04:39:05PM +0530, Vineet Gupta wrote:
>> On 06/04/2013 04:33 PM, Peter Zijlstra wrote:
>>> Simlar 'complaint' for the ARC stuff really, only marketing speak :-)
>>
>> You mean lack of prefix in this case (as opposed to MetaG).
>
> Nah, lack of proper (!markting speak) introduction to the arch ;-)
>
> Is there something like the Intel SDM for these archs,
For metag, see the patchset intro for a brief (hopefully !marketing)
intro and links to documentation. Meta is the marketing name, metag is
generally used in code which reduces ambiguity with the word meta - tbh
I'm not certain whether metag is short for metagence or means something
else, but it's been that way for years now.
http://lwn.net/Articles/534906/
> if so, do we want
> to make it easier to find them for people?
Where would you suggest?
Some other arches link to the linux-$ARCH project homepages in Kconfig
help text which makes sense as that can then link to various
documentation and be more easily kept up to date. Not all arches have a
big project around them like that though.
Cheers
James
^ permalink raw reply [flat|nested] 8+ messages in thread
* [tip:perf/core] perf: Add const qualifier to perf_pmu_register's 'name' arg
2013-06-04 9:45 [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg Mischa Jonker
2013-06-04 9:58 ` Peter Zijlstra
@ 2013-06-19 18:38 ` tip-bot for Mischa Jonker
1 sibling, 0 replies; 8+ messages in thread
From: tip-bot for Mischa Jonker @ 2013-06-19 18:38 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, Mischa.Jonker, hpa, mingo, mjonker, peterz, tglx
Commit-ID: 03d8e80beb7db78a13c192431205b9c83f7e0cd1
Gitweb: http://git.kernel.org/tip/03d8e80beb7db78a13c192431205b9c83f7e0cd1
Author: Mischa Jonker <Mischa.Jonker@synopsys.com>
AuthorDate: Tue, 4 Jun 2013 11:45:48 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 19 Jun 2013 12:50:23 +0200
perf: Add const qualifier to perf_pmu_register's 'name' arg
This allows us to use pdev->name for registering a PMU device.
IMO the name is not supposed to be changed anyway.
Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1370339148-5566-1-git-send-email-mjonker@synopsys.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/metag/kernel/perf/perf_event.c | 2 +-
include/linux/perf_event.h | 4 ++--
kernel/events/core.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/metag/kernel/perf/perf_event.c b/arch/metag/kernel/perf/perf_event.c
index 3665694..5b18888 100644
--- a/arch/metag/kernel/perf/perf_event.c
+++ b/arch/metag/kernel/perf/perf_event.c
@@ -882,7 +882,7 @@ static int __init init_hw_perf_events(void)
}
register_cpu_notifier(&metag_pmu_notifier);
- ret = perf_pmu_register(&pmu, (char *)metag_pmu->name, PERF_TYPE_RAW);
+ ret = perf_pmu_register(&pmu, metag_pmu->name, PERF_TYPE_RAW);
out:
return ret;
}
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 74a4e14..4bc57d0 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -188,7 +188,7 @@ struct pmu {
struct device *dev;
const struct attribute_group **attr_groups;
- char *name;
+ const char *name;
int type;
int * __percpu pmu_disable_count;
@@ -519,7 +519,7 @@ struct perf_output_handle {
#ifdef CONFIG_PERF_EVENTS
-extern int perf_pmu_register(struct pmu *pmu, char *name, int type);
+extern int perf_pmu_register(struct pmu *pmu, const char *name, int type);
extern void perf_pmu_unregister(struct pmu *pmu);
extern int perf_num_counters(void);
diff --git a/kernel/events/core.c b/kernel/events/core.c
index aca95bc..9c89207 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6179,7 +6179,7 @@ free_dev:
static struct lock_class_key cpuctx_mutex;
static struct lock_class_key cpuctx_lock;
-int perf_pmu_register(struct pmu *pmu, char *name, int type)
+int perf_pmu_register(struct pmu *pmu, const char *name, int type)
{
int cpu, ret;
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-06-19 18:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04 9:45 [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg Mischa Jonker
2013-06-04 9:58 ` Peter Zijlstra
2013-06-04 10:02 ` Vineet Gupta
2013-06-04 11:03 ` Peter Zijlstra
2013-06-04 11:09 ` Vineet Gupta
2013-06-04 11:18 ` Peter Zijlstra
2013-06-12 11:49 ` James Hogan
2013-06-19 18:38 ` [tip:perf/core] perf: Add " tip-bot for Mischa Jonker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox