Skip to content

: Improved 'NMI' oprofile profiling support.

David Miller sparclinux 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6: sparc64: Add interface for registering a performancearch/sparc/include/asm/irq_64.h arch/sparc64/kernel/irq.c arch/sparc64/kernel/ttable.S+67 -10 replies
2/6: sparc64: Make %pil level 15 a pseudo-NMI.arch/sparc/include/asm/irqflags_64.h arch/sparc/include/asm/pil.h arch/sparc/include/asm/ttable.h +9 more+46 -250 replies
3/6: sparc64: Make special trap return path for TRAP_NMI().arch/sparc/include/asm/ttable.h arch/sparc64/kernel/rtrap.S+14 -20 replies
4/6: sparc64: Block NMIs in critical section of contextarch/sparc/include/asm/system_64.h+2 -00 replies
5/6: sparc64: Add write_pic() helper.arch/sparc/include/asm/system_64.h+5 -40 replies
6/6: sparc64: Use NMI oprofile profiling on cheetah andarch/sparc/oprofile/init.c+109 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6]: Improved 'NMI' oprofile profiling support.

Basically what happens right now on sparc64 with oprofile is that as soon as a code path turns off cpu interrupts (by writing 15 into the %pil register) nothing in that code block can take profiling hits since we use the simple timer interrupt for oprofile support.

These next 6 patches do a few things to improve that situation:

1) We run the kernel at %pil 0 and 14 normally. This turns %pil level 15 into a pseudo-NMI for profiling.

2) An interface is created to register handlers for the level 15 interrupt, for profiling counter overflows on cpus that have it. (Basically, UltraSPARC-III and later)

3) Finally, for now on only UltraSPARC-III and derivative chips, we use the profiling counters as a 'nmi' timer for oprofile.

As a result, when this stuff is enabled, code sequences run with interrupts disabled are profiled fully. This gets us on-par with x86 which has had a real hardware NMI profiling handler forever.

I'll add sun4v cpu support for this in a bit. The code is simple, I just want to test it properly.

All of this code is commited to sparc-next-2.6