From: Werner Almesberger <wa@almesberger.net>
To: linuxppc-dev@lists.linuxppc.org
Subject: performance monitor exceptions
Date: Mon, 11 Feb 2002 23:37:30 +0100 [thread overview]
Message-ID: <20020211233730.E5079@almesberger.net> (raw)
Hi,
I'm banging my head at a problem with exceptions. What I want to
do is to get the performance monitor to give me exceptions at
roughly 1 kHz, to drive the kernel profiler. The problem is that
my changes usually kill the system within a few minutes :-(
I'm quite new to the PPC, so I'll include a bit more details, in
case I made some trivial mistake. My kernel is 2.4.17, my CPU is a
MPC7410.
First of all, I changed the vector to:
. = 0xf00
b PerformanceMonitor
Then, I added a tiny little handler that does nothing but re-enable
the PE exception. For getting a register, I mimicked EXCEPTION_PROLOG:
PerformanceMonitor:
// 955 is SIAR
mtspr 955,r20
mfspr r20,SPRN_MMCR0
oris r20,r20,MMCR0_PMXE@h
mtspr SPRN_MMCR0,r20
mfspr r20,955
SYNC
RFI
And then I added of course a bit of code to enable all this:
int __init setup_perf_mon(void)
{
unsigned long flags;
local_irq_save(flags);
local_irq_disable();
/* ca. 3 kHz */
mtspr(SPRN_MMCR0,(mfspr(SPRN_MMCR0) & ~MMCR0_TBSEL_MASK) |
MMCR0_PMXE | (MMCR0_TBSEL_TBL15 << MMCR0_TBSEL_SHIFT) | MMCR0_TBEE);
local_irq_restore(flags);
return 0;
}
It seems to work (I had a handler there that does something a little
more useful), but when I start kernel builds, I get a dead system
(rebooted by hardware watchdog) within a few minutes.
Instead of SIAR, I also tried SPRG0 and SPRG1, but got exactly the
same behaviour. Time to crash varies from one to ten minutes. The
time increases proportionally if I use TLB[19] (~200 Hz) instead.
Any ideas of what I could be trampling over (or be trampled over
by) ? This code seems rather bullet-proof to me, and I don't think
anything else is using SIAR, or could change it while I'm using it.
Thanks,
- Werner
--
_________________________________________________________________________
/ Werner Almesberger, Lausanne, CH wa@almesberger.net /
/_http://icawww.epfl.ch/almesberger/_____________________________________/
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next reply other threads:[~2002-02-11 22:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-11 22:37 Werner Almesberger [this message]
2002-02-12 12:55 ` performance monitor exceptions benh
2002-02-12 18:33 ` Werner Almesberger
2002-02-13 11:14 ` Anton Blanchard
2002-02-13 12:48 ` benh
2002-02-13 19:01 ` G4 boot crash problems with 2.4 "stable" David A. Gatwood
2002-02-13 19:07 ` benh
2002-02-13 21:09 ` David A. Gatwood
2002-02-13 21:06 ` Benjamin Herrenschmidt
2002-02-13 23:48 ` Ethan Benson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020211233730.E5079@almesberger.net \
--to=wa@almesberger.net \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.