All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Zickus <dzickus@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@kernel.org>, Paul Mackerras <paulus@samba.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	LKML <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCHSET 00/17] perf report: Add -F option for specifying output fields (v4)
Date: Tue, 22 Apr 2014 17:16:47 -0400	[thread overview]
Message-ID: <20140422211647.GO8488@redhat.com> (raw)
In-Reply-To: <1397617554-26319-1-git-send-email-namhyung@kernel.org>

On Wed, Apr 16, 2014 at 12:05:37PM +0900, Namhyung Kim wrote:
> Hello,
> 
> This is a patchset implementing -F/--fields option to setup output
> field/column as Ingo requested.  It depends on my --percentage
> patchset [1].
> 
> The -F option can receive any sort keys that -s option recognize, plus
> following fields (name can be changed):
> 
>   overhead, overhead_sys, overhead_us, sample, period
> 
> The overhead_guest_sys and overhead_guest_us might be avaiable when
> you profile guest machines.
> 
> Output will be sorted by in order of fields and sort keys passed by -s
> option will be added to the output field list automatically.  If you
> want to change the order of sorting you can give -s option in addition
> to -F option.  To support old behavior, it'll also prepend 'overhead'
> field to the sort keys unless you give -F option explicitly.

So I am struggling a little bit to get this working correctly.  I had it
in my head that I could sort internally with -s and re-sort the output
based on -F, but it doesn't seem to be working that way.

For example with

./perf mem record -a grep -r foo /* > /dev/null
./perf mem report -F overhead,symbol_daddr,pid -s symbol_daddr,pid --stdio 

I was thinking I could sort everything based on the symbol_daddr and pid.
Then re-sort the output to display the highest 'symbol_daddr,pid' pair.
But it didn't seem to work that way.  Instead it seems like I get the
original sort just displayed in the -F format.

Did I misunderstand what the -F can do or I am using it wrong?

Cheers,
Don



> 
> 
>   $ perf report -s dso,sym
>   ...
>   # Overhead  Shared Object                      Symbol
>   # ........  .............  ..........................
>   #
>       13.75%  ld-2.17.so     [.] strcmp                
>       10.00%  abc            [.] a                     
>       10.00%  abc            [.] b                     
>       10.00%  abc            [.] c                     
>        8.75%  abc            [.] main                  
>        7.50%  libc-2.17.so   [.] _setjmp               
>        6.25%  abc            [.] _init                 
>        6.25%  abc            [.] frame_dummy           
>        5.00%  abc            [.] __libc_csu_init       
>        5.00%  ld-2.17.so     [.] _dl_name_match_p      
>        3.75%  libc-2.17.so   [.] __new_exitfn          
>        2.50%  libc-2.17.so   [.] __cxa_atexit          
>        1.25%  ld-2.17.so     [.] _dl_check_map_versions
>        1.25%  ld-2.17.so     [.] _dl_setup_hash        
>        1.25%  ld-2.17.so     [.] _dl_sysdep_start      
>        1.25%  ld-2.17.so     [.] brk                   
>        1.25%  ld-2.17.so     [.] calloc@plt            
>        1.25%  ld-2.17.so     [.] dl_main               
>        1.25%  ld-2.17.so     [.] match_symbol          
>        1.25%  ld-2.17.so     [.] sbrk                  
>        1.25%  ld-2.17.so     [.] strlen                
> 
> 
>   $ perf report -F sym,sample,overhead
>   ...
>   #                     Symbol       Samples  Overhead
>   # ..........................  ............  ........
>   #
>     [.] __cxa_atexit                       2     2.50%
>     [.] __libc_csu_init                    4     5.00%
>     [.] __new_exitfn                       3     3.75%
>     [.] _dl_check_map_versions             1     1.25%
>     [.] _dl_name_match_p                   4     5.00%
>     [.] _dl_setup_hash                     1     1.25%
>     [.] _dl_sysdep_start                   1     1.25%
>     [.] _init                              5     6.25%
>     [.] _setjmp                            6     7.50%
>     [.] a                                  8    10.00%
>     [.] b                                  8    10.00%
>     [.] brk                                1     1.25%
>     [.] c                                  8    10.00%
>     [.] calloc@plt                         1     1.25%
>     [.] dl_main                            1     1.25%
>     [.] frame_dummy                        5     6.25%
>     [.] main                               7     8.75%
>     [.] match_symbol                       1     1.25%
>     [.] sbrk                               1     1.25%
>     [.] strcmp                            11    13.75%
>     [.] strlen                             1     1.25%
> 
> 
>   $ perf report -F sym,sample -s overhead
>   ...
>   #                     Symbol       Samples  Overhead
>   # ..........................  ............  ........
>   #
>     [.] strcmp                            11    13.75%
>     [.] a                                  8    10.00%
>     [.] b                                  8    10.00%
>     [.] c                                  8    10.00%
>     [.] main                               7     8.75%
>     [.] _setjmp                            6     7.50%
>     [.] _init                              5     6.25%
>     [.] frame_dummy                        5     6.25%
>     [.] __libc_csu_init                    4     5.00%
>     [.] _dl_name_match_p                   4     5.00%
>     [.] __new_exitfn                       3     3.75%
>     [.] __cxa_atexit                       2     2.50%
>     [.] _dl_check_map_versions             1     1.25%
>     [.] _dl_setup_hash                     1     1.25%
>     [.] _dl_sysdep_start                   1     1.25%
>     [.] brk                                1     1.25%
>     [.] calloc@plt                         1     1.25%
>     [.] dl_main                            1     1.25%
>     [.] match_symbol                       1     1.25%
>     [.] sbrk                               1     1.25%
>     [.] strlen                             1     1.25%
> 
> 
>  * changes in v4:
>   - fix a tui navigation bug
>   - fix a bug in output change of perf diff
>   - move call to perf_hpp__init() out of setup_browser()
>   - fix alignment of some output fields on stdio
> 
>  * changes in v3:
>   - rename to --fields option for consistency  (David)
>   - prevent to add same keys multiple times
>   - change dso sorting to show unknown dsos last
>   - fix minor bugs
> 
>  * changes in v2:
>   - add a cleanup patch using ui__has_annotation()
>   - cleanup default sort order managment
>   - support perf top also
>   - handle elided sort entries properly
>   - add Acked-by's from Ingo
> 
> 
> I pushed the patch series on the 'perf/field-v4' branch in my tree
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git
> 
> 
> Any comments are welcome, please test!
> 
> Thanks,
> Namhyung
> 
> 
> [1] https://lkml.org/lkml/2014/4/10/397
> 
> Namhyung Kim (17):
>   perf tools: Add ->cmp(), ->collapse() and ->sort() to perf_hpp_fmt
>   perf tools: Convert sort entries to hpp formats
>   perf tools: Use hpp formats to sort hist entries
>   perf tools: Support event grouping in hpp ->sort()
>   perf tools: Use hpp formats to sort final output
>   perf tools: Consolidate output field handling to hpp format routines
>   perf ui: Get rid of callback from __hpp__fmt()
>   perf tools: Allow hpp fields to be sort keys
>   perf tools: Consolidate management of default sort orders
>   perf tools: Call perf_hpp__init() before setting up GUI browsers
>   perf report: Add -F option to specify output fields
>   perf tools: Add ->sort() member to struct sort_entry
>   perf report/tui: Fix a bug when --fields/sort is given
>   perf top: Add --fields option to specify output fields
>   perf diff: Add missing setup_output_field()
>   perf tools: Skip elided sort entries
>   perf hists: Reset width of output fields with header length
> 
>  tools/perf/Documentation/perf-report.txt |  10 +
>  tools/perf/Documentation/perf-top.txt    |   9 +
>  tools/perf/builtin-diff.c                |   3 +
>  tools/perf/builtin-report.c              |  31 +--
>  tools/perf/builtin-top.c                 |  12 +-
>  tools/perf/ui/browsers/hists.c           |  76 +++----
>  tools/perf/ui/gtk/hists.c                |  41 +---
>  tools/perf/ui/hist.c                     | 189 ++++++++++++++--
>  tools/perf/ui/setup.c                    |   2 -
>  tools/perf/ui/stdio/hist.c               |  54 ++---
>  tools/perf/util/hist.c                   |  83 ++-----
>  tools/perf/util/hist.h                   |  20 +-
>  tools/perf/util/sort.c                   | 364 ++++++++++++++++++++++++++++++-
>  tools/perf/util/sort.h                   |   4 +
>  14 files changed, 654 insertions(+), 244 deletions(-)
> 
> -- 
> 1.9.2
> 

  parent reply	other threads:[~2014-04-22 21:17 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16  3:05 [PATCHSET 00/17] perf report: Add -F option for specifying output fields (v4) Namhyung Kim
2014-04-16  3:05 ` [PATCH 01/17] perf tools: Add ->cmp(), ->collapse() and ->sort() to perf_hpp_fmt Namhyung Kim
2014-04-16  3:05 ` [PATCH 02/17] perf tools: Convert sort entries to hpp formats Namhyung Kim
2014-04-16  3:05 ` [PATCH 03/17] perf tools: Use hpp formats to sort hist entries Namhyung Kim
2014-04-16  3:05 ` [PATCH 04/17] perf tools: Support event grouping in hpp ->sort() Namhyung Kim
2014-04-16  3:05 ` [PATCH 05/17] perf tools: Use hpp formats to sort final output Namhyung Kim
2014-04-16  3:05 ` [PATCH 06/17] perf tools: Consolidate output field handling to hpp format routines Namhyung Kim
2014-04-16  3:05 ` [PATCH 07/17] perf ui: Get rid of callback from __hpp__fmt() Namhyung Kim
2014-04-16  3:05 ` [PATCH 08/17] perf tools: Allow hpp fields to be sort keys Namhyung Kim
2014-04-16  3:05 ` [PATCH 09/17] perf tools: Consolidate management of default sort orders Namhyung Kim
2014-04-16  3:05 ` [PATCH 10/17] perf tools: Call perf_hpp__init() before setting up GUI browsers Namhyung Kim
2014-04-16  3:05 ` [PATCH 11/17] perf report: Add -F option to specify output fields Namhyung Kim
2014-04-16  3:05 ` [PATCH 12/17] perf tools: Add ->sort() member to struct sort_entry Namhyung Kim
2014-04-16  3:05 ` [PATCH 13/17] perf report/tui: Fix a bug when --fields/sort is given Namhyung Kim
2014-04-16  3:05 ` [PATCH 14/17] perf top: Add --fields option to specify output fields Namhyung Kim
2014-04-16  3:05 ` [PATCH 15/17] perf diff: Add missing setup_output_field() Namhyung Kim
2014-04-16  3:05 ` [PATCH 16/17] perf tools: Skip elided sort entries Namhyung Kim
2014-04-16  3:05 ` [PATCH 17/17] perf hists: Reset width of output fields with header length Namhyung Kim
2014-04-22 21:16 ` Don Zickus [this message]
2014-04-23  6:15   ` [PATCHSET 00/17] perf report: Add -F option for specifying output fields (v4) Namhyung Kim
2014-04-23 12:58     ` Don Zickus
2014-04-24 13:41       ` Namhyung Kim
2014-04-24 21:00         ` Don Zickus
2014-04-25  7:58           ` Namhyung Kim
2014-04-28 19:46           ` Don Zickus
2014-04-29  1:13             ` Namhyung Kim
2014-04-29 17:27               ` Don Zickus
2014-04-29 23:38                 ` Namhyung Kim
2014-04-30 13:35                   ` Don Zickus
2014-05-07  3:05                     ` Namhyung Kim
2014-05-07 15:22                       ` Don Zickus
2014-05-09  6:11                         ` Namhyung Kim
2014-05-09 13:33                           ` Don Zickus
2014-05-04 17:53 ` Jiri Olsa
2014-05-07  3:09   ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140422211647.GO8488@redhat.com \
    --to=dzickus@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.