* [Linux-ia64] [PATCH] Support for alternative kernel profiler in a module
@ 2002-01-05 1:03 Luck, Tony
2002-01-09 21:37 ` [Linux-ia64] [PATCH] Support for alternative kernel profiler Luck, Tony
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Luck, Tony @ 2002-01-05 1:03 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 497 bytes --]
To allow an alternative kernel profiler using the ia64
perfomance counters to be loaded as a module, a couple
of small changes are needed.
1) Define a new 'irqflags' bit (SA_PERCPU_IRQ) to allow a module
to request a per-cpu irq.
2) Export init_tasks[] so that the module can adjust the state
of psr.pp in the idle tasks for all CPUs.
I've attached the patch rather than inlining it in the hope that
outlook won't sabotage it by folding long lines or playing with
tabs and spaces.
-Tony Luck
[-- Attachment #2: DIFF --]
[-- Type: application/octet-stream, Size: 1542 bytes --]
diff -ru ../../REF/2.4.17-ia64-011226/arch/ia64/kernel/irq.c linux/arch/ia64/kernel/irq.c
--- ../../REF/2.4.17-ia64-011226/arch/ia64/kernel/irq.c Mon Dec 31 09:02:35 2001
+++ linux/arch/ia64/kernel/irq.c Fri Jan 4 16:17:35 2002
@@ -1010,6 +1010,11 @@
rand_initialize_irq(irq);
}
+ if (new->flags & SA_PERCPU_IRQ) {
+ desc->status |= IRQ_PER_CPU;
+ desc->handler = &irq_type_ia64_lsapic;
+ }
+
/*
* The following block of code has to be executed atomically
*/
diff -ru ../../REF/2.4.17-ia64-011226/include/asm-ia64/signal.h linux/include/asm-ia64/signal.h
--- ../../REF/2.4.17-ia64-011226/include/asm-ia64/signal.h Wed Oct 3 11:32:32 2001
+++ linux/include/asm-ia64/signal.h Fri Jan 4 16:23:52 2002
@@ -111,10 +111,12 @@
*
* SA_INTERRUPT is also used by the irq handling routines.
* SA_SHIRQ is for shared interrupt support on PCI and EISA.
+ * SA_PERCPU_IRQ is for processor internal interrupts
*/
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
+#define SA_PERCPU_IRQ 0x02000000
#endif /* __KERNEL__ */
diff -ru ../../REF/2.4.17-ia64-011226/kernel/ksyms.c linux/kernel/ksyms.c
--- ../../REF/2.4.17-ia64-011226/kernel/ksyms.c Mon Dec 31 09:02:39 2001
+++ linux/kernel/ksyms.c Fri Jan 4 16:22:11 2002
@@ -556,6 +556,7 @@
/* init task, for moving kthread roots - ought to export a function ?? */
EXPORT_SYMBOL(init_task_union);
+EXPORT_SYMBOL(init_tasks);
EXPORT_SYMBOL(tasklist_lock);
EXPORT_SYMBOL(pidhash);
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [Linux-ia64] [PATCH] Support for alternative kernel profiler
2002-01-05 1:03 [Linux-ia64] [PATCH] Support for alternative kernel profiler in a module Luck, Tony
@ 2002-01-09 21:37 ` Luck, Tony
2002-01-10 19:25 ` David Mosberger
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Luck, Tony @ 2002-01-09 21:37 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 946 bytes --]
It turns out that we don't really need to have init_tasks[] exported.
Here is a revised version of the patch with just the change to add
SA_PERCPU_IRQ to the flags accepted by request_irq()
-Tony
-----Original Message-----
From: Luck, Tony [mailto:tony.luck@intel.com]
Sent: Friday, January 04, 2002 5:04 PM
To: 'davidm@hpl.hp.com'
Cc: linux-ia64@linuxia64.org
Subject: [Linux-ia64] [PATCH] Support for alternative kernel profiler in
a module
To allow an alternative kernel profiler using the ia64
perfomance counters to be loaded as a module, a couple
of small changes are needed.
1) Define a new 'irqflags' bit (SA_PERCPU_IRQ) to allow a module
to request a per-cpu irq.
2) Export init_tasks[] so that the module can adjust the state
of psr.pp in the idle tasks for all CPUs.
I've attached the patch rather than inlining it in the hope that
outlook won't sabotage it by folding long lines or playing with
tabs and spaces.
-Tony Luck
[-- Attachment #2: DIFF --]
[-- Type: application/octet-stream, Size: 1118 bytes --]
diff -ru ../../REF/2.4.17-ia64-011226/arch/ia64/kernel/irq.c linux/arch/ia64/kernel/irq.c
--- ../../REF/2.4.17-ia64-011226/arch/ia64/kernel/irq.c Mon Dec 31 09:02:35 2001
+++ linux/arch/ia64/kernel/irq.c Fri Jan 4 16:17:35 2002
@@ -1010,6 +1010,11 @@
rand_initialize_irq(irq);
}
+ if (new->flags & SA_PERCPU_IRQ) {
+ desc->status |= IRQ_PER_CPU;
+ desc->handler = &irq_type_ia64_lsapic;
+ }
+
/*
* The following block of code has to be executed atomically
*/
diff -ru ../../REF/2.4.17-ia64-011226/include/asm-ia64/signal.h linux/include/asm-ia64/signal.h
--- ../../REF/2.4.17-ia64-011226/include/asm-ia64/signal.h Wed Oct 3 11:32:32 2001
+++ linux/include/asm-ia64/signal.h Fri Jan 4 16:23:52 2002
@@ -111,10 +111,12 @@
*
* SA_INTERRUPT is also used by the irq handling routines.
* SA_SHIRQ is for shared interrupt support on PCI and EISA.
+ * SA_PERCPU_IRQ is for processor internal interrupts
*/
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
+#define SA_PERCPU_IRQ 0x02000000
#endif /* __KERNEL__ */
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [Linux-ia64] [PATCH] Support for alternative kernel profiler
2002-01-05 1:03 [Linux-ia64] [PATCH] Support for alternative kernel profiler in a module Luck, Tony
2002-01-09 21:37 ` [Linux-ia64] [PATCH] Support for alternative kernel profiler Luck, Tony
@ 2002-01-10 19:25 ` David Mosberger
2002-01-10 19:27 ` David Mosberger
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Mosberger @ 2002-01-10 19:25 UTC (permalink / raw)
To: linux-ia64
>>>>> On Wed, 9 Jan 2002 13:37:34 -0800 , "Luck, Tony" <tony.luck@intel.com> said:
Tony> It turns out that we don't really need to have init_tasks[]
Tony> exported. Here is a revised version of the patch with just
Tony> the change to add SA_PERCPU_IRQ to the flags accepted by
Tony> request_irq()
I'd like Stephane to take a look at this patch and see whether there
are any potential bad interactions with the PMU code he is working on
(due to the manipulation of the psr.pp bit). Other than that, the
patch looks good to me.
--david
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [Linux-ia64] [PATCH] Support for alternative kernel profiler
2002-01-05 1:03 [Linux-ia64] [PATCH] Support for alternative kernel profiler in a module Luck, Tony
2002-01-09 21:37 ` [Linux-ia64] [PATCH] Support for alternative kernel profiler Luck, Tony
2002-01-10 19:25 ` David Mosberger
@ 2002-01-10 19:27 ` David Mosberger
2002-01-10 23:26 ` Luck, Tony
2002-01-10 23:37 ` David Mosberger
4 siblings, 0 replies; 6+ messages in thread
From: David Mosberger @ 2002-01-10 19:27 UTC (permalink / raw)
To: linux-ia64
Umh, my previous mail probably wasn't very clear: I did apply the
patch to add the SA_PERCPU_IRQ.
--david
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [Linux-ia64] [PATCH] Support for alternative kernel profiler
2002-01-05 1:03 [Linux-ia64] [PATCH] Support for alternative kernel profiler in a module Luck, Tony
` (2 preceding siblings ...)
2002-01-10 19:27 ` David Mosberger
@ 2002-01-10 23:26 ` Luck, Tony
2002-01-10 23:37 ` David Mosberger
4 siblings, 0 replies; 6+ messages in thread
From: Luck, Tony @ 2002-01-10 23:26 UTC (permalink / raw)
To: linux-ia64
We don't currently have any way for different software packages
to share the performance counters, so it's very likely that there
would be interactions with Stephane's PMU code (e.g. I rewrite
cr.pmv to a new vector and re-write all of the pmc[] and pmd[]
registers for my own purposes ... this will upset Stephane's code,
similarly my code does not expect anyone else to touch any PMU
registers, or fiddle with psr.pp/dcr.pp).
It would probably be safest to turn off CONFIG_PERFMON in a kernel
that is going to load an alternate profiler ... my profiler seems
to cope ok provided nobody calls sys_perfmonctl().
-Tony
David Mosberger wrote:
> I'd like Stephane to take a look at this patch and see whether there
> are any potential bad interactions with the PMU code he is working on
> (due to the manipulation of the psr.pp bit). Other than that, the
> patch looks good to me.
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [Linux-ia64] [PATCH] Support for alternative kernel profiler
2002-01-05 1:03 [Linux-ia64] [PATCH] Support for alternative kernel profiler in a module Luck, Tony
` (3 preceding siblings ...)
2002-01-10 23:26 ` Luck, Tony
@ 2002-01-10 23:37 ` David Mosberger
4 siblings, 0 replies; 6+ messages in thread
From: David Mosberger @ 2002-01-10 23:37 UTC (permalink / raw)
To: linux-ia64
>>>>> On Thu, 10 Jan 2002 15:26:58 -0800, "Luck, Tony" <tony.luck@intel.com> said:
Tony> We don't currently have any way for different software
Tony> packages to share the performance counters, so it's very
Tony> likely that there would be interactions with Stephane's PMU
Tony> code (e.g. I rewrite cr.pmv to a new vector and re-write all
Tony> of the pmc[] and pmd[] registers for my own purposes ... this
Tony> will upset Stephane's code, similarly my code does not expect
Tony> anyone else to touch any PMU registers, or fiddle with
Tony> psr.pp/dcr.pp).
Tony> It would probably be safest to turn off CONFIG_PERFMON in a
Tony> kernel that is going to load an alternate profiler ... my
Tony> profiler seems to cope ok provided nobody calls
Tony> sys_perfmonctl().
This hardly seems like an ideal solution. If you just want to keep
your patch for yourself, that's probably OK, but if it is to become
part of the kernel, we should look into a way for safely sharing the
PMU. The first obvious way to try is to do the profiling you want on
top of perfmon.
--david
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-01-10 23:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-05 1:03 [Linux-ia64] [PATCH] Support for alternative kernel profiler in a module Luck, Tony
2002-01-09 21:37 ` [Linux-ia64] [PATCH] Support for alternative kernel profiler Luck, Tony
2002-01-10 19:25 ` David Mosberger
2002-01-10 19:27 ` David Mosberger
2002-01-10 23:26 ` Luck, Tony
2002-01-10 23:37 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox