All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 00/11] perf/core improvements and fixes
@ 2014-04-24 15:40 Jiri Olsa
  2014-04-24 15:40 ` [PATCH 01/11] perf report: Count number of entries separately Jiri Olsa
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: Jiri Olsa @ 2014-04-24 15:40 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Corey Ashford,
	David Ahern, Frederic Weisbecker, Jiri Olsa, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Jiri Olsa

hi Ingo,
please consider pulling

thanks,
jirka


The following changes since commit a81fef347b32dea2b31275826afe1c93fa0d2d54:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-04-22 20:28:23 +0200)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo

for you to fetch changes up to c3b789527b236873557f53740ceac47747e0e1cb:

  perf hists/tui: Count callchain rows separately (2014-04-24 16:34:27 +0200)

----------------------------------------------------------------
perf/core improvements and fixes:

. Factor hists statistics counts processing which in turn also
  fixes several bugs in TUI report command (Namhyung Kim)

Signed-off-by: Jiri Olsa <jolsa@kernel.org>

----------------------------------------------------------------
Namhyung Kim (11):
      perf report: Count number of entries separately
      perf hists: Rename hists__inc_stats()
      perf hists: Move column length calculation out of hists__inc_stats()
      perf hists: Add a couple of hists stat helper functions
      perf hists: Collapse expanded callchains after filter is applied
      perf tools: Account entry stats when it's added to the output tree
      perf hists: Add missing update on filtered stats in hists__decay_entries()
      perf ui/tui: Fix off-by-one in hist_browser__update_nr_entries()
      perf ui/tui: Rename hist_browser__update_nr_entries()
      perf top/tui: Update nr_entries properly after a filter is applied
      perf hists/tui: Count callchain rows separately

 tools/perf/builtin-annotate.c  |  3 +-
 tools/perf/builtin-diff.c      | 23 ++++++-----
 tools/perf/builtin-report.c    | 64 ++++++++++++++---------------
 tools/perf/ui/browsers/hists.c | 92 +++++++++++++++++++++++++++++-------------
 tools/perf/util/hist.c         | 83 ++++++++++++++++++++++++-------------
 tools/perf/util/hist.h         |  9 ++++-
 6 files changed, 171 insertions(+), 103 deletions(-)

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCHSET 00/11] perf tools: Fixup for the --percentage change (v3)
@ 2014-04-24  8:23 Namhyung Kim
  2014-04-24  8:23 ` [PATCH 02/11] perf hists: Rename hists__inc_stats() Namhyung Kim
  0 siblings, 1 reply; 14+ messages in thread
From: Namhyung Kim @ 2014-04-24  8:23 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
	Namhyung Kim, LKML, David Ahern, Andi Kleen

Hello,

This patchset tries to fix bugs in percentage handling which is
recently changed.  The perf top with symbol filter could cause a
segfault (NULL pointer dereference) if the filter found no entry.

In this patchset, I moved accounting of various histogram stats to be
calculated at the time it actually shown to users.  Although I tested
it on my system for a while, it needs more testing since it'll affect
behaviors of many commands/usages.

There're three main fields in the hists->stats to affect the output:
number of samples, number of hist entries and total periods.

Also there're three stages to process samples: at first, samples are
converted to a hist entry and added to the input tree, and then they are
moved to the collapsed tree if needed, and finally they're moved to the
output tree to be shown to user.

The (part of) stats are accounted when samples are added to the input
tree and then reset before moving to the output tree, and re-counted
during insertion to the output tree.

I can see some reason to do it this way but it's basically not necessary
and could make a problem in multi-threaded programs like perf top.

The perf report does all these passes sequentially in a single thread so
it seems no problem.  But perf top uses two threads - one for gathering
samples (in the input tree) and another for (collapsing and) moving them
to the output tree.  Thus accounting stat in parallel can result in an
inaccurate stats and the output.

So I'd like to get rid of the accounting on the input stage as you can
see it just gets dropped before doing output resort.  I originally make
the all three stats are accounted when doing output resort but changed
mind to account number of samples in the input stage and others in the
output stage.  Because it'd make more sense accounting number of events
(sample event) in the input stage (as all other events are also
accounted in the input stage) and it'd make less changes in code.

So yes, it has a same problem of inaccurate number of samples, but its
impact should be smaller than other stats - seeing increasing sample
count (could be slightly inaccurate) without new entries in the browser.

 * changes in v3)
  - split patch 2/7 into parts  (Jiri)
  - fix a segfault when filtering with unfolded entry  (Jiri)


You can get this on the 'perf/percentage-v12' branch (yes, v12 - as
it's continued from my previous series) in my tree

  git://git.kenrel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git


Any comments, review and testing are welcomed.

Thanks,
Namhyung


Namhyung Kim (11):
  perf report: Count number of entries separately
  perf hists: Rename hists__inc_stats()
  perf hists: Move column length calculation out of hists__inc_stats()
  perf hists: Add a couple of hists stat helper functions
  perf hists: Collapse expanded callchains after filter is applied
  perf tools: Account entry stats when it's added to the output tree
  perf hists: Add missing update on filtered stats in
    hists__decay_entries()
  perf ui/tui: Fix off-by-one in hist_browser__update_nr_entries()
  perf ui/tui: Rename hist_browser__update_nr_entries()
  perf top/tui: Update nr_entries properly after a filter is applied
  perf hists/tui: Count callchain rows separately

 tools/perf/builtin-annotate.c  |   3 +-
 tools/perf/builtin-diff.c      |  23 ++++----
 tools/perf/builtin-report.c    |  64 +++++++++++-----------
 tools/perf/ui/browsers/hists.c |  92 ++++++++++++++++++++++----------
 tools/perf/util/hist.c         |  83 ++++++++++++++++++++++++-------------
 tools/perf/util/hist.h         |   9 +++-
 6 files changed, 171 insertions(+), 103 deletions(-)

-- 
1.9.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-04-25  8:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-24 15:40 [GIT PULL 00/11] perf/core improvements and fixes Jiri Olsa
2014-04-24 15:40 ` [PATCH 01/11] perf report: Count number of entries separately Jiri Olsa
2014-04-24 15:40 ` [PATCH 02/11] perf hists: Rename hists__inc_stats() Jiri Olsa
2014-04-24 15:40 ` [PATCH 03/11] perf hists: Move column length calculation out of hists__inc_stats() Jiri Olsa
2014-04-24 15:40 ` [PATCH 04/11] perf hists: Add a couple of hists stat helper functions Jiri Olsa
2014-04-24 15:40 ` [PATCH 05/11] perf hists: Collapse expanded callchains after filter is applied Jiri Olsa
2014-04-24 15:40 ` [PATCH 06/11] perf tools: Account entry stats when it's added to the output tree Jiri Olsa
2014-04-24 15:40 ` [PATCH 07/11] perf hists: Add missing update on filtered stats in hists__decay_entries() Jiri Olsa
2014-04-24 15:40 ` [PATCH 08/11] perf ui/tui: Fix off-by-one in hist_browser__update_nr_entries() Jiri Olsa
2014-04-24 15:40 ` [PATCH 09/11] perf ui/tui: Rename hist_browser__update_nr_entries() Jiri Olsa
2014-04-24 15:40 ` [PATCH 10/11] perf top/tui: Update nr_entries properly after a filter is applied Jiri Olsa
2014-04-24 15:40 ` [PATCH 11/11] perf hists/tui: Count callchain rows separately Jiri Olsa
2014-04-25  8:05 ` [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2014-04-24  8:23 [PATCHSET 00/11] perf tools: Fixup for the --percentage change (v3) Namhyung Kim
2014-04-24  8:23 ` [PATCH 02/11] perf hists: Rename hists__inc_stats() Namhyung Kim

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.