public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Possible problem with perf tool
@ 2009-07-02  0:03 Kevin Winchester
  2009-07-02  0:11 ` Frederic Weisbecker
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Winchester @ 2009-07-02  0:03 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML


I was playing with perf to get an idea of what it can do, so I started with a basic test:

$ perf stat ls
CREDITS        PERF-BUILD-OPTIONS  builtin-annotate.c  builtin-help.o  builtin-record.c  builtin-report.o  builtin-top.c  command-list.txt  libperf.a  perf.h
Documentation  PERF-CFLAGS	   builtin-annotate.o  builtin-list.c  builtin-record.o  builtin-stat.c    builtin-top.o  common-cmds.h     perf       perf.o
Makefile       PERF-VERSION-FILE   builtin-help.c      builtin-list.o  builtin-report.c  builtin-stat.o    builtin.h	  design.txt	    perf.c     util

 Performance counter stats for 'ls':

       1.675774  task-clock-msecs         #      0.772 CPUs 
             13  context-switches         #      0.008 M/sec
              0  CPU-migrations           #      0.000 M/sec
            212  page-faults              #      0.127 M/sec
        2925124  cycles                   #   1745.536 M/sec
        1048640  instructions             #      0.358 IPC  
         547552  cache-references         #    326.746 M/sec
           8455  cache-misses             #      5.045 M/sec

    0.002170123  seconds time elapsed




Looks good, so I tried:

$ perf stat ls -l
  Error: unknown switch `l'




So I tried instead:

$ perf stat 'ls -l'
ls -l: No such file or directory

 Performance counter stats for 'ls -l':

  <not counted>  task-clock-msecs        
  <not counted>  context-switches        
  <not counted>  CPU-migrations          
  <not counted>  page-faults             
  <not counted>  cycles                  
  <not counted>  instructions            
  <not counted>  cache-references        
  <not counted>  cache-misses            

    0.000594919  seconds time elapsed





Am I doing something wrong here?  Or perhaps perf should be taught the difference between command-line switches before or after the perf command (e.g. stat) being invoked?

-- 
Kevin Winchester



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Possible problem with perf tool
  2009-07-02  0:03 Possible problem with perf tool Kevin Winchester
@ 2009-07-02  0:11 ` Frederic Weisbecker
  0 siblings, 0 replies; 2+ messages in thread
From: Frederic Weisbecker @ 2009-07-02  0:11 UTC (permalink / raw)
  To: Kevin Winchester; +Cc: Ingo Molnar, LKML

On Wed, Jul 01, 2009 at 09:03:52PM -0300, Kevin Winchester wrote:
> 
> I was playing with perf to get an idea of what it can do, so I started with a basic test:
> 
> $ perf stat ls
> CREDITS        PERF-BUILD-OPTIONS  builtin-annotate.c  builtin-help.o  builtin-record.c  builtin-report.o  builtin-top.c  command-list.txt  libperf.a  perf.h
> Documentation  PERF-CFLAGS	   builtin-annotate.o  builtin-list.c  builtin-record.o  builtin-stat.c    builtin-top.o  common-cmds.h     perf       perf.o
> Makefile       PERF-VERSION-FILE   builtin-help.c      builtin-list.o  builtin-report.c  builtin-stat.o    builtin.h	  design.txt	    perf.c     util
> 
>  Performance counter stats for 'ls':
> 
>        1.675774  task-clock-msecs         #      0.772 CPUs 
>              13  context-switches         #      0.008 M/sec
>               0  CPU-migrations           #      0.000 M/sec
>             212  page-faults              #      0.127 M/sec
>         2925124  cycles                   #   1745.536 M/sec
>         1048640  instructions             #      0.358 IPC  
>          547552  cache-references         #    326.746 M/sec
>            8455  cache-misses             #      5.045 M/sec
> 
>     0.002170123  seconds time elapsed
> 
> 
> 
> 
> Looks good, so I tried:
> 
> $ perf stat ls -l
>   Error: unknown switch `l'
> 
> 
> 
> 
> So I tried instead:
> 
> $ perf stat 'ls -l'
> ls -l: No such file or directory
> 
>  Performance counter stats for 'ls -l':
> 
>   <not counted>  task-clock-msecs        
>   <not counted>  context-switches        
>   <not counted>  CPU-migrations          
>   <not counted>  page-faults             
>   <not counted>  cycles                  
>   <not counted>  instructions            
>   <not counted>  cache-references        
>   <not counted>  cache-misses            
> 
>     0.000594919  seconds time elapsed
> 
> 
> 
> 
> 
> Am I doing something wrong here?  Or perhaps perf should be taught the difference between command-line switches before or after the perf command (e.g. stat) being invoked?
> 


Hi,

When you have a command line to play that has parameters, then
separate the perf parameters from the command line using "--":

./perf stat -- ls -l

I guess it's inspired from the when you have to pass paths
and branches at the same time:

git-diff branch1 branch2 -- kernel/perf_counter.c


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-02  0:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-02  0:03 Possible problem with perf tool Kevin Winchester
2009-07-02  0:11 ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox