From: Peter Zijlstra <peterz@infradead.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>, Dave Jones <davej@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] perf: Differentiate exec() and non-exec() comm events
Date: Wed, 28 May 2014 11:53:08 +0200 [thread overview]
Message-ID: <20140528095308.GS11096@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <5385A7A9.80702@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1893 bytes --]
On Wed, May 28, 2014 at 12:08:57PM +0300, Adrian Hunter wrote:
> On 05/28/2014 11:55 AM, Peter Zijlstra wrote:
> > On Wed, May 28, 2014 at 11:45:04AM +0300, Adrian Hunter wrote:
> >> perf tools like 'perf report' can aggregate samples by comm
> >> strings, which generally works. However, there are other
> >> potential use-cases. For example, to pair up 'calls'
> >> with 'returns' accurately (from branch events like Intel BTS)
> >> it is necessary to identify whether the process has exec'd.
> >> Although a comm event is generated when an 'exec' happens
> >> it is also generated whenever the comm string is changed
> >> on a whim (e.g. by prctl PR_SET_NAME). This patch adds a
> >> flag to the comm event to differentiate one case from the
> >> other.
> >>
> >> In order to determine whether the kernel supports the new
> >> flag, a selection bit named 'exec' is added to struct
> >> perf_event_attr. The bit does nothing but will cause
> >> perf_event_open() to fail if the bit is set on kernels
> >> that do not have it defined.
> >>
> >
> >> --- a/include/uapi/linux/perf_event.h
> >> +++ b/include/uapi/linux/perf_event.h
> >> @@ -302,8 +302,8 @@ struct perf_event_attr {
> >> exclude_callchain_kernel : 1, /* exclude kernel callchains */
> >> exclude_callchain_user : 1, /* exclude user callchains */
> >> mmap2 : 1, /* include mmap with inode data */
> >> -
> >> - __reserved_1 : 40;
> >> + exec : 1, /* flag comm events that are due to an exec */
> >> + __reserved_1 : 39;
> >>
> >
> > Yah.. that's just sad :-(
> >
> > the only capabilities mask we have is in the mmap() page, so without
> > mmap()ing we have no way to test that.
> >
> > Would it make sense to call it comm_exec?
>
> Yes, that is better. Do you want me to resend the patch?
Nah, I'll frob it. Thanks!
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-05-28 9:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 8:45 [PATCH] perf: Differentiate exec() and non-exec() comm events Adrian Hunter
2014-05-28 8:55 ` Peter Zijlstra
2014-05-28 9:08 ` Adrian Hunter
2014-05-28 9:53 ` Peter Zijlstra [this message]
2014-06-05 9:56 ` Ingo Molnar
2014-06-05 9:58 ` Ingo Molnar
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=20140528095308.GS11096@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=davej@redhat.com \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.