* [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type
@ 2009-05-06 12:39 Robert Richter
2009-05-06 12:39 ` [PATCH 1/2] oprofile: introduce module_param oprofile.cpu_type Robert Richter
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Robert Richter @ 2009-05-06 12:39 UTC (permalink / raw)
To: Andi Kleen; +Cc: Linus Torvalds, Ingo Molnar, LKML, oprofile-list
The current userland does not yet fully support all cpu types
implemented in the kernel. With the module parameter oprofile.cpu_type
a certain cpu type can be reported to the oprofile userland and thus
makes the kernel usable with current distros.
The event table may not match fully, so care must be taken when using
this parameter.
See also this description:
oprofile.cpu_type= Force an oprofile cpu type
This might be useful if you have an older oprofile
userland or if you want common events.
Format: { archperfmon | core_2 }
archperfmon: [X86] Force use of architectural
perfmon on Intel CPUs instead of the
CPU specific event set.
core_2: [X86] On Intel systems: report core_2 CPU.
Together with Andi's patches the patch set is also in this tree:
git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile.git fixes
The fixes are intended for v2.6.30.
Andi, please let me now if this works for you and if things can go
upstream this way.
-Robert
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] oprofile: introduce module_param oprofile.cpu_type
2009-05-06 12:39 [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type Robert Richter
@ 2009-05-06 12:39 ` Robert Richter
2009-05-06 12:39 ` [PATCH 2/2] x86/oprofile: add module parameter option to force a core 2 cpu Robert Richter
2009-05-06 14:47 ` [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type Andi Kleen
2 siblings, 0 replies; 6+ messages in thread
From: Robert Richter @ 2009-05-06 12:39 UTC (permalink / raw)
To: Andi Kleen
Cc: Linus Torvalds, Ingo Molnar, LKML, oprofile-list, Robert Richter,
Andi Kleen
This patch removes module_param oprofile.force_arch_perfmon and
introduces oprofile.cpu_type=archperfmon instead. This new parameter
can be reused for other models and architectures.
Currently only archperfmon is supported.
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
---
Documentation/kernel-parameters.txt | 12 +++++++-----
arch/x86/oprofile/nmi_int.c | 13 +++++++++++--
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 9b9566b..6ce5f48 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1650,11 +1650,13 @@ and is between 256 and 4096 characters. It is defined in the file
oprofile.timer= [HW]
Use timer interrupt instead of performance counters
- oprofile.force_arch_perfmon=1 [X86]
- Force use of architectural perfmon instead of
- the CPU specific event set.
- This might be useful if you have older oprofile
- userland or if you want common events over Intel CPUs.
+ oprofile.cpu_type= Force an oprofile cpu type
+ This might be useful if you have an older oprofile
+ userland or if you want common events.
+ Format: { archperfmon }
+ archperfmon: [X86] Force use of architectural
+ perfmon on Intel CPUs instead of the
+ CPU specific event set.
osst= [HW,SCSI] SCSI Tape Driver
Format: <buffer_size>,<write_threshold>
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 3308147..3b285e6 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -386,8 +386,17 @@ static int __init p4_init(char **cpu_type)
return 0;
}
-int force_arch_perfmon;
-module_param(force_arch_perfmon, int, 0);
+static int force_arch_perfmon;
+static int force_cpu_type(const char *str, struct kernel_param *kp)
+{
+ if (!strcmp(str, "archperfmon")) {
+ force_arch_perfmon = 1;
+ printk(KERN_INFO "oprofile: forcing architectural perfmon\n");
+ }
+
+ return 0;
+}
+module_param_call(cpu_type, force_cpu_type, NULL, NULL, 0);
static int __init ppro_init(char **cpu_type)
{
--
1.6.1.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] x86/oprofile: add module parameter option to force a core 2 cpu
2009-05-06 12:39 [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type Robert Richter
2009-05-06 12:39 ` [PATCH 1/2] oprofile: introduce module_param oprofile.cpu_type Robert Richter
@ 2009-05-06 12:39 ` Robert Richter
2009-05-06 14:47 ` [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type Andi Kleen
2 siblings, 0 replies; 6+ messages in thread
From: Robert Richter @ 2009-05-06 12:39 UTC (permalink / raw)
To: Andi Kleen
Cc: Linus Torvalds, Ingo Molnar, LKML, oprofile-list, Robert Richter,
Andi Kleen
The current userland does not yet fully support all cpu types
implemented in the kernel. With the module parameter:
oprofile.cpu_type=core_2
the kernel reports a core_2 cpu to the userland on an Intel system and
thus makes oprofile usable with current distros.
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
---
Documentation/kernel-parameters.txt | 3 ++-
arch/x86/oprofile/nmi_int.c | 17 ++++++++++++++---
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 6ce5f48..ea7ead3 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1653,10 +1653,11 @@ and is between 256 and 4096 characters. It is defined in the file
oprofile.cpu_type= Force an oprofile cpu type
This might be useful if you have an older oprofile
userland or if you want common events.
- Format: { archperfmon }
+ Format: { archperfmon | core_2 }
archperfmon: [X86] Force use of architectural
perfmon on Intel CPUs instead of the
CPU specific event set.
+ core_2: [X86] On Intel systems: report core_2 CPU.
osst= [HW,SCSI] SCSI Tape Driver
Format: <buffer_size>,<write_threshold>
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 3b285e6..d7348a2 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -386,12 +386,20 @@ static int __init p4_init(char **cpu_type)
return 0;
}
-static int force_arch_perfmon;
+static enum {
+ NONE = 0,
+ ARCH_PERFMON,
+ CORE_2,
+} forced_cpu;
+
static int force_cpu_type(const char *str, struct kernel_param *kp)
{
if (!strcmp(str, "archperfmon")) {
- force_arch_perfmon = 1;
+ forced_cpu = ARCH_PERFMON;
printk(KERN_INFO "oprofile: forcing architectural perfmon\n");
+ } else if (!strcmp(str, "core_2")) {
+ forced_cpu = CORE_2;
+ printk(KERN_INFO "oprofile: forcing core_2\n");
}
return 0;
@@ -402,9 +410,12 @@ static int __init ppro_init(char **cpu_type)
{
__u8 cpu_model = boot_cpu_data.x86_model;
- if (force_arch_perfmon && cpu_has_arch_perfmon)
+ if (forced_cpu == ARCH_PERFMON && cpu_has_arch_perfmon)
return 0;
+ if (forced_cpu == CORE_2)
+ cpu_model = 15;
+
switch (cpu_model) {
case 0 ... 2:
*cpu_type = "i386/ppro";
--
1.6.1.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type
2009-05-06 12:39 [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type Robert Richter
2009-05-06 12:39 ` [PATCH 1/2] oprofile: introduce module_param oprofile.cpu_type Robert Richter
2009-05-06 12:39 ` [PATCH 2/2] x86/oprofile: add module parameter option to force a core 2 cpu Robert Richter
@ 2009-05-06 14:47 ` Andi Kleen
2009-05-06 16:39 ` Robert Richter
2009-06-10 13:07 ` Robert Richter
2 siblings, 2 replies; 6+ messages in thread
From: Andi Kleen @ 2009-05-06 14:47 UTC (permalink / raw)
To: Robert Richter
Cc: Andi Kleen, Linus Torvalds, Ingo Molnar, LKML, oprofile-list
On Wed, May 06, 2009 at 02:39:12PM +0200, Robert Richter wrote:
> The current userland does not yet fully support all cpu types
> implemented in the kernel. With the module parameter oprofile.cpu_type
> a certain cpu type can be reported to the oprofile userland and thus
> makes the kernel usable with current distros.
On Intel systems forcing archperfmon is the only one that makes sense
nd only if the CPU supports arch perfmon(btw that's already in my patchkit
which you haven't commented on so far)
I don't thinking forcing core2 on a system like Nehalem with completely
different events is a good idea though. This just means if the user
selects anything unusual they will get junk data, which is just
a bad design.
Also if you force core2 on a P4 system the kernel will just oops
because it will access MSRs that are not there. So I don't think
that's a good idea.
It means you have to update oprofile userland at least once until
you have arch perfmon support, but I think even Linus will be able
to do that :) Hopefully Maynard will do a new release soon.
The force of core2 is nacked from my side.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type
2009-05-06 14:47 ` [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type Andi Kleen
@ 2009-05-06 16:39 ` Robert Richter
2009-06-10 13:07 ` Robert Richter
1 sibling, 0 replies; 6+ messages in thread
From: Robert Richter @ 2009-05-06 16:39 UTC (permalink / raw)
To: Andi Kleen; +Cc: Linus Torvalds, Ingo Molnar, LKML, oprofile-list
On 06.05.09 16:47:20, Andi Kleen wrote:
> On Wed, May 06, 2009 at 02:39:12PM +0200, Robert Richter wrote:
> > The current userland does not yet fully support all cpu types
> > implemented in the kernel. With the module parameter oprofile.cpu_type
> > a certain cpu type can be reported to the oprofile userland and thus
> > makes the kernel usable with current distros.
>
> On Intel systems forcing archperfmon is the only one that makes sense
> nd only if the CPU supports arch perfmon(btw that's already in my patchkit
> which you haven't commented on so far)
>
> I don't thinking forcing core2 on a system like Nehalem with completely
> different events is a good idea though. This just means if the user
> selects anything unusual they will get junk data, which is just
> a bad design.
It is a kernel parameter, and users should know what they are doing
and what the risks are. I assume counting cpu clk unhalted will work
and some other events too. So the patch does not hurt.
> Also if you force core2 on a P4 system the kernel will just oops
> because it will access MSRs that are not there. So I don't think
> that's a good idea.
It anables core_2 only on family 6 (ppro implementation).
>
> It means you have to update oprofile userland at least once until
> you have arch perfmon support, but I think even Linus will be able
> to do that :) Hopefully Maynard will do a new release soon.
I agree, a new release of the userland would be the best. But till
then it is at least 1-2 months to go.
> The force of core2 is nacked from my side.
I do not have any passion with this patch, What I have in mind is
"oprofile sucks", and this patch would make oprofile more usable.
-Robert
--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type
2009-05-06 14:47 ` [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type Andi Kleen
2009-05-06 16:39 ` Robert Richter
@ 2009-06-10 13:07 ` Robert Richter
1 sibling, 0 replies; 6+ messages in thread
From: Robert Richter @ 2009-06-10 13:07 UTC (permalink / raw)
To: Andi Kleen; +Cc: Linus Torvalds, Ingo Molnar, LKML, oprofile-list
On 06.05.09 16:47:20, Andi Kleen wrote:
> The force of core2 is nacked from my side.
I will drop this patch.
-Robert
--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-06-10 13:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-06 12:39 [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type Robert Richter
2009-05-06 12:39 ` [PATCH 1/2] oprofile: introduce module_param oprofile.cpu_type Robert Richter
2009-05-06 12:39 ` [PATCH 2/2] x86/oprofile: add module parameter option to force a core 2 cpu Robert Richter
2009-05-06 14:47 ` [PATCH 0/2] oprofile: introduce module parameter oprofile.cpu_type Andi Kleen
2009-05-06 16:39 ` Robert Richter
2009-06-10 13:07 ` Robert Richter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox