public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	Stephane Eranian <eranian@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"mingo@elte.hu" <mingo@elte.hu>, David Ahern <dsahern@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Namhyung Kim <namhyung.kim@lge.com>
Subject: Re: [BUG] perf stat: explicit grouping yields unexpected results
Date: Fri, 29 Nov 2013 14:33:40 +0100	[thread overview]
Message-ID: <20131129133340.GA25751@krava.brq.redhat.com> (raw)
In-Reply-To: <20131117034134.GA19762@tassilo.jf.intel.com>

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 perf stat option or event format is used.
> 
> When something is multiplexed it can have a very 
> large measurement error. For workloads that fluctuate quite a bit, and the
> fluctuations do not line up well with the multiplexing interval,
> the default scaling does not give good results.
> 
> So you expect to get good data, but you get very bad data.
> 
> When collecting data for a large number of events it is important
> to group them correctly, so that events that are directly dependent
> on each other in equations are properly grouped.
> 
> When explicit groups were added the user likely considered this 
> problem, so it's not good to silently override the choices.
> 
> If a user doesn't care they can always not use groups.
> 
> > Even in that second case it shouldn't say <unsupported> for everything 
> > in the result, but should deny the run immediately and return with an 
> > error, and should tell the user how many events in the group fit and 
> > which ones didn't.
> 
> Returning this information would be great, but it would really 
> need an extended errno, or just a error string reported out.

(sry for late reply, I was still ooo, and missed this conversation)

I agree, when the last event fails sys_perf_event_open
due to the validate_group check, we will get just EINVAL

Was there any discussion about the error (or erorr string)
propagation from sys_perf_event_open?

Something like below? user space supply buffer for error string.

jirka


---
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index e1802d6..a827870 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -331,8 +331,8 @@ struct perf_event_attr {
 	 */
 	__u32	sample_stack_user;
 
-	/* Align to u64. */
-	__u32	__reserved_2;
+	__u32	errstr_size;
+	char	*errstr;
 };
 
 #define perf_flags(attr)	(*(&(attr)->read_format + 1))


  reply	other threads:[~2013-11-29 13:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 20:50 [BUG] perf stat: explicit grouping yields unexpected results Stephane Eranian
2013-11-15  6:34 ` Ingo Molnar
2013-11-15  9:24   ` Stephane Eranian
2013-11-15 10:34     ` Ingo Molnar
2013-11-15 10:41       ` Stephane Eranian
2013-11-15 10:50       ` Peter Zijlstra
2013-11-15 11:52       ` Peter Zijlstra
2013-11-15 11:58         ` Stephane Eranian
2013-11-17  3:41       ` Andi Kleen
2013-11-29 13:33         ` Jiri Olsa [this message]
2013-11-29 13:43           ` Stephane Eranian
2013-11-29 13:52             ` Jiri Olsa
2013-11-29 14:01               ` Stephane Eranian
2013-12-02 15:23           ` Andi Kleen
2013-12-03  2:52             ` Stephane Eranian
2013-12-03 23:44               ` Andi Kleen
2013-11-15 10:05   ` Peter Zijlstra
2013-11-15 10:13     ` Stephane Eranian
2013-11-15 10:49       ` Peter Zijlstra
2013-11-15 15:08   ` Vince Weaver
2013-11-15 22:52     ` Stephane Eranian

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=20131129133340.GA25751@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=peterz@infradead.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