1. 19 10月, 2009 8 次提交
    • I
      perf stat: Count branches first · dd86e72a
      Ingo Molnar 提交于
      Count branches first, cache-misses second. The reason is that
      on x86 branches are not counted by all counters on all CPUs.
      
      Before:
      
       Performance counter stats for 'ls':
      
             0.756653  task-clock-msecs         #      0.802 CPUs
                    0  context-switches         #      0.000 M/sec
                    0  CPU-migrations           #      0.000 M/sec
                  250  page-faults              #      0.330 M/sec
              2375725  cycles                   #   3139.781 M/sec
              1628129  instructions             #      0.685 IPC
                19643  cache-references         #     25.960 M/sec
                 4608  cache-misses             #      6.090 M/sec
               342532  branches                 #    452.694 M/sec
        <not counted>  branch-misses
      
          0.000943356  seconds time elapsed
      
      After:
      
       Performance counter stats for 'ls':
      
             1.056734  task-clock-msecs         #      0.859 CPUs
                    0  context-switches         #      0.000 M/sec
                    0  CPU-migrations           #      0.000 M/sec
                  259  page-faults              #      0.245 M/sec
              3345932  cycles                   #   3166.295 M/sec
              3074090  instructions             #      0.919 IPC
               616928  branches                 #    583.806 M/sec
                39279  branch-misses            #      6.367 %
                21312  cache-references         #     20.168 M/sec
                 3661  cache-misses             #      3.464 M/sec
      
          0.001230551  seconds time elapsed
      
      (also prettify the printout of branch misses, in case it's
       getting scaled.)
      
      Cc: Tim Blechmann <tim@klingt.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <4ADC3975.8050109@klingt.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ---
       tools/perf/builtin-stat.c |    2 ++
       1 files changed, 2 insertions(+), 0 deletions(-)
      
      diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
      index c373683..95a55ea 100644
      --- a/tools/perf/builtin-stat.c
      +++ b/tools/perf/builtin-stat.c
      @@ -59,6 +59,8 @@ static struct perf_event_attr default_attrs[] = {
         { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS	},
         { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES},
         { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES	},
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS},
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES	},
      
       };
      ---
       tools/perf/builtin-stat.c |   20 ++++++++++----------
       1 files changed, 10 insertions(+), 10 deletions(-)
      
      diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
      index 95a55ea..90e0a26 100644
      --- a/tools/perf/builtin-stat.c
      +++ b/tools/perf/builtin-stat.c
      @@ -50,17 +50,17 @@
      
       static struct perf_event_attr default_attrs[] = {
      
      -  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK	},
      -  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES},
      -  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS	},
      -  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS	},
      -
      -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES	},
      -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS	},
      -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES},
      -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES	},
      -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS},
      -  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES	},
      +  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK		},
      +  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES	},
      +  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS		},
      +  { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS		},
      +
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES		},
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS		},
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES	},
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES		},
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS	},
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES		},
      
       };
      dd86e72a
    • I
      perf stat: Re-align the default_attrs[] array · 56aab464
      Ingo Molnar 提交于
      Clean up the array definition to be vertically aligned.
      
      No functional effects.
      
      Cc: Tim Blechmann <tim@klingt.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <4ADC3975.8050109@klingt.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ---
       tools/perf/builtin-stat.c |    2 ++
       1 files changed, 2 insertions(+), 0 deletions(-)
      
      diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
      index c373683..95a55ea 100644
      --- a/tools/perf/builtin-stat.c
      +++ b/tools/perf/builtin-stat.c
      @@ -59,6 +59,8 @@ static struct perf_event_attr default_attrs[] = {
         { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS	},
         { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES},
         { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES	},
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS},
      +  { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES	},
      
       };
      56aab464
    • T
      perf stat: Add branch performance events to default output · 12133aff
      Tim Blechmann 提交于
      Adds performance event information about branches
      and branch misses to the default output of perf stat.
      Signed-off-by: NTim Blechmann <tim@klingt.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <4ADC3975.8050109@klingt.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      12133aff
    • R
      perf tools: Display better error messages on missing packages · 1abc7f55
      Randy Dunlap 提交于
      Check for libelf headers and glibc headers separately so that
      the error message correctly identifies which package
      installation is missing/needed.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: paulus@samba.org
      Cc: a.p.zijlstra@chello.nl
      Cc: efault@gmx.de
      Cc: fweisbec@gmail.com
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <4ADBCCE8.3060300@oracle.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1abc7f55
    • F
      perf tools: Use DECLARE_BITMAP instead of an open-coded array · db9f11e3
      Frederic Weisbecker 提交于
      Use DECLARE_BITMAP instead of an open coded array for our bitmap
      of featured sections.
      
      This makes the array an unsigned long instead of a u64 but since
      we use a 256 bits bitmap, the array size shouldn't vary between
      different boxes.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1255795038-13751-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      db9f11e3
    • F
      perf tools: Introduce bitmask'ed additional headers · 2ba08250
      Frederic Weisbecker 提交于
      This provides a new set of bitmasked headers. A new field is
      added in the perf headers that implements a bitmap storing
      optional features present in the perf.data file.
      
      The layout can be pictured like this:
      
      (Usual perf headers)(Features bitmap)[Feature 0][Feature
      n][Feature 255]
      
      If the bit n is set, then the feature n is used in this file.
      They are all set in order. This brings a backward and forward
      compatibility.
      
      The trace_info section has moved into such optional features,
      this is the first and only one for now.
      
      This is backward compatible with the .32 file version although
      it doesn't support the previous separate trace.info file.
      
      And finally it doesn't support the current interim development
      version.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1255792354-11304-2-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2ba08250
    • F
      perf tools: Use kernel bitmap library · 5a116dd2
      Frederic Weisbecker 提交于
      Use the kernel bitmap library for internal perf tools uses.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1255792354-11304-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5a116dd2
    • A
      perf stat: Add branch performance metric · 11018201
      Anton Blanchard 提交于
      When we count both branches and branch-misses it is useful to
      print out the percentage of branch-misses:
      
       # perf stat -e branches -e branch-misses /bin/true
      
       Performance counter stats for '/bin/true':
      
               401684  branches                 #      0.000 M/sec
                23301  branch-misses            #      5.801 %
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Cc: paulus@samba.org
      Cc: a.p.zijlstra@chello.nl
      LKML-Reference: <20091018112923.GQ4808@kryten>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      11018201
  2. 17 10月, 2009 1 次提交
  3. 15 10月, 2009 31 次提交