linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Adrian Hunter <adrian.hunter@intel.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCHv2] perf tools: Force uncore events to system wide monitoring
Date: Thu, 2 Mar 2017 09:08:58 +0100	[thread overview]
Message-ID: <20170302080858.GB24099@krava> (raw)
In-Reply-To: <20170302074410.GA24099@krava>

On Thu, Mar 02, 2017 at 08:44:10AM +0100, Jiri Olsa wrote:
> On Wed, Mar 01, 2017 at 06:36:39PM -0300, Arnaldo Carvalho de Melo wrote:
> 
> SNIP
> 
> >   [acme@jouet linux]$ perf stat usleep 1
> > 
> >    Performance counter stats for 'usleep 1':
> > 
> >           2.022049      task-clock:u (msec)       #    0.181 CPUs utilized          
> >                  0      context-switches:u        #    0.000 K/sec                  
> >                  0      cpu-migrations:u          #    0.000 K/sec                  
> >                 48      page-faults:u             #    0.024 M/sec                  
> >          2,177,301      cycles:u                  #    1.077 GHz                    
> >            245,106      instructions:u            #    0.11  insn per cycle         
> >             48,000      branches:u                #   23.738 M/sec                  
> >              3,936      branch-misses:u           #    8.20% of all branches        
> > 
> >        0.011181563 seconds time elapsed
> > 
> >   [acme@jouet linux]$
> > 
> > ---------------------------------------------
> > 
> > Seems related to the auto :u done when the user can't do kernel profiling, etc.
> > 
> > Re-applying your patch, to triple check:
> > 
> > [acme@jouet linux]$ perf stat usleep 1 2>&1 | head -2
> > Error:
> > You may not have permission to collect system-wide stats.
> > [acme@jouet linux]$
> > 
> > ------------------------------------------------
> > 
> > Waiting for v3 :-)
> 
> oh my... I'll check

could you please try with attched change

thanks,
jirka


---
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 1320352cda04..f53f449d864d 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -2374,7 +2374,8 @@ static void setup_system_wide(int forks)
 				return;
 		}
 
-		target.system_wide = true;
+		if (evsel_list->nr_entries)
+			target.system_wide = true;
 	}
 }
 

  reply	other threads:[~2017-03-02  8:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 10:17 [PATCH] perf tools: Force uncore events to system wide monitoring Jiri Olsa
2017-02-24 13:32 ` Arnaldo Carvalho de Melo
2017-02-24 14:00   ` Jiri Olsa
2017-02-27  9:28     ` Jiri Olsa
2017-02-27  9:44       ` Borislav Petkov
2017-02-27  9:48         ` [PATCHv2] " Jiri Olsa
2017-03-01 21:36           ` Arnaldo Carvalho de Melo
2017-03-02  7:44             ` Jiri Olsa
2017-03-02  8:08               ` Jiri Olsa [this message]
2017-03-07  8:22           ` [tip:perf/core] " tip-bot for Jiri Olsa

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=20170302080858.GB24099@krava \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=bp@alien8.de \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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;
as well as URLs for NNTP newsgroup(s).