linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Covington <cov@codeaurora.org>
To: Luke Gorrie <luke@snabb.co>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: Signal on PMU event?
Date: Mon, 21 Apr 2014 10:29:36 -0400	[thread overview]
Message-ID: <53552B50.7080508@codeaurora.org> (raw)
In-Reply-To: <CAA2XHbfJdXBzxF8=FCpBv5pM76XOPBY5av5np0dNkr4CYU0Jrg@mail.gmail.com>

Hi Luke,

On 04/20/2014 02:45 PM, Luke Gorrie wrote:
> Howdy!
> 
> Is it possible for a self-profiling program to receive a signal (e.g.
> SIGPROF) driven by a chosen PMU event (e.g. cache-misses, etc)?
> 
> I'm using a SIGITIMER-driven profiler (LuaJIT's one) and it would be
> wonderfully convenient to be able to switch the event source while
> keeping the signal-driven flow.

It is possible to receive a SIGIO after a specified number of events. You have
to be careful to set the sample_period, watermark, and wakeup_events or
wakeup_watermark attributes and set the asynchronous flag on the resulting
file descriptor (always setting the owner may be required as well) for it to
work. You can find an example in perf_event_tests [1].

1.
https://github.com/deater/perf_event_tests/blob/master/tests/overflow/wakeup_events_overflow.c

Regards,
Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.

  reply	other threads:[~2014-04-21 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-20 18:45 Signal on PMU event? Luke Gorrie
2014-04-21 14:29 ` Christopher Covington [this message]
2014-04-21 14:41   ` Luke Gorrie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53552B50.7080508@codeaurora.org \
    --to=cov@codeaurora.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=luke@snabb.co \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).