1. 08 May, 2015 7 commits
  2. 06 May, 2015 1 commit
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-3' of... · 1836ac85
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-3' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
        - Improve --filter support for 'perf probe', allowing using its arguments
          on other commands, as --add, --del, etc (Masami Hiramatsu)
      
        - Show warning when running 'perf kmem stat' on a unsuitable perf.data file,
          i.e. one with events that are not the ones required for the stat variant
          used (Namhyung Kim).
      
      Infrastructure changes:
      
        - Auxtrace support patches, paving the way to support Intel PT and BTS (Adrian Hunter)
      
        - hists browser (top, report) refactorings (Namhyung Kim)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1836ac85
  3. 05 May, 2015 22 commits
  4. 04 May, 2015 10 commits
    • Adrian Hunter's avatar
      perf tools: Hit all build ids when AUX area tracing · cd10b289
      Adrian Hunter authored
      We need to include all buildids when a perf.data file contains AUX area
      tracing data because we do not decode the trace for that purpose because
      it would take too long.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1430404667-10593-4-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cd10b289
    • Adrian Hunter's avatar
      perf tools: Add AUX area tracing index · 99fa2984
      Adrian Hunter authored
      Add an index of AUX area tracing events within a perf.data file.
      
      perf record uses a special user event PERF_RECORD_FINISHED_ROUND to
      enable sorting of events in chunks instead of having to sort all events
      altogether.
      
      AUX area tracing events contain data that can span back to the very
      beginning of the recording period. i.e. they do not obey the rules of
      PERF_RECORD_FINISHED_ROUND.
      
      By adding an index, AUX area tracing events can be found in advance and
      the PERF_RECORD_FINISHED_ROUND approach works as usual.
      
      The index is recorded with the auxtrace feature in the perf.data file.
      A session reads the index but does not process it.  An AUX area decoder
      can queue all the AUX area data in advance using
      auxtrace_queues__process_index() or otherwise process the index in some
      custom manner.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1430404667-10593-3-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      99fa2984
    • Adrian Hunter's avatar
      perf report: Fix placement of itrace option in documentation · 64a7e61f
      Adrian Hunter authored
      Unwittingly the itrace options for perf report ended up below the
      Overhead Calculation section. Move it back with the other options.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1430404667-10593-2-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      64a7e61f
    • Namhyung Kim's avatar
      perf kmem: Add kmem.default config option · 0c160d49
      Namhyung Kim authored
      Currently perf kmem command will select --slab if neither --slab nor
      --page is given for backward compatibility.  Add kmem.default config
      option to select the default value ('page' or 'slab').
      
        # cat ~/.perfconfig
        [kmem]
        	default = page
      
        # perf kmem stat
      
        SUMMARY (page allocator)
        ========================
        Total allocation requests     :            1,518   [            6,096 KB ]
        Total free requests           :            1,431   [            5,748 KB ]
      
        Total alloc+freed requests    :            1,330   [            5,344 KB ]
        Total alloc-only requests     :              188   [              752 KB ]
        Total free-only requests      :              101   [              404 KB ]
      
        Total allocation failures     :                0   [                0 KB ]
        ...
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joonsoo Kim <js1304@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/1429592107-1807-6-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0c160d49
    • Namhyung Kim's avatar
      perf kmem: Print gfp flags in human readable string · 0e111156
      Namhyung Kim authored
      Save libtraceevent output and print it in the header.
      
        # perf kmem stat --page --caller
        #
        # GFP flags
        # ---------
        # 00000010:       NI: GFP_NOIO
        # 000000d0:        K: GFP_KERNEL
        # 00000200:      NWR: GFP_NOWARN
        # 000084d0:    K|R|Z: GFP_KERNEL|GFP_REPEAT|GFP_ZERO
        # 000200d2:       HU: GFP_HIGHUSER
        # 000200da:      HUM: GFP_HIGHUSER_MOVABLE
        # 000280da:    HUM|Z: GFP_HIGHUSER_MOVABLE|GFP_ZERO
        # 002084d0: K|R|Z|NT: GFP_KERNEL|GFP_REPEAT|GFP_ZERO|GFP_NOTRACK
        # 0102005a:  NF|HW|M: GFP_NOFS|GFP_HARDWALL|GFP_MOVABLE
      
        ---------------------------------------------------------------------------------------------------------
         Total alloc (KB) | Hits      | Order | Mig.type | GFP flags | Callsite
        ---------------------------------------------------------------------------------------------------------
                       60 |        15 |     0 | UNMOVABL | K|R|Z|NT  | pte_alloc_one
                       40 |        10 |     0 |  MOVABLE | HUM|Z     | handle_mm_fault
                       24 |         6 |     0 |  MOVABLE | HUM       | do_wp_page
                       24 |         6 |     0 | UNMOVABL | K         | __pollwait
         ...
      Requested-by: default avatarJoonsoo Kim <js1304@gmail.com>
      Suggested-by: default avatarMinchan Kim <minchan@kernel.org>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Joonsoo Kim <js1304@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/1429592107-1807-5-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0e111156
    • Namhyung Kim's avatar
      perf kmem: Add --live option for current allocation stat · 2a7ef02c
      Namhyung Kim authored
      Currently 'perf kmem stat --page' shows total (page) allocation stat by
      default, but sometimes one might want to see live (total alloc-only)
      requests/pages only.  The new --live option does this by subtracting freed
      allocation from the stat.
      
      E.g.:
      
       # perf kmem stat --page
      
       SUMMARY (page allocator)
       ========================
       Total allocation requests     :          988,858   [        4,045,368 KB ]
       Total free requests           :          886,484   [        3,624,996 KB ]
      
       Total alloc+freed requests    :          885,969   [        3,622,628 KB ]
       Total alloc-only requests     :          102,889   [          422,740 KB ]
       Total free-only requests      :              515   [            2,368 KB ]
      
       Total allocation failures     :                0   [                0 KB ]
      
       Order     Unmovable   Reclaimable       Movable      Reserved  CMA/Isolated
       -----  ------------  ------------  ------------  ------------  ------------
           0       172,173         3,083       806,686             .             .
           1           284             .             .             .             .
           2         6,124            58             .             .             .
           3           114           335             .             .             .
           4             .             .             .             .             .
           5             .             .             .             .             .
           6             .             .             .             .             .
           7             .             .             .             .             .
           8             .             .             .             .             .
           9             .             .             1             .             .
          10             .             .             .             .             .
       # perf kmem stat --page --live
      
       SUMMARY (page allocator)
       ========================
       Total allocation requests     :          988,858   [        4,045,368 KB ]
       Total free requests           :          886,484   [        3,624,996 KB ]
      
       Total alloc+freed requests    :          885,969   [        3,622,628 KB ]
       Total alloc-only requests     :          102,889   [          422,740 KB ]
       Total free-only requests      :              515   [            2,368 KB ]
      
       Total allocation failures     :                0   [                0 KB ]
      
       Order     Unmovable   Reclaimable       Movable      Reserved  CMA/Isolated
       -----  ------------  ------------  ------------  ------------  ------------
           0         2,214         3,025        97,156             .             .
           1            59             .             .             .             .
           2            19            58             .             .             .
           3            23           335             .             .             .
           4             .             .             .             .             .
           5             .             .             .             .             .
           6             .             .             .             .             .
           7             .             .             .             .             .
           8             .             .             .             .             .
           9             .             .             .             .             .
          10             .             .             .             .             .
       #
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joonsoo Kim <js1304@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/1429592107-1807-4-git-send-email-namhyung@kernel.org
      [ Added examples to the changeset log ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2a7ef02c
    • Namhyung Kim's avatar
      perf kmem: Support sort keys on page analysis · fb4f313d
      Namhyung Kim authored
      Add new sort keys for page: page, order, migtype, gfp - existing
      'bytes', 'hit' and 'callsite' sort keys also work for page.  Note that
      -s/--sort option should be preceded by either of --slab or --page option
      to determine where the sort keys applies.
      
      Now it properly groups and sorts allocation stats - so same
      page/caller with different order/migtype/gfp will be printed on a
      different line.
      
       # perf kmem stat --page --caller -l 10 -s order,hit
      
       -----------------------------------------------------------------------------
       Total alloc (KB) | Hits   | Order | Mig.type | GFP flags | Callsite
       -----------------------------------------------------------------------------
                     64 |      4 |     2 |  RECLAIM |  00285250 | new_slab
                 50,144 | 12,536 |     0 |  MOVABLE |  0102005a | __page_cache_alloc
                     52 |     13 |     0 | UNMOVABL |  002084d0 | pte_alloc_one
                     40 |     10 |     0 |  MOVABLE |  000280da | handle_mm_fault
                     28 |      7 |     0 | UNMOVABL |  000000d0 | __pollwait
                     20 |      5 |     0 |  MOVABLE |  000200da | do_wp_page
                     20 |      5 |     0 |  MOVABLE |  000200da | do_cow_fault
                     16 |      4 |     0 | UNMOVABL |  00000200 | __tlb_remove_page
                     16 |      4 |     0 | UNMOVABL |  000084d0 | __pmd_alloc
                      8 |      2 |     0 | UNMOVABL |  000084d0 | __pud_alloc
       ...              | ...    | ...   | ...      | ...       | ...
       -----------------------------------------------------------------------------
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joonsoo Kim <js1304@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/1429592107-1807-3-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fb4f313d
    • Namhyung Kim's avatar
      perf kmem: Implement stat --page --caller · c9758cc4
      Namhyung Kim authored
      It is 'perf kmem' support caller statistics for page.  Unlike slab case,
      the tracepoints in page allocator don't provide callsite info.  So it
      records with callchain and extracts callsite info.
      
      Note that the callchain contains several memory allocation functions
      which has no meaning for users.  So skip those functions to get proper
      callsites.  I used following regex pattern to skip the allocator
      functions:
      
        ^_?_?(alloc|get_free|get_zeroed)_pages?
      
      This gave me a following list of functions:
      
        # perf kmem record --page sleep 3
        # perf kmem stat --page -v
        ...
        alloc func: __get_free_pages
        alloc func: get_zeroed_page
        alloc func: alloc_pages_exact
        alloc func: __alloc_pages_direct_compact
        alloc func: __alloc_pages_nodemask
        alloc func: alloc_page_interleave
        alloc func: alloc_pages_current
        alloc func: alloc_pages_vma
        alloc func: alloc_page_buffers
        alloc func: alloc_pages_exact_nid
        ...
      
      The output looks mostly same as --alloc (I also added callsite column
      to that) but groups entries by callsite.  Currently, the order,
      migrate type and GFP flag info is for the last allocation and not
      guaranteed to be same for all allocations from the callsite.
      
        ---------------------------------------------------------------------------------------------
         Total_alloc (KB) | Hits      | Order | Mig.type | GFP flags | Callsite
        ---------------------------------------------------------------------------------------------
                    1,064 |       266 |     0 | UNMOVABL |  000000d0 | __pollwait
                       52 |        13 |     0 | UNMOVABL |  002084d0 | pte_alloc_one
                       44 |        11 |     0 |  MOVABLE |  000280da | handle_mm_fault
                       20 |         5 |     0 |  MOVABLE |  000200da | do_cow_fault
                       20 |         5 |     0 |  MOVABLE |  000200da | do_wp_page
                       16 |         4 |     0 | UNMOVABL |  000084d0 | __pmd_alloc
                       16 |         4 |     0 | UNMOVABL |  00000200 | __tlb_remove_page
                       12 |         3 |     0 | UNMOVABL |  000084d0 | __pud_alloc
                        8 |         2 |     0 | UNMOVABL |  00000010 | bio_copy_user_iov
                        4 |         1 |     0 | UNMOVABL |  000200d2 | pipe_write
                        4 |         1 |     0 |  MOVABLE |  000280da | do_wp_page
                        4 |         1 |     0 | UNMOVABL |  002084d0 | pgd_alloc
        ---------------------------------------------------------------------------------------------
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joonsoo Kim <js1304@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/1429592107-1807-2-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c9758cc4
    • Masami Hiramatsu's avatar
      perf probe: Accept filter argument for --list · b6a89643
      Masami Hiramatsu authored
      Currently, perf-probe --list option ignores given event filter.
        ----
        # ./perf probe -l vfs\*
          probe:vfs_read       (on vfs_read@ksrc/linux-3/fs/read_write.c)
          probe_libc:malloc    (on __libc_malloc@malloc/malloc.c in /usr/lib64/libc-2.17.so)
        ----
      
      This changes --list option to accept the event filter argument as below.
        ----
        # ./perf probe -l vfs\*
          probe:vfs_read       (on vfs_read@ksrc/linux-3/fs/read_write.c)
        # ./perf probe -l \*libc:\*
          probe_libc:malloc    (on __libc_malloc@malloc/malloc.c in /usr/lib64/libc-2.17.so)
        ----
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20150424094750.23967.53868.stgit@localhost.localdomainSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b6a89643
    • Masami Hiramatsu's avatar
      perf probe: Accept multiple filter options · 96b55e39
      Masami Hiramatsu authored
      Accept multiple filter options. Each filters are combined by logical-or.
      E.g. --filter abc* --filter *def is same as --filter abc*|*def
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20150424094748.23967.63355.stgit@localhost.localdomainSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      96b55e39