Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-12-03 Thread Andi Kleen
Stephane Eranian writes: >> > I don't understand why this need to be so complicated. > Maybe just change the error code in case of group > overcommitment? That way, the tool could distinguish > and report the appropriate error message. The existing errno is an ABI. Also that would handle this

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-12-03 Thread Andi Kleen
Stephane Eranian eran...@google.com writes: I don't understand why this need to be so complicated. Maybe just change the error code in case of group overcommitment? That way, the tool could distinguish and report the appropriate error message. The existing errno is an ABI. Also that would

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-12-02 Thread Stephane Eranian
On Mon, Dec 2, 2013 at 4:23 PM, Andi Kleen wrote: >> Something like below? user space supply buffer for error string. > > That would work, although I was thinking of making it a more > generic mechanism (store it into task_struct, have a extra > syscall to retrieve) > I don't understand why this

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-12-02 Thread Andi Kleen
> Something like below? user space supply buffer for error string. That would work, although I was thinking of making it a more generic mechanism (store it into task_struct, have a extra syscall to retrieve) -Andi > > jirka > > > --- > diff --git a/include/uapi/linux/perf_event.h

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-12-02 Thread Andi Kleen
Something like below? user space supply buffer for error string. That would work, although I was thinking of making it a more generic mechanism (store it into task_struct, have a extra syscall to retrieve) -Andi jirka --- diff --git a/include/uapi/linux/perf_event.h

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-12-02 Thread Stephane Eranian
On Mon, Dec 2, 2013 at 4:23 PM, Andi Kleen a...@linux.intel.com wrote: Something like below? user space supply buffer for error string. That would work, although I was thinking of making it a more generic mechanism (store it into task_struct, have a extra syscall to retrieve) I don't

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-29 Thread Stephane Eranian
On Fri, Nov 29, 2013 at 2:52 PM, Jiri Olsa wrote: > On Fri, Nov 29, 2013 at 02:43:35PM +0100, Stephane Eranian wrote: >> On Fri, Nov 29, 2013 at 2:33 PM, Jiri Olsa wrote: >> > On Sat, Nov 16, 2013 at 07:41:34PM -0800, Andi Kleen wrote: >> >> > I'd say that the default behavior should be what

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-29 Thread Jiri Olsa
On Fri, Nov 29, 2013 at 02:43:35PM +0100, Stephane Eranian wrote: > On Fri, Nov 29, 2013 at 2:33 PM, Jiri Olsa wrote: > > On Sat, Nov 16, 2013 at 07:41:34PM -0800, Andi Kleen wrote: > >> > I'd say that the default behavior should be what Jiri implemented: get > >> > the most out of the situation

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-29 Thread Stephane Eranian
On Fri, Nov 29, 2013 at 2:33 PM, Jiri Olsa wrote: > On Sat, Nov 16, 2013 at 07:41:34PM -0800, Andi Kleen wrote: >> > I'd say that the default behavior should be what Jiri implemented: get >> > the most out of the situation and inform. But you are right in that >> > 'forcing' all elements of a

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-29 Thread Jiri Olsa
On Sat, Nov 16, 2013 at 07:41:34PM -0800, Andi Kleen wrote: > > I'd say that the default behavior should be what Jiri implemented: get > > the most out of the situation and inform. But you are right in that > > 'forcing' all elements of a group to be valid should be possible as > > well - if a

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-29 Thread Jiri Olsa
On Sat, Nov 16, 2013 at 07:41:34PM -0800, Andi Kleen wrote: I'd say that the default behavior should be what Jiri implemented: get the most out of the situation and inform. But you are right in that 'forcing' all elements of a group to be valid should be possible as well - if a special

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-29 Thread Stephane Eranian
On Fri, Nov 29, 2013 at 2:33 PM, Jiri Olsa jo...@redhat.com wrote: On Sat, Nov 16, 2013 at 07:41:34PM -0800, Andi Kleen wrote: I'd say that the default behavior should be what Jiri implemented: get the most out of the situation and inform. But you are right in that 'forcing' all elements of

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-29 Thread Jiri Olsa
On Fri, Nov 29, 2013 at 02:43:35PM +0100, Stephane Eranian wrote: On Fri, Nov 29, 2013 at 2:33 PM, Jiri Olsa jo...@redhat.com wrote: On Sat, Nov 16, 2013 at 07:41:34PM -0800, Andi Kleen wrote: I'd say that the default behavior should be what Jiri implemented: get the most out of the

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-29 Thread Stephane Eranian
On Fri, Nov 29, 2013 at 2:52 PM, Jiri Olsa jo...@redhat.com wrote: On Fri, Nov 29, 2013 at 02:43:35PM +0100, Stephane Eranian wrote: On Fri, Nov 29, 2013 at 2:33 PM, Jiri Olsa jo...@redhat.com wrote: On Sat, Nov 16, 2013 at 07:41:34PM -0800, Andi Kleen wrote: I'd say that the default

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-16 Thread Andi Kleen
> I'd say that the default behavior should be what Jiri implemented: get > the most out of the situation and inform. But you are right in that > 'forcing' all elements of a group to be valid should be possible as > well - if a special perf stat option or event format is used. When something is

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-16 Thread Andi Kleen
I'd say that the default behavior should be what Jiri implemented: get the most out of the situation and inform. But you are right in that 'forcing' all elements of a group to be valid should be possible as well - if a special perf stat option or event format is used. When something is

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 4:08 PM, Vince Weaver wrote: > On Fri, 15 Nov 2013, Ingo Molnar wrote: >> >> Btw., does the kernel side currently support discovery of such >> impossible group scheduling constraints at group setup time? If not >> then it probably should and it should reject them straight

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Vince Weaver
On Fri, 15 Nov 2013, Ingo Molnar wrote: > > Btw., does the kernel side currently support discovery of such > impossible group scheduling constraints at group setup time? If not > then it probably should and it should reject them straight away. It does not, or at least I'm pretty sure it can't

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 12:52 PM, Peter Zijlstra wrote: > On Fri, Nov 15, 2013 at 11:34:05AM +0100, Ingo Molnar wrote: >> That brings up an interesting question: what is better for users, if >> we schedule as many as we can and say 'not supported' to the rest >> (current behavior), or if we fail

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Peter Zijlstra
On Fri, Nov 15, 2013 at 11:34:05AM +0100, Ingo Molnar wrote: > That brings up an interesting question: what is better for users, if > we schedule as many as we can and say 'not supported' to the rest > (current behavior), or if we fail the whole group? > > I'd say that the default behavior

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Peter Zijlstra
On Fri, Nov 15, 2013 at 11:34:05AM +0100, Ingo Molnar wrote: > That brings up an interesting question: what is better for users, if > we schedule as many as we can and say 'not supported' to the rest > (current behavior), or if we fail the whole group? Obviously fail the whole group :-) -- To

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Peter Zijlstra
On Fri, Nov 15, 2013 at 11:13:27AM +0100, Stephane Eranian wrote: > On Fri, Nov 15, 2013 at 11:05 AM, Peter Zijlstra wrote: > > On Fri, Nov 15, 2013 at 07:34:57AM +0100, Ingo Molnar wrote: > >> Btw., does the kernel side currently support discovery of such > >> impossible group scheduling

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 11:34 AM, Ingo Molnar wrote: > > * Stephane Eranian wrote: > >> On Fri, Nov 15, 2013 at 7:34 AM, Ingo Molnar wrote: >> > >> > * Stephane Eranian wrote: >> > >> >> Jiri, >> >> >> >> I was trying the grouping support in perf stat and I was surprised >> >> to see that if I

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Ingo Molnar
* Stephane Eranian wrote: > On Fri, Nov 15, 2013 at 7:34 AM, Ingo Molnar wrote: > > > > * Stephane Eranian wrote: > > > >> Jiri, > >> > >> I was trying the grouping support in perf stat and I was surprised > >> to see that if I create a group that is too big to be scheduled, and > >> where

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 11:05 AM, Peter Zijlstra wrote: > On Fri, Nov 15, 2013 at 07:34:57AM +0100, Ingo Molnar wrote: >> Btw., does the kernel side currently support discovery of such >> impossible group scheduling constraints at group setup time? > > Up to a point. > It is only looking at the

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Peter Zijlstra
On Fri, Nov 15, 2013 at 07:34:57AM +0100, Ingo Molnar wrote: > Btw., does the kernel side currently support discovery of such > impossible group scheduling constraints at group setup time? Up to a point. > If not > then it probably should and it should reject them straight away. We do I

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 7:34 AM, Ingo Molnar wrote: > > * Stephane Eranian wrote: > >> Jiri, >> >> I was trying the grouping support in perf stat and I was surprised >> to see that if I create a group that is too big to be scheduled, and >> where only N out of P events can fit, perf stat still

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 7:34 AM, Ingo Molnar mi...@kernel.org wrote: * Stephane Eranian eran...@google.com wrote: Jiri, I was trying the grouping support in perf stat and I was surprised to see that if I create a group that is too big to be scheduled, and where only N out of P events can

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Peter Zijlstra
On Fri, Nov 15, 2013 at 07:34:57AM +0100, Ingo Molnar wrote: Btw., does the kernel side currently support discovery of such impossible group scheduling constraints at group setup time? Up to a point. If not then it probably should and it should reject them straight away. We do I think,

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 11:05 AM, Peter Zijlstra pet...@infradead.org wrote: On Fri, Nov 15, 2013 at 07:34:57AM +0100, Ingo Molnar wrote: Btw., does the kernel side currently support discovery of such impossible group scheduling constraints at group setup time? Up to a point. It is only

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Ingo Molnar
* Stephane Eranian eran...@google.com wrote: On Fri, Nov 15, 2013 at 7:34 AM, Ingo Molnar mi...@kernel.org wrote: * Stephane Eranian eran...@google.com wrote: Jiri, I was trying the grouping support in perf stat and I was surprised to see that if I create a group that is too big

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 11:34 AM, Ingo Molnar mi...@kernel.org wrote: * Stephane Eranian eran...@google.com wrote: On Fri, Nov 15, 2013 at 7:34 AM, Ingo Molnar mi...@kernel.org wrote: * Stephane Eranian eran...@google.com wrote: Jiri, I was trying the grouping support in perf stat

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Peter Zijlstra
On Fri, Nov 15, 2013 at 11:13:27AM +0100, Stephane Eranian wrote: On Fri, Nov 15, 2013 at 11:05 AM, Peter Zijlstra pet...@infradead.org wrote: On Fri, Nov 15, 2013 at 07:34:57AM +0100, Ingo Molnar wrote: Btw., does the kernel side currently support discovery of such impossible group

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Peter Zijlstra
On Fri, Nov 15, 2013 at 11:34:05AM +0100, Ingo Molnar wrote: That brings up an interesting question: what is better for users, if we schedule as many as we can and say 'not supported' to the rest (current behavior), or if we fail the whole group? Obviously fail the whole group :-) -- To

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Peter Zijlstra
On Fri, Nov 15, 2013 at 11:34:05AM +0100, Ingo Molnar wrote: That brings up an interesting question: what is better for users, if we schedule as many as we can and say 'not supported' to the rest (current behavior), or if we fail the whole group? I'd say that the default behavior should be

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 12:52 PM, Peter Zijlstra pet...@infradead.org wrote: On Fri, Nov 15, 2013 at 11:34:05AM +0100, Ingo Molnar wrote: That brings up an interesting question: what is better for users, if we schedule as many as we can and say 'not supported' to the rest (current behavior),

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Vince Weaver
On Fri, 15 Nov 2013, Ingo Molnar wrote: Btw., does the kernel side currently support discovery of such impossible group scheduling constraints at group setup time? If not then it probably should and it should reject them straight away. It does not, or at least I'm pretty sure it can't if

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-15 Thread Stephane Eranian
On Fri, Nov 15, 2013 at 4:08 PM, Vince Weaver vi...@deater.net wrote: On Fri, 15 Nov 2013, Ingo Molnar wrote: Btw., does the kernel side currently support discovery of such impossible group scheduling constraints at group setup time? If not then it probably should and it should reject them

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-14 Thread Ingo Molnar
* Stephane Eranian wrote: > Jiri, > > I was trying the grouping support in perf stat and I was surprised > to see that if I create a group that is too big to be scheduled, and > where only N out of P events can fit, perf stat still yields counts > for the N events. I was expecting 0 counts

[BUG] perf stat: explicit grouping yields unexpected results

2013-11-14 Thread Stephane Eranian
Jiri, I was trying the grouping support in perf stat and I was surprised to see that if I create a group that is too big to be scheduled, and where only N out of P events can fit, perf stat still yields counts for the N events. I was expecting 0 counts or . The kernel semantic is to schedule all

[BUG] perf stat: explicit grouping yields unexpected results

2013-11-14 Thread Stephane Eranian
Jiri, I was trying the grouping support in perf stat and I was surprised to see that if I create a group that is too big to be scheduled, and where only N out of P events can fit, perf stat still yields counts for the N events. I was expecting 0 counts or not supported. The kernel semantic is to

Re: [BUG] perf stat: explicit grouping yields unexpected results

2013-11-14 Thread Ingo Molnar
* Stephane Eranian eran...@google.com wrote: Jiri, I was trying the grouping support in perf stat and I was surprised to see that if I create a group that is too big to be scheduled, and where only N out of P events can fit, perf stat still yields counts for the N events. I was