1. 25 1月, 2019 1 次提交
  2. 25 7月, 2018 1 次提交
  3. 06 6月, 2018 1 次提交
    • A
      perf hists: Check if a hist_entry has callchains before using them · fabd37b8
      Arnaldo Carvalho de Melo 提交于
      So far if we use 'perf record -g' this will make
      symbol_conf.use_callchain 'true' and logic will assume that all events
      have callchains enabled, but ever since we added the possibility of
      setting up callchains for some events (e.g.: -e
      cycles/call-graph=dwarf/) while not for others, we limit usage scenarios
      by looking at that symbol_conf.use_callchain global boolean, we better
      look at each event attributes.
      
      On the road to that we need to look if a hist_entry has callchains, that
      is, to go from hist_entry->hists to the evsel that contains it, to then
      look at evsel->sample_type for PERF_SAMPLE_CALLCHAIN.
      
      The next step is to add a symbol_conf.ignore_callchains global, to use
      in the places where what we really want to know is if callchains should
      be ignored, even if present.
      
      Then -g will mean just to select a callchain mode to be applied to all
      events not explicitely setting some other callchain mode, i.e. a default
      callchain mode, and --no-call-graph will set
      symbol_conf.ignore_callchains with that clear intention.
      
      That too will at some point become a per evsel thing, that tools can set
      for all or just a few of its evsels.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-0sas5cm4dsw2obn75g7ruz69@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fabd37b8
  4. 27 4月, 2018 1 次提交
  5. 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
  6. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  7. 24 10月, 2017 1 次提交
  8. 30 8月, 2017 1 次提交
    • J
      perf report: Calculate the average cycles of iterations · c4ee0625
      Jin Yao 提交于
      The branch history code has a loop detection function. With this, we can
      get the number of iterations by calculating the removed loops.
      
      While it would be nice for knowing the average cycles of iterations.
      This patch adds up the cycles in branch entries of removed loops and
      save the result to the next branch entry (e.g. branch entry A).
      
      Finally it will display the iteration number and average cycles at the
      "from" of branch entry A.
      
      For example:
      perf record -g -j any,save_type ./div
      perf report --branch-history --no-children --stdio
      
      --22.63%--main div.c:42 (RET CROSS_2M)
                compute_flag div.c:28 (cycles:2 iter:173115 avg_cycles:2)
                |
                 --10.73%--compute_flag div.c:27 (RET CROSS_2M)
                           rand rand.c:28 (cycles:1)
                           rand rand.c:28 (RET CROSS_2M)
                           __random random.c:298 (cycles:1)
                           __random random.c:297 (COND_BWD CROSS_2M)
                           __random random.c:295 (cycles:1)
                           __random random.c:295 (COND_BWD CROSS_2M)
                           __random random.c:295 (cycles:1)
                           __random random.c:295 (RET CROSS_2M)
      Signed-off-by: NYao Jin <yao.jin@linux.intel.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.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/1502111115-18305-1-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c4ee0625
  9. 21 7月, 2017 1 次提交
  10. 19 7月, 2017 1 次提交
    • J
      perf report: Enable finding kernel inline functions · 8b8ef2d7
      Jin Yao 提交于
      Currently perf supports a mode to query inline stack. It works well for
      finding user space inline functions but it doesn't work for kernel ones,
      due to some unnecessary check.
      
      This patch removes these unnecessary checks. Now kernel inline functions
      can be reported.
      
      For example:
      
        perf report --inline -g func --stdio
      
        |--46.19%--do_huge_pmd_anonymous_page
        |          do_huge_pmd_anonymous_page (inline)
        |          __do_huge_pmd_anonymous_page (inline)
        |          __SetPageUptodate (inline)
        |          __set_bit (inline)
      
        The result is compared with the output of addr2line. They match.
      Signed-off-by: NYao Jin <yao.jin@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1500409892-15904-1-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8b8ef2d7
  11. 25 4月, 2017 1 次提交
  12. 20 4月, 2017 3 次提交
  13. 27 3月, 2017 2 次提交
    • M
      perf report: Enable sorting by srcline as key · 5dfa210e
      Milian Wolff 提交于
      Often it is interesting to know how costly a given source line is in
      total. Previously, one had to build these sums manually based on all
      addresses that pointed to the same source line. This patch introduces
      srcline as a sort key, which will do the aggregation for us.
      
      Paired with the recent addition of showing inline frames, this makes
      perf report much more useful for many C++ work loads.
      
      The following shows the new feature in action. First, let's show the
      status quo output when we sort by address. The result contains many hist
      entries that generate the same output:
      
        ~~~~~~~~~~~~~~~~
        $ perf report --stdio --inline -g address
        # Children      Self  Command       Shared Object        Symbol
        # ........  ........  ............  ...................  .........................................
        #
            99.89%    35.34%  cpp-inlining  cpp-inlining         [.] main
                  |
                  |--64.55%--main complex:655
                  |          /home/milian/projects/kdab/rnd/hotspot/tests/test-clients/cpp-inlining/main.cpp:39 (inline)
                  |          /usr/include/c++/6.3.1/complex:664 (inline)
                  |          |
                  |          |--60.31%--hypot +20
                  |          |          |
                  |          |          |--8.52%--__hypot_finite +273
                  |          |          |
                  |          |          |--7.32%--__hypot_finite +411
      ...
                   --35.34%--_start +4194346
                             __libc_start_main +241
                             |
                             |--6.65%--main random.tcc:3326
                             |          /home/milian/projects/kdab/rnd/hotspot/tests/test-clients/cpp-inlining/main.cpp:39 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:1809 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:1818 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:185 (inline)
                             |
                             |--2.70%--main random.tcc:3326
                             |          /home/milian/projects/kdab/rnd/hotspot/tests/test-clients/cpp-inlining/main.cpp:39 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:1809 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:1818 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:185 (inline)
                             |
                             |--1.69%--main random.tcc:3326
                             |          /home/milian/projects/kdab/rnd/hotspot/tests/test-clients/cpp-inlining/main.cpp:39 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:1809 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:1818 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:185 (inline)
        ...
        ~~~~~~~~~~~~~~~~
      
      With this patch and `-g srcline` we instead get the following output:
      
        ~~~~~~~~~~~~~~~~
        $ perf report --stdio --inline -g srcline
        # Children      Self  Command       Shared Object        Symbol
        # ........  ........  ............  ...................  .........................................
        #
            99.89%    35.34%  cpp-inlining  cpp-inlining         [.] main
                  |
                  |--64.55%--main complex:655
                  |          /home/milian/projects/kdab/rnd/hotspot/tests/test-clients/cpp-inlining/main.cpp:39 (inline)
                  |          /usr/include/c++/6.3.1/complex:664 (inline)
                  |          |
                  |          |--64.02%--hypot
                  |          |          |
                  |          |           --59.81%--__hypot_finite
                  |          |
                  |           --0.53%--cabs
                  |
                   --35.34%--_start
                             __libc_start_main
                             |
                             |--12.48%--main random.tcc:3326
                             |          /home/milian/projects/kdab/rnd/hotspot/tests/test-clients/cpp-inlining/main.cpp:39 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:1809 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:1818 (inline)
                             |          /usr/include/c++/6.3.1/bits/random.h:185 (inline)
        ...
        ~~~~~~~~~~~~~~~~
      Signed-off-by: NMilian Wolff <milian.wolff@kdab.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Yao Jin <yao.jin@linux.intel.com>
      Link: http://lkml.kernel.org/r/20170318214928.9047-1-milian.wolff@kdab.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5dfa210e
    • J
      perf report: Show inline stack for stdio mode · 0db64dd0
      Jin Yao 提交于
      If the address belongs to an inlined function, the source information
      back to the first non-inlined function will be printed.
      
      For example:
      
      1. Show inlined function name
         perf report --stdio -g function --inline
      
           0.69%     0.00%  inline   ld-2.23.so           [.] dl_main
                  |
                  ---dl_main
                     |
                      --0.56%--_dl_relocate_object
                                _dl_relocate_object (inline)
                                elf_dynamic_do_Rela (inline)
      
      2. Show the file/line information
         perf report --stdio -g address --inline
      
           0.69%     0.00%  inline   ld-2.23.so           [.] _dl_start_user
                  |
                  ---_dl_start_user .:0
                     _dl_start rtld.c:307
                     /build/glibc-GKVZIf/glibc-2.23/elf/rtld.c:413 (inline)
                     _dl_sysdep_start dl-sysdep.c:250
                     |
                      --0.56%--dl_main rtld.c:2076
      
      Committer tests:
      
        # perf record --call-graph dwarf ~/bin/perf stat usleep 1
      
       Performance counter stats for 'usleep 1':
      
                0.443020      task-clock (msec)         #    0.449 CPUs utilized
                       1      context-switches          #    0.002 M/sec
                       0      cpu-migrations            #    0.000 K/sec
                      52      page-faults               #    0.117 M/sec
               1,049,423      cycles                    #    2.369 GHz
                 801,456      instructions              #    0.76  insn per cycle
                 155,609      branches                  #  351.246 M/sec
                   7,026      branch-misses             #    4.52% of all branches
      
             0.000987570 seconds time elapsed
      
        [ perf record: Woken up 2 times to write data ]
        [ perf record: Captured and wrote 0.553 MB perf.data (66 samples) ]
        # perf report --stdio --inline fs__get_mountpoint
        <SNIP>
           1.73%     0.00%  perf     perf           [.] fs__get_mountpoint
                  |
                  ---fs__get_mountpoint
                     fs__get_mountpoint (inline)
                     fs__check_mounts (inline)
                     __statfs
                     entry_SYSCALL_64
                     sys_statfs
                     SYSC_statfs
                     user_statfs
                     user_path_at_empty
                     filename_lookup
                     path_lookupat
                     link_path_walk
                     inode_permission
                     __inode_permission
                     kernfs_iop_permission
                     kernfs_refresh_inode
                     security_inode_notifysecctx
                     selinux_inode_notifysecctx
                     selinux_inode_setsecurity
                     security_context_to_sid
                     security_context_to_sid_core
                     string_to_context_struct
                     symcmp
      Signed-off-by: NYao Jin <yao.jin@linux.intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NMilian Wolff <milian.wolff@kdab.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Link: http://lkml.kernel.org/r/1490474069-15823-5-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0db64dd0
  14. 15 11月, 2016 1 次提交
    • J
      perf report: Show branch info in callchain entry for stdio mode · 8577ae6b
      Jin Yao 提交于
      If the branch is 100% predicted then the "predicted" is hidden.
      Similarly, if there is no branch tsx abort, the "abort" is hidden.
      There is only cycles shown (cycle is supported on skylake platform,
      older platform would be 0).
      
      If no iterations, the "iterations" is hidden.
      
      For example:
      
      |--29.93%--main div.c:39 (predicted:50.6%, cycles:1, iterations:18)
      |          main div.c:44 (predicted:50.6%, cycles:1)
      |          |
      |           --22.69%--main div.c:42 (cycles:2, iterations:17)
      |                     compute_flag div.c:28 (cycles:2)
      |                     |
      |                      --10.52%--compute_flag div.c:27 (cycles:1)
      |                                rand rand.c:28 (cycles:1)
      |                                rand rand.c:28 (cycles:1)
      |                                __random random.c:298 (cycles:1)
      |                                __random random.c:297 (cycles:1)
      |                                __random random.c:295 (cycles:1)
      |                                __random random.c:295 (cycles:1)
      |                                __random random.c:295 (cycles:1)
      |                                __random random.c:295 (cycles:6)
      Signed-off-by: NYao Jin <yao.jin@linux.intel.com>
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linux-kernel@vger.kernel.org
      Cc: Yao Jin <yao.jin@linux.intel.com>
      Link: http://lkml.kernel.org/r/1477876794-30749-5-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8577ae6b
  15. 23 9月, 2016 3 次提交
  16. 21 9月, 2016 2 次提交
  17. 14 9月, 2016 2 次提交
  18. 24 8月, 2016 3 次提交
  19. 15 6月, 2016 7 次提交
  20. 07 4月, 2016 1 次提交
  21. 08 3月, 2016 3 次提交
  22. 27 2月, 2016 2 次提交
    • N
      perf report: Left align dynamic entries in hierarchy · cb1fab91
      Namhyung Kim 提交于
      The dynamic entries are right-aligned unlike other entries since it
      usually has numeric value.  But for the hierarchy mode, left alignment
      is more appropriate IMHO.  Also trim spaces on the left so that we can
      easily identify the hierarchy.
      
      Before:
      
        $ perf report --hierarchy -i perf.data.kmem -s gfp_flags,ptr,bytes_req --stdio -g none
        ...
        #
        #       Overhead                                        gfp_flags /                ptr /          bytes_req
        # ..............  .................................................................................................
        #
            91.67%                   GFP_ATOMIC|GFP_NOWARN|GFP_NOMEMALLOC
               37.50%        0xffff8803f7669400
                  37.50%                       448
                8.33%        0xffff8803f766be00
                   8.33%                        96
                4.17%        0xffff8800d156dc00
                   4.17%                       704
      
      After:
      
        #       Overhead  gfp_flags / ptr / bytes_req
        # ..............  ....................................
        #
            91.67%        GFP_ATOMIC|GFP_NOWARN|GFP_NOMEMALLOC
               37.50%        0xffff8803f7669400
                  37.50%        448
                8.33%        0xffff8803f766be00
                   8.33%        96
                4.17%        0xffff8800d156dc00
                   4.17%        704
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1456512767-1164-3-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cb1fab91
    • N
      perf report: Fix indentation of dynamic entries in hierarchy · d3a72fd8
      Namhyung Kim 提交于
      When dynamic entries are used in the hierarchy mode with multiple
      events, the output might not be aligned properly.  In the hierarchy
      mode, the each sort column is indented using total number of sort keys.
      So it keeps track of number of sort keys when adding them.  However
      a dynamic sort key can be added more than once when multiple events have
      same field names.  This results in unnecessarily long indentation in the
      output.
      
      For example perf kmem records following events:
      
        $ perf evlist --trace-fields -i perf.data.kmem
        kmem:kmalloc: trace_fields: call_site,ptr,bytes_req,bytes_alloc,gfp_flags
        kmem:kmalloc_node: trace_fields: call_site,ptr,bytes_req,bytes_alloc,gfp_flags,node
        kmem:kfree: trace_fields: call_site,ptr
        kmem:kmem_cache_alloc: trace_fields: call_site,ptr,bytes_req,bytes_alloc,gfp_flags
        kmem:kmem_cache_alloc_node: trace_fields: call_site,ptr,bytes_req,bytes_alloc,gfp_flags,node
        kmem:kmem_cache_free: trace_fields: call_site,ptr
        kmem:mm_page_alloc: trace_fields: page,order,gfp_flags,migratetype
        kmem:mm_page_free: trace_fields: page,order
      
      As you can see, many field names shared between kmem events.  So adding
      'ptr' dynamic sort key alone will set nr_sort_keys to 6.  And this adds
      many unnecessary spaces between columns.
      
      Before:
      
        $ perf report -i perf.data.kmem --hierarchy -s ptr -g none --stdio
        ...
        #                Overhead                 ptr
        # .......................  ...................................
        #
            99.89%                 0xffff8803ffb79720
             0.06%                 0xffff8803d228a000
             0.03%                 0xffff8803f7678f00
             0.00%                 0xffff880401dc5280
             0.00%                 0xffff880406172380
             0.00%                 0xffff8803ffac3a00
             0.00%                 0xffff8803ffac1600
      
      After:
      
        # Overhead                 ptr
        # ........  ....................
        #
            99.89%  0xffff8803ffb79720
             0.06%  0xffff8803d228a000
             0.03%  0xffff8803f7678f00
             0.00%  0xffff880401dc5280
             0.00%  0xffff880406172380
             0.00%  0xffff8803ffac3a00
             0.00%  0xffff8803ffac1600
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1456512767-1164-2-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d3a72fd8