1. 21 3月, 2018 25 次提交
  2. 17 3月, 2018 1 次提交
    • I
      perf report: Show zero counters as well in 'perf report --stat' · 39ce7fb3
      Ingo Molnar 提交于
      When recently using 'perf report --stat' it was not clear to me from the
      output whether a particular statistics field (LOST_SAMPLES) was not
      present, or just zero:
      
        fomalhaut:~> perf report --stat
      
        Aggregated stats:
                 TOTAL events:     495984
                  MMAP events:         85
                  COMM events:       3389
                  EXIT events:       1605
              THROTTLE events:          2
            UNTHROTTLE events:          2
                  FORK events:       3377
                SAMPLE events:     472629
                 MMAP2 events:      14753
        FINISHED_ROUND events:        139
            THREAD_MAP events:          1
               CPU_MAP events:          1
             TIME_CONV events:          1
      
      I had to check the output several times to ascertain that I'm not
      misreading the output, that the field didn't change and that I didn't
      misremember the name. In fact I had to look into the perf source to make
      sure that zero fields are indeed not shown.
      
      With the patch applied:
      
        fomalhaut:~> perf report --stat
      
        Aggregated stats:
                 TOTAL events:     495984
                  MMAP events:         85
                  LOST events:          0
                  COMM events:       3389
                  EXIT events:       1605
              THROTTLE events:          2
            UNTHROTTLE events:          2
                  FORK events:       3377
                  READ events:          0
                SAMPLE events:     472629
                 MMAP2 events:      14753
                   AUX events:          0
          ITRACE_START events:          0
          LOST_SAMPLES events:          0
                SWITCH events:          0
       SWITCH_CPU_WIDE events:          0
            NAMESPACES events:          0
                  ATTR events:          0
            EVENT_TYPE events:          0
          TRACING_DATA events:          0
              BUILD_ID events:          0
        FINISHED_ROUND events:        139
              ID_INDEX events:          0
         AUXTRACE_INFO events:          0
              AUXTRACE events:          0
        AUXTRACE_ERROR events:          0
            THREAD_MAP events:          1
               CPU_MAP events:          1
           STAT_CONFIG events:          0
                  STAT events:          0
            STAT_ROUND events:          0
          EVENT_UPDATE events:          0
             TIME_CONV events:          1
               FEATURE events:          0
      
      It's pretty clear at a glance that LOST_SAMPLES is present but zero.
      
      The original output can still be gotten via:
      
        fomalhaut:~> perf report --stat | grep -vw 0
      
        Aggregated stats:
                 TOTAL events:     495984
                  MMAP events:         85
                  COMM events:       3389
                  EXIT events:       1605
              THROTTLE events:          2
            UNTHROTTLE events:          2
                  FORK events:       3377
                SAMPLE events:     472629
                 MMAP2 events:      14753
        FINISHED_ROUND events:        139
            THREAD_MAP events:          1
               CPU_MAP events:          1
             TIME_CONV events:          1
      
      So I don't think there's any real loss in functionality.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20180307152430.7e5h7e657b7bgd7q@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      39ce7fb3
  3. 08 3月, 2018 1 次提交
  4. 05 3月, 2018 4 次提交
  5. 17 2月, 2018 1 次提交
    • J
      perf report: Fix wrong jump arrow · b40982e8
      Jin Yao 提交于
      When we use perf report interactive annotate view, we can see
      the position of jump arrow is not correct. For example,
      
      1. perf record -b ...
      2. perf report
      3. In interactive mode, select Annotate 'function'
      
      Percent│ IPC Cycle
             │                                if (flag)
        1.37 │0.4┌──   1      ↓ je     82
             │   │                                    x += x / y + y / x;
        0.00 │0.4│  1310        movsd  (%rsp),%xmm0
        0.00 │0.4│   565        movsd  0x8(%rsp),%xmm4
             │0.4│              movsd  0x8(%rsp),%xmm1
             │0.4│              movsd  (%rsp),%xmm3
             │0.4│              divsd  %xmm4,%xmm0
        0.00 │0.4│   579        divsd  %xmm3,%xmm1
             │0.4│              movsd  (%rsp),%xmm2
             │0.4│              addsd  %xmm1,%xmm0
             │0.4│              addsd  %xmm2,%xmm0
        0.00 │0.4│              movsd  %xmm0,(%rsp)
             │   │                    volatile double x = 1212121212, y = 121212;
             │   │
             │   │                    s_randseed = time(0);
             │   │                    srand(s_randseed);
             │   │
             │   │                    for (i = 0; i < 2000000000; i++) {
        1.37 │0.4└─→      82:   sub    $0x1,%ebx
       28.21 │0.48    17      ↑ jne    38
      
      The jump arrow in above example is not correct. It should add the
      width of IPC and Cycle.
      
      With this patch, the result is:
      
      Percent│ IPC Cycle
             │                                if (flag)
        1.37 │0.48     1     ┌──je     82
             │               │                        x += x / y + y / x;
        0.00 │0.48  1310     │  movsd  (%rsp),%xmm0
        0.00 │0.48   565     │  movsd  0x8(%rsp),%xmm4
             │0.48           │  movsd  0x8(%rsp),%xmm1
             │0.48           │  movsd  (%rsp),%xmm3
             │0.48           │  divsd  %xmm4,%xmm0
        0.00 │0.48   579     │  divsd  %xmm3,%xmm1
             │0.48           │  movsd  (%rsp),%xmm2
             │0.48           │  addsd  %xmm1,%xmm0
             │0.48           │  addsd  %xmm2,%xmm0
        0.00 │0.48           │  movsd  %xmm0,(%rsp)
             │               │        volatile double x = 1212121212, y = 121212;
             │               │
             │               │        s_randseed = time(0);
             │               │        srand(s_randseed);
             │               │
             │               │        for (i = 0; i < 2000000000; i++) {
        1.37 │0.48        82:└─→sub    $0x1,%ebx
       28.21 │0.48    17      ↑ jne    38
      
      Committer notes:
      
      Please note that only from LBRv5 (according to Jiri) onwards, i.e. >=
      Skylake is that we'll have the cycles counts in each branch record
      entry, so to see the Cycles and IPC columns, and be able to test this
      patch, one need a capable hardware.
      
      While applying this I first tested it on a Broadwell class machine and
      couldn't get those columns, will add code to the annotate browser to
      warn the user about that, i.e. you have branch records, but no cycles,
      use a more recent hardware to get the cycles and IPC columns.
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jin Yao <yao.jin@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1517223473-14750-1-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b40982e8
  6. 15 2月, 2018 1 次提交
  7. 27 12月, 2017 1 次提交
  8. 17 11月, 2017 6 次提交