Re: [PATCH] oprofile: check whether oprofile perf enabled in op_overflow_handler()

From: Will Deacon
Date: Tue Feb 11 2014 - 13:06:07 EST


On Tue, Feb 11, 2014 at 03:52:07PM +0000, Will Deacon wrote:
> On Tue, Feb 11, 2014 at 04:33:51AM +0000, Weng Meiling wrote:
> > Is there any progress on this work? Because this is important for me.
> > Sorry for trouble you.
>
> Oops, I totally forgot about this. Does the below patch work for you?

[...]

> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 56003c6edfd3..6fcc293d77a4 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -237,6 +237,8 @@ void perf_sample_event_took(u64 sample_len_ns)
> u64 local_samples_len;
> u64 allowed_ns = ACCESS_ONCE(perf_sample_allowed_ns);
>
> + pr_info("perf_sample_event_took(%llu ns)\n", sample_len_ns);
> +
> if (allowed_ns == 0)
> return;

Ignore this hunk, it was there as a debugging aid. Testing the other half of
the patch would be useful though!

Will
--
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/