Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-16 Thread Ingo Molnar
* Pawel Moll wrote: > On Tue, 2014-09-16 at 08:44 +0100, Ingo Molnar wrote: > > I think adding an ioctl to inject user-provided data into the > > event stream is sensible, as long as there's a separate 'user > > generated data' event for it, etc. > > > > The main usecase I could see would be

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-16 Thread Pawel Moll
On Tue, 2014-09-16 at 08:44 +0100, Ingo Molnar wrote: > I think adding an ioctl to inject user-provided data into the > event stream is sensible, as long as there's a separate 'user > generated data' event for it, etc. > > The main usecase I could see would be to introduce a > perf_printf()

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-16 Thread Pawel Moll
On Mon, 2014-09-15 at 19:31 +0100, Arnaldo Carvalho de Melo wrote: > Em Mon, Sep 15, 2014 at 06:27:14PM +0100, Pawel Moll escreveu: > > On Fri, 2014-09-12 at 17:19 +0100, Arnaldo Carvalho de Melo wrote: > > > Em Fri, Sep 12, 2014 at 02:58:55PM +0100, Pawel Moll escreveu: > > > > On Fri, 2014-09-12

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-16 Thread Ingo Molnar
* David Ahern wrote: > On 9/12/14, 2:44 PM, Arnaldo Carvalho de Melo wrote: > >Em Fri, Sep 12, 2014 at 10:37:39AM -0700, David Ahern escreveu: > >>On 9/12/14, 4:48 AM, Pawel Moll wrote: > >>>This patch adds a PERF_COUNT_SW_MARKER event type, which > >>>can be requested by user and a

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-16 Thread Ingo Molnar
* David Ahern dsah...@gmail.com wrote: On 9/12/14, 2:44 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Sep 12, 2014 at 10:37:39AM -0700, David Ahern escreveu: On 9/12/14, 4:48 AM, Pawel Moll wrote: This patch adds a PERF_COUNT_SW_MARKER event type, which can be requested by user and a

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-16 Thread Pawel Moll
On Mon, 2014-09-15 at 19:31 +0100, Arnaldo Carvalho de Melo wrote: Em Mon, Sep 15, 2014 at 06:27:14PM +0100, Pawel Moll escreveu: On Fri, 2014-09-12 at 17:19 +0100, Arnaldo Carvalho de Melo wrote: Em Fri, Sep 12, 2014 at 02:58:55PM +0100, Pawel Moll escreveu: On Fri, 2014-09-12 at 14:49

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-16 Thread Pawel Moll
On Tue, 2014-09-16 at 08:44 +0100, Ingo Molnar wrote: I think adding an ioctl to inject user-provided data into the event stream is sensible, as long as there's a separate 'user generated data' event for it, etc. The main usecase I could see would be to introduce a perf_printf() variant,

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-16 Thread Ingo Molnar
* Pawel Moll pawel.m...@arm.com wrote: On Tue, 2014-09-16 at 08:44 +0100, Ingo Molnar wrote: I think adding an ioctl to inject user-provided data into the event stream is sensible, as long as there's a separate 'user generated data' event for it, etc. The main usecase I could see

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-15 Thread Arnaldo Carvalho de Melo
Em Mon, Sep 15, 2014 at 06:27:14PM +0100, Pawel Moll escreveu: > On Fri, 2014-09-12 at 17:19 +0100, Arnaldo Carvalho de Melo wrote: > > Em Fri, Sep 12, 2014 at 02:58:55PM +0100, Pawel Moll escreveu: > > > On Fri, 2014-09-12 at 14:49 +0100, Arnaldo Carvalho de Melo wrote: > > > > Perhaps both? I.e.

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-15 Thread Pawel Moll
On Fri, 2014-09-12 at 17:19 +0100, Arnaldo Carvalho de Melo wrote: > Em Fri, Sep 12, 2014 at 02:58:55PM +0100, Pawel Moll escreveu: > > On Fri, 2014-09-12 at 14:49 +0100, Arnaldo Carvalho de Melo wrote: > > > Perhaps both? I.e. an u64 followed from a string, if the u64 is zero, > > > then there is

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-15 Thread Pawel Moll
On Sun, 2014-09-14 at 16:43 +0100, David Ahern wrote: > >> Seems really similar to what I proposed in the past: Yeah, it wasn't really hard to come with similar conclusions :-) > >> https://lkml.org/lkml/2011/2/27/159 > >> > >> Which was rejected. > > > > I took a look at that thread, but just

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-15 Thread Pawel Moll
On Sun, 2014-09-14 at 16:43 +0100, David Ahern wrote: Seems really similar to what I proposed in the past: Yeah, it wasn't really hard to come with similar conclusions :-) https://lkml.org/lkml/2011/2/27/159 Which was rejected. I took a look at that thread, but just barely, emphasis

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-15 Thread Pawel Moll
On Fri, 2014-09-12 at 17:19 +0100, Arnaldo Carvalho de Melo wrote: Em Fri, Sep 12, 2014 at 02:58:55PM +0100, Pawel Moll escreveu: On Fri, 2014-09-12 at 14:49 +0100, Arnaldo Carvalho de Melo wrote: Perhaps both? I.e. an u64 followed from a string, if the u64 is zero, then there is a string

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-15 Thread Arnaldo Carvalho de Melo
Em Mon, Sep 15, 2014 at 06:27:14PM +0100, Pawel Moll escreveu: On Fri, 2014-09-12 at 17:19 +0100, Arnaldo Carvalho de Melo wrote: Em Fri, Sep 12, 2014 at 02:58:55PM +0100, Pawel Moll escreveu: On Fri, 2014-09-12 at 14:49 +0100, Arnaldo Carvalho de Melo wrote: Perhaps both? I.e. an u64

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-14 Thread David Ahern
On 9/12/14, 2:44 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Sep 12, 2014 at 10:37:39AM -0700, David Ahern escreveu: On 9/12/14, 4:48 AM, Pawel Moll wrote: This patch adds a PERF_COUNT_SW_MARKER event type, which can be requested by user and a PERF_EVENT_IOC_MARKER ioctl command which will

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-14 Thread David Ahern
On 9/12/14, 2:44 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Sep 12, 2014 at 10:37:39AM -0700, David Ahern escreveu: On 9/12/14, 4:48 AM, Pawel Moll wrote: This patch adds a PERF_COUNT_SW_MARKER event type, which can be requested by user and a PERF_EVENT_IOC_MARKER ioctl command which will

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 12, 2014 at 10:37:39AM -0700, David Ahern escreveu: > On 9/12/14, 4:48 AM, Pawel Moll wrote: > >This patch adds a PERF_COUNT_SW_MARKER event type, which > >can be requested by user and a PERF_EVENT_IOC_MARKER > >ioctl command which will inject an event of said type into > >the perf

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread David Ahern
On 9/12/14, 4:48 AM, Pawel Moll wrote: This patch adds a PERF_COUNT_SW_MARKER event type, which can be requested by user and a PERF_EVENT_IOC_MARKER ioctl command which will inject an event of said type into the perf buffer. The ioctl can take a zero-terminated string argument, similar to

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 12, 2014 at 02:58:55PM +0100, Pawel Moll escreveu: > On Fri, 2014-09-12 at 14:49 +0100, Arnaldo Carvalho de Melo wrote: > > Perhaps both? I.e. an u64 followed from a string, if the u64 is zero, > > then there is a string right after it? > How would this look like in userspace?

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Christopher Covington
On 09/12/2014 08:57 AM, Pawel Moll wrote: > On Fri, 2014-09-12 at 13:43 +0100, Christopher Covington wrote: >> Just to ask the dumb questions in case the answers I've come up with are >> wrong: What is PAGE_SIZE on an arm64 kernel? > > It's either 4 or 64k, depending on CONFIG_ARM64_64K_PAGES. >

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Pawel Moll
On Fri, 2014-09-12 at 14:49 +0100, Arnaldo Carvalho de Melo wrote: > Perhaps both? I.e. an u64 followed from a string, if the u64 is zero, > then there is a string right after it? How would this look like in userspace? Something like this? 8< struct perf_event_marker { uint64_t

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 12, 2014 at 01:57:52PM +0100, Pawel Moll escreveu: > On Fri, 2014-09-12 at 13:43 +0100, Christopher Covington wrote: > > Just to ask the dumb questions in case the answers I've come up with are > > wrong: What is PAGE_SIZE on an arm64 kernel? > It's either 4 or 64k, depending on

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Pawel Moll
On Fri, 2014-09-12 at 13:43 +0100, Christopher Covington wrote: > Just to ask the dumb questions in case the answers I've come up with are > wrong: What is PAGE_SIZE on an arm64 kernel? It's either 4 or 64k, depending on CONFIG_ARM64_64K_PAGES. > How does userspace know? > #include #include

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Christopher Covington
Hi Pawel, On 09/12/2014 07:48 AM, Pawel Moll wrote: > This patch adds a PERF_COUNT_SW_MARKER event type, which > can be requested by user and a PERF_EVENT_IOC_MARKER > ioctl command which will inject an event of said type into > the perf buffer. The ioctl can take a zero-terminated > string

[RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Pawel Moll
This patch adds a PERF_COUNT_SW_MARKER event type, which can be requested by user and a PERF_EVENT_IOC_MARKER ioctl command which will inject an event of said type into the perf buffer. The ioctl can take a zero-terminated string argument, similar to tracing_marker in ftrace, which will be kept in

[RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Pawel Moll
This patch adds a PERF_COUNT_SW_MARKER event type, which can be requested by user and a PERF_EVENT_IOC_MARKER ioctl command which will inject an event of said type into the perf buffer. The ioctl can take a zero-terminated string argument, similar to tracing_marker in ftrace, which will be kept in

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Christopher Covington
Hi Pawel, On 09/12/2014 07:48 AM, Pawel Moll wrote: This patch adds a PERF_COUNT_SW_MARKER event type, which can be requested by user and a PERF_EVENT_IOC_MARKER ioctl command which will inject an event of said type into the perf buffer. The ioctl can take a zero-terminated string argument,

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Pawel Moll
On Fri, 2014-09-12 at 13:43 +0100, Christopher Covington wrote: Just to ask the dumb questions in case the answers I've come up with are wrong: What is PAGE_SIZE on an arm64 kernel? It's either 4 or 64k, depending on CONFIG_ARM64_64K_PAGES. How does userspace know? #include unistd.h

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 12, 2014 at 01:57:52PM +0100, Pawel Moll escreveu: On Fri, 2014-09-12 at 13:43 +0100, Christopher Covington wrote: Just to ask the dumb questions in case the answers I've come up with are wrong: What is PAGE_SIZE on an arm64 kernel? It's either 4 or 64k, depending on

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Pawel Moll
On Fri, 2014-09-12 at 14:49 +0100, Arnaldo Carvalho de Melo wrote: Perhaps both? I.e. an u64 followed from a string, if the u64 is zero, then there is a string right after it? How would this look like in userspace? Something like this? 8 struct perf_event_marker { uint64_t value;

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Christopher Covington
On 09/12/2014 08:57 AM, Pawel Moll wrote: On Fri, 2014-09-12 at 13:43 +0100, Christopher Covington wrote: Just to ask the dumb questions in case the answers I've come up with are wrong: What is PAGE_SIZE on an arm64 kernel? It's either 4 or 64k, depending on CONFIG_ARM64_64K_PAGES. How

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 12, 2014 at 02:58:55PM +0100, Pawel Moll escreveu: On Fri, 2014-09-12 at 14:49 +0100, Arnaldo Carvalho de Melo wrote: Perhaps both? I.e. an u64 followed from a string, if the u64 is zero, then there is a string right after it? How would this look like in userspace? Something

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread David Ahern
On 9/12/14, 4:48 AM, Pawel Moll wrote: This patch adds a PERF_COUNT_SW_MARKER event type, which can be requested by user and a PERF_EVENT_IOC_MARKER ioctl command which will inject an event of said type into the perf buffer. The ioctl can take a zero-terminated string argument, similar to

Re: [RFC 2/2] perf: Marker software event and ioctl

2014-09-12 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 12, 2014 at 10:37:39AM -0700, David Ahern escreveu: On 9/12/14, 4:48 AM, Pawel Moll wrote: This patch adds a PERF_COUNT_SW_MARKER event type, which can be requested by user and a PERF_EVENT_IOC_MARKER ioctl command which will inject an event of said type into the perf buffer. The