From: Milind Chabbi <chabbi.milind@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Milind Chabbi <chabbi.milind@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Namhyung Kim <namhyung@kernel.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Andi Kleen <ak@linux.intel.com>,
Hari Bathini <hbathini@linux.vnet.ibm.com>,
Jin Yao <yao.jin@linux.intel.com>,
Kan Liang <kan.liang@intel.com>,
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf/core: fast breakpoint modification via _IOC_MODIFY_BREAKPOINT.
Date: Tue, 7 Nov 2017 07:43:35 -0800 [thread overview]
Message-ID: <CAMmz+Yks+gqSwvSd6i-_somNy7+Gsqdz7xfAjpqZ3Enha31dJQ@mail.gmail.com> (raw)
In-Reply-To: <20171107081457.GE3326@worktop>
Peter,
Generic update perf_event_attr interface is noble but impractical.
It will cause a validation nightmare.
Many of the behaviors or choices will become hard to reason.
If somebody changes "sample_period"
it is unclear what to do it the number of samples collected so far
exceeds the newly configured N events.
If somebody changes sample_type, the type of data recorded in the
mmap ring buffer will be a mix of two (or more) different kinds of data,
which make it untenable.
Uncommon but possible: somebody may like to change the "type" itself.
The list goes on.
When you proposed generic update perf_event_attr interface, do you have
a clear use case in mind with measured performance impact? If so, one
can consider that path, which is an entirely different project. I believe
your proposal is to introduce a new system call perf_event_update_attr().
The changes proposed in the patch are motivated by a clear use case
with a clear performance impact. Changing the address monitored by
a breakpoint is a common operation by profilers, and hence it need not
go through the whole process of unmapping the ring buffer, closing the fd,
re-opening a perf event and remapping the ring buffer.
-Milind
On Tue, Nov 7, 2017 at 12:14 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Mon, Nov 06, 2017 at 05:09:15PM -0500, Milind Chabbi wrote:
> > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> > index 362493a..d458214 100644
> > --- a/include/uapi/linux/perf_event.h
> > +++ b/include/uapi/linux/perf_event.h
> > @@ -433,6 +433,8 @@ struct perf_event_attr {
> > #define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *)
> > #define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32)
> > #define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32)
> > +#define PERF_EVENT_IOC_MODIFY_BREAKPOINT \
> > + _IOW('$', 10, struct perf_event_attr *)
>
>
> I really hate this thing. I would much rather see a more generic update
> perf_event_attr interface. Where we allow modifying some of the
> perf_event_attr fields.
next prev parent reply other threads:[~2017-11-07 15:43 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-06 22:09 [PATCH] perf/core: fast breakpoint modification via _IOC_MODIFY_BREAKPOINT Milind Chabbi
2017-11-06 23:16 ` Andi Kleen
2017-11-07 8:15 ` Peter Zijlstra
2017-11-07 17:09 ` Andi Kleen
2017-11-07 8:14 ` Peter Zijlstra
2017-11-07 15:43 ` Milind Chabbi [this message]
2017-11-07 17:24 ` Andi Kleen
2017-11-07 17:42 ` Milind Chabbi
2017-11-07 19:01 ` Peter Zijlstra
2017-11-07 19:31 ` Milind Chabbi
2017-11-08 13:35 ` kbuild test robot
2017-11-08 13:51 ` kbuild test robot
[not found] <CAMmz+YnaoN3-7DN5WysQvhWNyGhM7_WDz5AQAnvP6FO_GMnMgw@mail.gmail.com>
2017-11-06 15:03 ` Arnaldo Carvalho de Melo
[not found] <CAMmz+Y=Py0dw63tuww+Oa4rWi_Hghhs3DHmNX=Tf1Yt_JH4O+Q@mail.gmail.com>
2017-11-06 9:23 ` Jiri Olsa
[not found] ` <CAMmz+YkB955Na6wOMmgqZX_TxqsBh86FiLi8EXmOrg1vwm-fGA@mail.gmail.com>
2017-11-08 14:15 ` Jiri Olsa
2017-11-08 15:02 ` Milind Chabbi
2017-11-08 15:12 ` Jiri Olsa
2017-11-08 15:51 ` Milind Chabbi
2017-11-08 15:57 ` Jiri Olsa
2017-11-08 16:59 ` Milind Chabbi
2017-11-09 7:52 ` Jiri Olsa
2017-11-09 13:12 ` Jiri Olsa
2017-11-09 18:59 ` Milind Chabbi
2017-11-12 19:09 ` Milind Chabbi
2017-11-13 7:46 ` Jiri Olsa
2017-11-13 8:02 ` Milind Chabbi
2017-11-26 19:31 ` Jiri Olsa
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=CAMmz+Yks+gqSwvSd6i-_somNy7+Gsqdz7xfAjpqZ3Enha31dJQ@mail.gmail.com \
--to=chabbi.milind@gmail.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=hbathini@linux.vnet.ibm.com \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=sukadev@linux.vnet.ibm.com \
--cc=yao.jin@linux.intel.com \
/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).