mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Ingo Molnar <public-mingo-DgEjT+Ai2ygdnm+yROfE0A@plane.gmane.org>
Cc: Namhyung Kim 
	<public-namhyung-DgEjT+Ai2ygdnm+yROfE0A@plane.gmane.org>,
	Pawel Moll <public-pawel.moll-5wv7dgnIgG8@plane.gmane.org>,
	Richard Cochran 
	<public-richardcochran-Re5JQEeQqe8AvxtiuMwx3w@plane.gmane.org>,
	Steven Rostedt 
	<public-rostedt-nx8X9YLhiw1AfugRpC6u6w@plane.gmane.org>,
	Ingo Molnar <public-mingo-H+wXaHxf7aLQT0dZR+AlfA@plane.gmane.org>,
	Peter Zijlstra 
	<public-peterz-wEGCiKHe2LqWVfeAwA7xHQ@plane.gmane.org>,
	Paul Mackerras 
	<public-paulus-eUNUBHrolfbYtjvyW6yDsg@plane.gmane.org>,
	Arnaldo Carvalho de Melo 
	<public-acme-DgEjT+Ai2ygdnm+yROfE0A@plane.gmane.org>,
	John Stultz 
	<public-john.stultz-QSEj5FYQhm4dnm+yROfE0A@plane.gmane.org>,
	public-linux-kernel-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org,
	public-linux-api-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org
Subject: Re: [PATCH v2 2/2] perf: Userspace event
Date: Fri, 26 Sep 2014 15:21:26 +0900	[thread overview]
Message-ID: <87y4t6j40p.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20140924072017.GC990@gmail.com> (Ingo Molnar's message of "Wed, 24 Sep 2014 09:20:17 +0200")



Hi Ingo,

On Wed, 24 Sep 2014 09:20:17 +0200, Ingo Molnar wrote:
> * Namhyung Kim <namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>
>> On Tue, 23 Sep 2014 18:03:07 +0100, Pawel Moll wrote:
>> > This patch adds a new PERF_COUNT_SW_UEVENT software event
>> > and a related PERF_SAMPLE_UEVENT sample. User can now
>> > write to the the perf file descriptor, injecting such
>> > event in the perf buffer.
>> 
>> It seems the PERF_SAMPLE_UEVENT sample can be injected to any event.  So
>> why the PERF_COUNT_SW_UEVENT is needed?  At least one can use the
>> SW_DUMMY event for that purpose.
>> 
>> Also I think it'd be better to be a record type (PERF_RECORD_XXX)
>> instead of a sample flag (PERF_SAMPLE_XXX).  In perf tools, we already
>> use perf_user_event_type for synthesized userspace events.  This way it
>> can avoid unnecessary sample processing for userspace events.
>> 
>> For contents, I prefer to give complete control to users - kernel
>> doesn't need to care about it other than its size.  If one just wants to
>> use strings only, she can write them directly.  If others want to mix
>> different types of data, they might need to define a data format for
>> their use.
>
> It would also be nice to add support for this to tools/perf/ (so 
> that 'trace' displays such entries in a perf.data), with a 
> minimum testcase for 'perf test' as well.
>
> Perhaps also add a small sub-utility to inject such events from 
> the command line, such as:
>
>   trace user-event "this is a test message"
>
> ('trace' is a shortcut command for 'perf trace'.)
>
> It would have a usecase straight away: perf could be used to 
> easily trace script execution for example.

It looks like what trace-marker in ftrace does..  We might connect
output of the trace marker into a perf event somehow.

Thanks,
Namhyung


>
> For that probably another mode of user event generation would be 
> needed as well: a process that has no access to any perf fds 
> should still be able to generate user events, if the 
> profiling/tracing context has permitted that. In this case we'd 
> inject the event either into the first, or all currently active 
> events (but only once per output buffer, or so).
>
> Thanks,
>
> 	Ingo


  reply	other threads:[~2014-09-26  6:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 17:03 [PATCH v2 0/2] perf: User/kernel time correlation and event generation Pawel Moll
2014-09-23 17:03 ` [PATCH v2 1/2] perf: Add sampling of the raw monotonic clock Pawel Moll
2014-09-24  5:41   ` Namhyung Kim
2014-09-25 10:49     ` Pawel Moll
2014-09-26  6:16       ` Namhyung Kim
2014-09-26 10:58         ` Pawel Moll
2014-09-26 14:38           ` Namhyung Kim
2014-09-26 15:05             ` Pawel Moll
2014-09-26 19:25               ` David Ahern
2014-09-29 14:47                 ` Pawel Moll
2014-09-23 17:03 ` [PATCH v2 2/2] perf: Userspace event Pawel Moll
2014-09-24  6:07   ` Namhyung Kim
2014-09-24  7:20     ` Ingo Molnar
2014-09-26  6:21       ` Namhyung Kim [this message]
2014-09-26 10:59         ` Pawel Moll
2014-09-26 11:24           ` Ingo Molnar
2014-09-25 12:45     ` Pawel Moll
2014-09-26  6:23       ` Namhyung Kim

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=87y4t6j40p.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=public-acme-DgEjT+Ai2ygdnm+yROfE0A@plane.gmane.org \
    --cc=public-john.stultz-QSEj5FYQhm4dnm+yROfE0A@plane.gmane.org \
    --cc=public-linux-api-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org \
    --cc=public-linux-kernel-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org \
    --cc=public-mingo-DgEjT+Ai2ygdnm+yROfE0A@plane.gmane.org \
    --cc=public-mingo-H+wXaHxf7aLQT0dZR+AlfA@plane.gmane.org \
    --cc=public-namhyung-DgEjT+Ai2ygdnm+yROfE0A@plane.gmane.org \
    --cc=public-paulus-eUNUBHrolfbYtjvyW6yDsg@plane.gmane.org \
    --cc=public-pawel.moll-5wv7dgnIgG8@plane.gmane.org \
    --cc=public-peterz-wEGCiKHe2LqWVfeAwA7xHQ@plane.gmane.org \
    --cc=public-richardcochran-Re5JQEeQqe8AvxtiuMwx3w@plane.gmane.org \
    --cc=public-rostedt-nx8X9YLhiw1AfugRpC6u6w@plane.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome