09 Dec, 2014

1 commit

  • The nr_events variable in tools/perf/ui/browsers/hists.c is of type u64,
    so the print format (%lu) causes 'perf report' to show 0 event count
    when running with 32-bit userspace without redirection.

    This patch fixes that problem by printing nr_events as PRIu64.

    Signed-off-by: Tom Huynh
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Kim Phillips
    Cc: Matt Mullins
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1417541842-9747-1-git-send-email-tom.huynh@freescale.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Tom Huynh
     

24 Nov, 2014

2 commits

  • If first level callchain has more than single path like when -g caller
    option is given, it should show only first one in the path and hide
    others. But it didn't do it properly and just hindered the output.

    Before:
    - 80.33% 11.11% abc2 abc2 [.] main
    + 86.18% main
    13.82% __libc_start_main
    main

    After:
    - 80.33% 11.11% abc2 abc2 [.] main
    + 86.18% main
    + 13.82% __libc_start_main

    Signed-off-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1416816807-6495-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Currently perf report on TUI doesn't print percent for first-level
    callchain entry.

    I guess it (wrongly) assumes that there's only a single callchain in the
    first level.

    This patch fixes it by handling the first level callchains same as
    others - if it's not 100% it should print the percent value.

    Also it'll affect other callchains in the other way around - if it's
    100% (single callchain) it should not print the percentage.

    Before:
    - 30.95% 6.84% abc2 abc2 [.] a
    - a
    - 70.00% c
    - 100.00% apic_timer_interrupt
    smp_apic_timer_interrupt
    local_apic_timer_interrupt
    hrtimer_interrupt
    ...
    + 30.00% b
    + __libc_start_main

    After:
    - 30.95% 6.84% abc2 abc2 [.] a
    - 77.90% a
    - 70.00% c
    - apic_timer_interrupt
    smp_apic_timer_interrupt
    local_apic_timer_interrupt
    hrtimer_interrupt
    ...
    + 30.00% b
    + 22.10% __libc_start_main

    Reported-by: Arnaldo Carvalho de Melo
    Signed-off-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1416816807-6495-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

19 Nov, 2014

1 commit

  • Refactor the duplicated code to resolve the symbol name or
    the address of a symbol into a single function.

    Used in next patch to add common functionality.

    Signed-off-by: Andi Kleen
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1415844328-4884-6-git-send-email-andi@firstfloor.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Andi Kleen
     

16 Oct, 2014

1 commit

  • When 'perf top' is run, one can't easily find a difference
    between -z option and normal output.
    So I added a visual cue to know whether it is the zeroing or not.

    Output is as below.

    Before:
    $ perf top

    Samples: 61K of event 'cycles', Event count (approx.): 3908136933
    Overhead Shared Object Symbol
    1.42% firefox [.] 0x0000000000011e76
    1.32% libpthread-2.17.so [.] pthread_mutex_lock

    If you press key 'z' or run with zero option like '$ perf top --zero', it is as below.

    After:
    Samples: 61K of event 'cycles', Event count (approx.): 3908136933 [z]
    Overhead Shared Object Symbol
    1.42% firefox [.] 0x0000000000011e76
    1.32% libpthread-2.17.so [.] pthread_mutex_lock

    Signed-off-by: Taeung Song
    Acked-by: Namhyung Kim
    Cc: Namhyung Kim
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1412665995-26359-1-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     

10 Oct, 2014

1 commit

  • Not all tools need a hists instance per perf_evsel, so lets pave the way
    to remove evsel->hists while leaving a way to access the hists from a
    specially allocated evsel, one that comes with space at the end where
    lives the evsel.

    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jean Pihet
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-qlktkhe31w4mgtbd84035sr2@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

26 Sep, 2014

1 commit

  • Currently perf report -g graph option doesn't work as expected and
    always work as same as -g fractal. This was a bug during recent
    callchain print code cleanup.

    Before:
    $ perf report -g graph

    Children Self Command Shared Object Symbol
    ================================================================
    - 56.19% 35.41% sleep [kernel.kallsyms] [k] page_fault
    - page_fault
    + 63.02% _dl_relocate_object
    + 36.98% clear_user

    After:
    Children Self Command Shared Object Symbol
    ================================================================
    - 56.19% 35.41% sleep [kernel.kallsyms] [k] page_fault
    - page_fault
    + 35.41% _dl_relocate_object
    + 20.78% clear_user

    Reviewed-by: David Ahern
    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1411434104-5307-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

24 Aug, 2014

1 commit

  • Currently there're two callchain print functions in TUI - one for the
    hists browser and another for file dump. They do almost same job so
    it'd be better consolidate the codes.

    To do that, provide two callbacks to the generic logic - one for
    printing and another for checking whether it should stop.

    Signed-off-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1408666401-594-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

23 Aug, 2014

1 commit

  • The hist_browser__show_callchain() and friends don't need to be that
    complex. They're splitted in 3 pieces - one for traversing top-level
    tree, other one for special casing first chains in the top-level
    entries, and last one for recursive traversing inner trees. It led to
    code duplication and unnecessary complexity IMHO.

    Simplify the function and consolidate the logic into a single function
    - it can recursively call itself. A little difference in printing
    callchains in top-level tree can be handled with a small change.

    It should have no functional change.

    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1408583746-5540-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

20 Aug, 2014

2 commits

  • Factor out duplicate callchain printing code into the hist_browser__
    show_callchain_entry().

    Signed-off-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1408522080-26556-3-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • It seems that the 'remaining' variable is not used by any real code.

    Signed-off-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1408522080-26556-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

14 Aug, 2014

2 commits

  • The perf top TUI lacks 'z' key support to toggle sample zeroing.
    Add it.

    Reported-by: Stephane Eranian
    Tested-by: Stephane Eranian
    Signed-off-by: Namhyung Kim
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1407831366-28892-2-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • The currently when perf TUI report shows callchain, the first level
    chains have bogus '+' sign even though only the last one has children.

    Since they are on a single line of the chain, toggling intermediate
    entries has no effect. Fix it to show '+' sign at the last entry only.
    Note that non-first level callchain entries don't have this problem.

    Before:
    ---------------------------------------------------------------------------
    Children Self Command Shared Object Symbols
    - 40.70% 0.00% swapper [kernel.kallsyms] [k] cpuidle_wrap_enter
    + cpuidle_wrap_enter
    + cpuidle_enter_tk
    + cpuidle_idle_call
    + cpu_idle

    After:
    ---------------------------------------------------------------------------
    Children Self Command Shared Object Symbols
    - 40.70% 0.00% swapper [kernel.kallsyms] [k] cpuidle_wrap_enter
    cpuidle_wrap_enter
    cpuidle_enter_tk
    cpuidle_idle_call
    + cpu_idle

    Signed-off-by: Namhyung Kim
    Acked-by: Ingo Molnar
    Cc: Andi Kleen
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Frederic Weisbecker
    Link: http://lkml.kernel.org/r/1407909761-10822-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

12 Aug, 2014

4 commits

  • If user sets ui.show-headers config option to false, it didn't calculate
    default column width so it broke the alignment. This is because it does
    the calculation just before showing headers.

    Move it to the beginning of the hist browser so that it can be called
    regardless of the config option.

    Reported-by: Jiri Olsa
    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1406785662-5534-8-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Set column width and do not change it if user gives -w/--column-widths
    option. It'll truncate longer symbols than the width if exists.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1406785662-5534-5-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Save column length in the hpp format and pass it to print functions.
    This is a preparation for users to control column width in the output.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1406785662-5534-4-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • So that it can properly handle alignment requirements later. To do
    that, add percent_color_len_snprintf() fucntion to help coloring of
    overhead columns.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1406785662-5534-3-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

08 Jul, 2014

1 commit

  • Adding ui.show-headers config file option to define if the histogram
    entries headers will start visible or not.

    Currently columns headers are displayed by default, following
    lines in ~/.perfconfig file will disable that:

    [ui]
    show-headers = false

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1403886418-5556-4-git-send-email-jolsa@kernel.org
    [ renamed symbol_conf.show_headers to .show_hist_headers ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

07 Jul, 2014

5 commits

  • Displaying columns header text whenever 'H' is pressed,
    and hiding it on on another press.

    Signed-off-by: Jiri Olsa
    Cc: Arnaldo Carvalho de Melo
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-w9pcqpum5erza2a05ysvollz@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Open up space to show a one-line header text whenever 'H' is pressed,
    hide it on another key press.

    Follow up patch will format this line from the set of headers used.

    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-m894d6qk30h3qofw4k8neq4q@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • This requires some more work so that we can really just use the width of
    current entries when we want to partition the screen.

    Right now its just a prep patch so that we can have where to update
    ui_browser->rows when introducing the column headers line, that will be
    togglable, so we need to update it everytime we refresh the dimensions
    of the browser.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-ovk654rx525b4657y0mh6ku9@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • That will allow us to add a row offset to open up space for the column
    headers.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-otc3ployokfci5qi81o7jo22@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • The ui_browser->height is about the whole browser "window", including
    any header, status lines or any other space needed for some "Yes", "No",
    etc buttons a descendent browser, like hist_browser, may have.

    Since the navigation is done mostly on the ui_browser methods, it needs
    to know how many rows are on the screen, while details about what other
    components are, say, if a header (that may be composed of multiple
    lines, etc) is present.

    Besides this we'll need to add a ui_browser->refresh_dimensions() hook
    so that browsers like hist_browser can update ->rows in response to
    screen resizes, this will come in a follow up patch.

    This patch just adds ->rows and updates it when updating ->height, keeps
    using ->height for the only other widget that can come with ui_browser,
    the scrollbar, that goes on using all the height on the rightmost column
    in the screen, using ->rows for the keyboard navigation needs.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Don Zickus
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-xexmwg1mv7u03j5imn66jdak@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

25 Jun, 2014

1 commit

  • …/acme/linux into perf/core

    Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

    User visible changes:

    * Add --repeat global option to 'perf bench' to be used in benchmarks
    such as the existing 'futex' one, that was modified to use it instead
    of a local option. (Davidlohr Bueso)

    * Fix fd -> pathname resolution in 'trace', be it using /proc or
    a vfs_getname probe point. (Arnaldo Carvalho de Melo)

    * Add suggestion of how to set perf_event_paranoid sysctl, to help
    non-root users trying tools like 'trace' to get a working environment.
    (Arnaldo Carvalho de Melo)

    Fixes:

    * Fix memory leak in the 'sched-messaging' perf bench test. (Davidlohr Bueso)

    * The -o and -n 'perf bench mem' options are mutually exclusive, emit error
    when both are specified. (Davidlohr Bueso)

    * Fix scrollbar refresh row index in the ui browser, problem exposed now
    that headers will be added and will be allowed to be switched on/off.
    (Jiri Olsa)

    Cleanups:

    * Remove needless reassignments in 'trace' (Arnaldo Carvalho de Melo)

    * Cache the is_exit syscall test in 'trace) (Arnaldo Carvalho de Melo)

    * No need to reimplement err() in 'perf bench sched-messaging', drop barf().
    (Davidlohr Bueso).

    * Remove ev_name argument from perf_evsel__hists_browse, can be obtained
    from the other parameters. (Jiri Olsa)

    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

20 Jun, 2014

2 commits

  • When cumulative callchain mode is on, we could get samples with
    with no actual hits. This breaks the assumption of the annotation
    code, that each sample has annotation counts allocated and leads
    to segfault.

    Fixing this by additional checks for annotation stats.

    Acked-by: Namhyung Kim
    Acked-by: Arnaldo Carvalho de Melo
    Cc: Arnaldo Carvalho de Melo
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1402821332-12419-1-git-send-email-jolsa@kernel.org
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     
  • Removing ev_name argument from perf_evsel__hists_browse function,
    because it's not needed. We can get the name out of the 'struct
    perf_evsel' which is passed as argument as well.

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1403178076-14072-3-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

04 Jun, 2014

1 commit

  • After output/sort fields refactoring, it's expensive
    to check the elide bool in its current location inside
    the 'struct sort_entry'.

    The perf_hpp__should_skip function gets highly noticable in
    workloads with high number of output/sort fields, like for:

    $ perf report -i perf-test.data -F overhead,sample,period,comm,pid,dso,symbol,cpu --stdio

    Performance report:
    9.70% perf [.] perf_hpp__should_skip

    Moving the elide bool into the 'struct perf_hpp_fmt', which
    makes the perf_hpp__should_skip just single struct read.

    Got speedup of around 22% for my test perf.data workload.
    The change should not harm any other workload types.

    Performance counter stats for (10 runs):
    before:
    358,319,732,626 cycles ( +- 0.55% )
    467,129,581,515 instructions # 1.30 insns per cycle ( +- 0.00% )

    150.943975206 seconds time elapsed ( +- 0.62% )

    now:
    278,785,972,990 cycles ( +- 0.12% )
    370,146,797,640 instructions # 1.33 insns per cycle ( +- 0.00% )

    116.416670507 seconds time elapsed ( +- 0.31% )

    Acked-by: Namhyung Kim
    Cc: Arnaldo Carvalho de Melo
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/20140601142622.GA9131@krava.brq.redhat.com
    Signed-off-by: Jiri Olsa

    Jiri Olsa
     

01 Jun, 2014

2 commits

  • If -g cumulative option is given, it needs to show entries which don't
    have self overhead. So apply percent-limit to accumulated overhead
    percentage in this case.

    Signed-off-by: Namhyung Kim
    Tested-by: Arun Sharma
    Tested-by: Rodrigo Campos
    Cc: Frederic Weisbecker
    Link: http://lkml.kernel.org/r/1401335910-16832-14-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • Print accumulated stat of a hist entry if requested.

    Signed-off-by: Namhyung Kim
    Tested-by: Arun Sharma
    Tested-by: Rodrigo Campos
    Cc: Frederic Weisbecker
    Link: http://lkml.kernel.org/r/1401335910-16832-12-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     

21 May, 2014

5 commits

  • When it converted sort entries to hpp formats, it missed se->elide
    handling, so add it for compatibility.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1400480762-22852-16-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • The hists__filter_entries() function is called when down arrow key is
    pressed for navigating through the entries in TUI. It has a check for
    filtering out entries that have very small overhead (under min_pcnt).

    However it just assumed the entries are sorted by the overhead so when
    it saw such a small overheaded entry, it just stopped navigating as an
    optimization. But it's not true anymore due to new --fields and
    --sort optoin behavior and this case users cannot go down to a next
    entry if ther's an entry with small overhead in-between.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1400480762-22852-14-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • So that it can be set properly prior to set up output fields. That
    makes easy to handle/warn errors during the setup since it doesn't
    need to be bothered with the GUI.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1400480762-22852-11-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • The callback was used by TUI for determining color of folded sign
    using percent of first field/column. But it cannot be used anymore
    since it now support dynamic reordering of output field.

    So move the logic to the hist_browser__show_entry().

    Signed-off-by: Namhyung Kim
    Acked-by: Ingo Molnar
    Link: http://lkml.kernel.org/r/1400480762-22852-8-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • Until now the hpp and sort functions do similar jobs different ways.
    Since the sort functions converted/wrapped to hpp formats it can do
    the job in a uniform way.

    The perf_hpp__sort_list has a list of hpp formats to sort entries and
    the perf_hpp__list has a list of hpp formats to print output result.

    To have a backward compatibility, it automatically adds 'overhead'
    field in front of sort list. And then all of fields in sort list
    added to the output list (if it's not already there).

    Signed-off-by: Namhyung Kim
    Acked-by: Ingo Molnar
    Link: http://lkml.kernel.org/n/tip-7g3h86woz2sckg3h1lj42ygj@git.kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     

24 Apr, 2014

4 commits

  • When TUI hist browser expands/collapses callchains it accounted number
    of callchain nodes into total entries to show. However this code
    ignores filtering so that it can make the cursor go to out of screen.

    Thanks to Jiri Olsa for pointing out a bug (and a fix) in the code.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-12-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • The hist_browser__reset() is only called right after a filter is
    applied so it needs to udpate browser->nr_entries properly. We cannot
    use hists->nr_non_filtered_entreis directly since it's possible that
    such entries are also filtered out by minimum percentage limit.

    In addition when a filter is used for perf top, hist browser's
    nr_entries field was not updated after applying the filter. But it
    needs to be updated as new samples are coming.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-11-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • Rename ->nr_pcnt_entries and hist_browser__update_pcnt_entries() to
    ->nr_non_filtered_entries and hist_browser__update_nr_entries() since
    it's now used for filtering as well.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-10-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • The nr_entries variable is increased inside the loop in the function
    but it always count the first entry regardless of it's filtered or
    not; caused an off-by-one error.

    It'd become a problem especially there's no entry at all - it'd get a
    segfault during referencing a NULL pointer.

    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1398327843-31845-9-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     

16 Apr, 2014

2 commits

  • Add 'F' hotkey to toggle relative and absolute percentage of filtered
    entries.

    Suggested-by: Jiri Olsa
    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1397145720-8063-7-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim
     
  • The --percentage option is for controlling overhead percentage
    displayed. It can only receive either of "relative" or "absolute".

    "relative" means it's relative to filtered entries only so that the
    sum of shown entries will be always 100%. "absolute" means it retains
    the original value before and after the filter is applied.

    $ perf report -s comm
    # Overhead Command
    # ........ ............
    #
    74.19% cc1
    7.61% gcc
    6.11% as
    4.35% sh
    4.14% make
    1.13% fixdep
    ...

    $ perf report -s comm -c cc1,gcc --percentage absolute
    # Overhead Command
    # ........ ............
    #
    74.19% cc1
    7.61% gcc

    $ perf report -s comm -c cc1,gcc --percentage relative
    # Overhead Command
    # ........ ............
    #
    90.69% cc1
    9.31% gcc

    Note that it has zero effect if no filter was applied.

    Suggested-by: Arnaldo Carvalho de Melo
    Signed-off-by: Namhyung Kim
    Link: http://lkml.kernel.org/r/1397145720-8063-3-git-send-email-namhyung@kernel.org
    Signed-off-by: Jiri Olsa

    Namhyung Kim