| Age | Commit message (Collapse) | Author |
|
profile_hook unconditionally takes a read lock on profile_lock if kernel
profiling is enabled. The lock protects the profile_hook notifier chain
from being written while it's being called. The routine profile_hook is
called in a very hot path though: every timer tick on every CPU. As you
can imagine, on a large system, this makes the cacheline containing
profile_lock pretty hot. Since oprofile was the only user of the
profile_hook, I removed the notifier chain altogether in favor of a simple
function pointer with the help of John Levon. This removes all of the
contention in the hot path since the variable is very seldom written and
simplifies things a little to boot.
Acked-by: John Levon <levon@movementarian.org>
Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Anton prompted me to get this patch merged. It changes the core buffer
sync algorithm of OProfile to avoid global locks wherever possible. Anton
tested an earlier version of this patch with some success. I've lightly
tested this applied against 2.6.8.1-mm3 on my two-way machine.
The changes also have the happy side-effect of losing less samples after
munmap operations, and removing the blind spot of tasks exiting inside the
kernel.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Make the various bits of state no longer used anywhere else static to
kernel/profile.c
Signed-off-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
proc_misc.c is a trainwreck. Move the file_operations for /proc/profile into
kernel/profile.c and call the profiling setup via initcall.
Signed-off-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
With prof_cpu_mask and profile_pc() in hand, the core is now able to perform
all the profile accounting work on behalf of arches. Consolidate the profile
accounting and convert all arches to call the core function.
Signed-off-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Handling of prof_cpu_mask is grossly inconsistent. Some arches have it as a
cpumask_t, others unsigned long, and even within arches it's treated
inconsistently. This makes it cpumask_t across the board, and consolidates
the handling in kernel/profile.c
Signed-off-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Needs a forward declaration of struct pt_regs
|
|
The below has been in -mm for a while, and has been tested on my UP
and 2-way machines.
OProfile was completely unsafe on UP - a spinlock is no protection
against the NMI arriving and putting data into the buffer. Pretty stupid
bug. This fixes it by implementing reader/writer windows in the buffer
and removing the lock altogether. This patch was originally done by Will
Cohen.
It also fixes the oops Dave Hansen saw on 2.5.62 SMP
|
|
Patch from Nikita Danilov <Nikita@Namesys.COM>
this moves functions from identical per-architecture
arch/*/kernel/profile.c into generic kernel/profile.c. Also, identical
{x86,parisc,ppc64,sparc64}_profile_hook()'s are all replaced by the
single kernel/profile.c:profile_hook(), which is #defined to noop in
include/linux/profile.h if CONFIG_PROFILING is not set.
|
|
Patch from Ravikiran G Thirumalai <kiran@in.ibm.com>
Allows the kernel profiler to use a shift value of zero for
high-resolution profiling.
So instead of overloading a shift of zero to mean "not profiling", use
a separate flag for that.
This means that anyone who is currently using "profile=0" to disable
profiling has accidentally turned profiling on, so I added a printk.
|
|
This implements a simple hook into the profiling timer for x86 so that
non-perfctr machines can still use oprofile. This has proven useful for
laptops and the like.
It also reduces header dependencies a bit by centralising readprofile
code
|
|
This implements the simple hooks we need to catch unmappings, and to
make sure no stale task_struct*'s are ever used by the main oprofile
core mechanism. If disabled, it compiles to nothing.
|