]> git.baikalelectronics.ru Git - kernel.git/commit
oprofile: disable write access to oprofilefs while profiler is running
authorRobert Richter <robert.richter@amd.com>
Mon, 4 Oct 2010 19:09:36 +0000 (21:09 +0200)
committerRobert Richter <robert.richter@amd.com>
Tue, 12 Oct 2010 15:25:06 +0000 (17:25 +0200)
commitab1c58775384ec5064b0f2425b77ac151ac05e6e
tree52782cc1d78c24030d627f719cdaa29846c42efb
parent59fccd5e092b5449e927a4ff1aa0319e4380856a
oprofile: disable write access to oprofilefs while profiler is running

Oprofile counters are setup when profiling is disabled. Thus, writing
to oprofilefs has no immediate effect. Changes are updated only after
oprofile is reenabled.

To keep userland and kernel states synchronized, we now allow
configuration of oprofile only if profiling is disabled.  In this case
it checks if the profiler is running and then disables write access to
oprofilefs by returning -EBUSY. The change should be backward
compatible with current oprofile userland daemon.

Acked-by: Maynard Johnson <maynardj@us.ibm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
drivers/oprofile/oprof.c
drivers/oprofile/oprof.h
drivers/oprofile/oprofile_files.c
drivers/oprofile/oprofilefs.c