From: Namhyung Kim <namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
Cc: Richard Cochran
<richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Steven Rostedt <rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org>,
Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Paul Mackerras <paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
Arnaldo Carvalho de Melo
<acme-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"linux-kernel@vger.kernel.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-api@vger.kernel.org"
<linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v2 2/2] perf: Userspace event
Date: Fri, 26 Sep 2014 15:23:02 +0900 [thread overview]
Message-ID: <87tx3uj3y1.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1411649105.4768.48.camel@hornet> (Pawel Moll's message of "Thu, 25 Sep 2014 13:45:05 +0100")
On Thu, 25 Sep 2014 13:45:05 +0100, Pawel Moll wrote:
> On Wed, 2014-09-24 at 07:07 +0100, Namhyung Kim 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.
>
> You're right. I needed a different SW type in one of my early
> prototypes, but it's not the case any more. Consider it gone.
Okay.
>
>> 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.
>
> Fine with me. If no one objects, I'm more than happy to use
> PERF_RECORD_UEVENT = 11 for it.
>
>> 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.
>
> Are you saying to drop even the "type 0 means zero-terminated string"
> definition, even if everything else is up to the user? I quite like that
> idea, especially combined with write()ing to the perf_fd (it is very
> much like trace_marker then, which is beautiful in its simplicity), but
> the feelings are not that strong to fight a war over it.
:)
Thanks,
Namhyung
WARNING: multiple messages have this Message-ID (diff)
From: Namhyung Kim <namhyung@kernel.org>
To: Pawel Moll <pawel.moll@arm.com>
Cc: Richard Cochran <richardcochran@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Paul Mackerras <paulus@samba.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
John Stultz <john.stultz@linaro.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-api\@vger.kernel.org" <linux-api@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] perf: Userspace event
Date: Fri, 26 Sep 2014 15:23:02 +0900 [thread overview]
Message-ID: <87tx3uj3y1.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1411649105.4768.48.camel@hornet> (Pawel Moll's message of "Thu, 25 Sep 2014 13:45:05 +0100")
On Thu, 25 Sep 2014 13:45:05 +0100, Pawel Moll wrote:
> On Wed, 2014-09-24 at 07:07 +0100, Namhyung Kim 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.
>
> You're right. I needed a different SW type in one of my early
> prototypes, but it's not the case any more. Consider it gone.
Okay.
>
>> 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.
>
> Fine with me. If no one objects, I'm more than happy to use
> PERF_RECORD_UEVENT = 11 for it.
>
>> 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.
>
> Are you saying to drop even the "type 0 means zero-terminated string"
> definition, even if everything else is up to the user? I quite like that
> idea, especially combined with write()ing to the perf_fd (it is very
> much like trace_marker then, which is beautiful in its simplicity), but
> the feelings are not that strong to fight a war over it.
:)
Thanks,
Namhyung
next prev parent reply other threads:[~2014-09-26 6:23 UTC|newest]
Thread overview: 28+ 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
[not found] ` <1411491787-25938-2-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2014-09-24 5:41 ` Namhyung Kim
2014-09-24 5:41 ` Namhyung Kim
[not found] ` <87sijhk21x.fsf-vfBCOVm4yAnB69T4xOojN9BPR1lH4CV8@public.gmane.org>
2014-09-25 10:49 ` Pawel Moll
2014-09-25 10:49 ` Pawel Moll
2014-09-26 6:16 ` Namhyung Kim
2014-09-26 6:16 ` Namhyung Kim
[not found] ` <8738bekith.fsf-vfBCOVm4yAnB69T4xOojN9BPR1lH4CV8@public.gmane.org>
2014-09-26 10:58 ` Pawel Moll
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-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
[not found] ` <1411491787-25938-3-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org>
2014-09-24 6:07 ` Namhyung Kim
2014-09-24 6:07 ` Namhyung Kim
[not found] ` <87oau5k0u9.fsf-vfBCOVm4yAnB69T4xOojN9BPR1lH4CV8@public.gmane.org>
2014-09-24 7:20 ` Ingo Molnar
2014-09-24 7:20 ` Ingo Molnar
[not found] ` <20140924072017.GC990-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-26 6:21 ` Namhyung Kim
2014-09-26 6:21 ` Namhyung Kim
2014-09-26 10:59 ` Pawel Moll
2014-09-26 11:24 ` Ingo Molnar
2014-09-26 11:24 ` Ingo Molnar
2014-09-25 12:45 ` Pawel Moll
2014-09-26 6:23 ` Namhyung Kim [this message]
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=87tx3uj3y1.fsf@sejong.aot.lge.com \
--to=namhyung-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=acme-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=rostedt-nx8X9YLhiw1AfugRpC6u6w@public.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 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.