Re: [PATCH] oprofile: disable write access to oprofilefs whileprofiler is running

From: Robert Richter
Date: Tue Oct 12 2010 - 11:34:13 EST


On 05.10.10 06:36:57, Robert Richter wrote:
> 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.
>
> Cc: Maynard Johnson <maynardj@xxxxxxxxxx>
> Cc: William Cohen <wcohen@xxxxxxxxxx>
> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
> Signed-off-by: Robert Richter <robert.richter@xxxxxxx>
> ---
> drivers/oprofile/oprof.c | 19 +++++--------------
> drivers/oprofile/oprof.h | 2 +-
> drivers/oprofile/oprofile_files.c | 7 +++++--
> drivers/oprofile/oprofilefs.c | 8 ++++++--
> 4 files changed, 17 insertions(+), 19 deletions(-)

I applied the patch to oprofile/core. Maynard, thanks for review.

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/