Messages in this thread | | | Date | Fri, 08 Jul 2005 12:23:34 -0700 (PDT) | Subject | Re: Instruction Tracing for Linux | From | "David S. Miller" <> |
| |
From: Andi Kleen <ak@suse.de> Date: 08 Jul 2005 21:11:03 +0200
> While some CPUs (like Intel P4) have ways to do such hardware > tracing I know of no free tool that uses it. There are some user > space tools to collect at user space, but they probably won't help you.
FWIW, even without explicit tracing support in the CPU it is possible to get these kinds of traces nontheless.
One great example is how they did this on Sparc sun4d machines at Sun using SKY which was written by Gordon Irlam. You can read about it at:
http://www.base.com/gordoni/sky.html
Basically, the "simulator" would take advantage of Sparc's delay slot branching to explicitly execute one instruction from the kernel's code stream at a time.
So it would branch to the kernel's current PC, and in the delay slot branch back into the simulator.
The only special case is that it needs two temporary registers, global registers %g2 and %g3, to pull off this trick. So if the instruction needed to actually use either register %g2 or %g3, it was emulated in software instead of actually being executed. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |