linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv4 00/13] perf tools: Speedup DWARF unwind
@ 2014-06-04 14:36 Jiri Olsa
  2014-06-04 14:36 ` [PATCH 01/13] perf tools: Cache register accesses for unwind processing Jiri Olsa
                   ` (13 more replies)
  0 siblings, 14 replies; 29+ messages in thread
From: Jiri Olsa @ 2014-06-04 14:36 UTC (permalink / raw)
  To: linux-kernel
  Cc: Arnaldo Carvalho de Melo, Corey Ashford, David Ahern,
	Frederic Weisbecker, Ingo Molnar, Jean Pihet, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Jiri Olsa

hi,
trying to speedup DWARF unwind report code by factoring
related code:
  - caching sample's registers access
  - keep dso data file descriptor open for the
    life of the dso object
  - replace dso cache code by mapping dso data file
    directly for the life of the dso object

The speedup is mainly for libunwind unwind. The libdw will benefit
mainly from cached registers access, because it handles dso data
accesses by itself.. and anyway it's still faster ;-).

On ~11GB perf data file with dwarf unwind data I've got
around 30% speed up.

I've also got possitive test feedback from Jean Pihet:
  https://wiki.linaro.org/LEG/Engineering/TOOLS/perf-callstack-unwinding#Speed_improvement

v4 changes:
  - fixed changelog for patch 6 (David Ahern)
  - added Reviewed-by from David Ahern for some patches
  - other minor fixies pointed by David Ahern

v3 changes:
  - moved the cache logic into dso__data_fd (Namhyung Kim)
  - omited test_dso_data__fd_limit variable,
    dso data cache test changed accordingly (Namhyung Kim)
  - several small fixies from review (Namhyung Kim)

v2 changes:
  - adding limit for open dso objects with sort of LRU
    mechanism to pick up and close dso objects if we
    are over the limit
  - file mmaping changes are omitted, because I couldn't prove
    the improvement exactly, will resubmit later
  - added dso close logic in case of no memory
  - added tests


Also reachable in here:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/core_unwind_speedup

thanks,
jirka

Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Jiri Olsa (13):
      perf tools: Cache register accesses for unwind processing
      perf tools: Separate dso data related variables
      perf tools: Add data_fd into dso object
      perf tools: Add global list of opened dso objects
      perf tools: Add global count of opened dso objects
      perf tools: Cache dso data file descriptor
      perf tools: Add file size check and factor dso__data_read_offset
      perf tools: Allow to close dso fd in case of open failure
      perf tools: Add dso__data_* interface descriptons
      perf tests: Spawn child for each test
      perf tests: Allow reuse of test_file function
      perf tests: Add test for caching dso file descriptors
      perf tests: Add test for closing dso objects on EMFILE error

 tools/perf/tests/builtin-test.c    |  42 ++++++++++++++-
 tools/perf/tests/dso-data.c        | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 tools/perf/tests/tests.h           |   2 +
 tools/perf/util/dso.c              | 279 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
 tools/perf/util/dso.h              |  50 +++++++++++++++++-
 tools/perf/util/event.h            |   5 ++
 tools/perf/util/perf_regs.c        |  10 +++-
 tools/perf/util/perf_regs.h        |   4 +-
 tools/perf/util/unwind-libunwind.c |   2 -
 9 files changed, 572 insertions(+), 36 deletions(-)

^ permalink raw reply	[flat|nested] 29+ messages in thread
* [PATCHv3 00/13] perf tools: Speedup DWARF unwind
@ 2014-06-02 21:18 Jiri Olsa
  2014-06-02 21:18 ` [PATCH 03/13] perf tools: Add data_fd into dso object Jiri Olsa
  0 siblings, 1 reply; 29+ messages in thread
From: Jiri Olsa @ 2014-06-02 21:18 UTC (permalink / raw)
  To: linux-kernel
  Cc: Arnaldo Carvalho de Melo, Corey Ashford, David Ahern,
	Frederic Weisbecker, Ingo Molnar, Jean Pihet, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Jiri Olsa

hi,
trying to speedup DWARF unwind report code by factoring
related code:
  - caching sample's registers access
  - keep dso data file descriptor open for the
    life of the dso object
  - replace dso cache code by mapping dso data file
    directly for the life of the dso object

The speedup is mainly for libunwind unwind. The libdw will benefit
mainly from cached registers access, because it handles dso data
accesses by itself.. and anyway it's still faster ;-).

v3 changes:
  - moved the cache logic into dso__data_fd (Namhyung Kim)
  - omited test_dso_data__fd_limit variable,
    dso data cache test changed accordingly (Namhyung Kim)
  - several small fixies from review (Namhyung Kim)

v2 changes:
  - adding limit for open dso objects with sort of LRU
    mechanism to pick up and close dso objects if we
    are over the limit
  - file mmaping changes are omitted, because I couldn't prove
    the improvement exactly, will resubmit later
  - added dso close logic in case of no memory
  - added tests

On 10GB perf data file with dwarf unwind data I've got
around 30% speed up.

Also reachable in here:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/core_unwind_speedup

thanks,
jirka

Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Jiri Olsa (13):
      perf tools: Cache register accesses for unwind processing
      perf tools: Separate dso data related variables
      perf tools: Add data_fd into dso object
      perf tools: Add global list of opened dso objects
      perf tools: Add global count of opened dso objects
      perf tools: Cache dso data file descriptor
      perf tools: Add file size check and factor dso__data_read_offset
      perf tools: Allow to close dso fd in case of open failure
      perf tools: Add dso__data_* interface descriptons
      perf tests: Spawn child for each test
      perf tests: Allow reuse of test_file function
      perf tests: Add test for caching dso file descriptors
      perf tests: Add test for closing dso objects on EMFILE error

 tools/perf/tests/builtin-test.c    |  42 ++++++++++++++-
 tools/perf/tests/dso-data.c        | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 tools/perf/tests/tests.h           |   2 +
 tools/perf/util/dso.c              | 279 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
 tools/perf/util/dso.h              |  50 +++++++++++++++++-
 tools/perf/util/event.h            |   5 ++
 tools/perf/util/perf_regs.c        |  10 +++-
 tools/perf/util/perf_regs.h        |   4 +-
 tools/perf/util/unwind-libunwind.c |   2 -
 9 files changed, 572 insertions(+), 36 deletions(-)

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

end of thread, other threads:[~2014-06-13  6:27 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-04 14:36 [PATCHv4 00/13] perf tools: Speedup DWARF unwind Jiri Olsa
2014-06-04 14:36 ` [PATCH 01/13] perf tools: Cache register accesses for unwind processing Jiri Olsa
2014-06-13  6:24   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:36 ` [PATCH 02/13] perf tools: Separate dso data related variables Jiri Olsa
2014-06-13  6:25   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:36 ` [PATCH 03/13] perf tools: Add data_fd into dso object Jiri Olsa
2014-06-13  6:25   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:36 ` [PATCH 04/13] perf tools: Add global list of opened dso objects Jiri Olsa
2014-06-13  6:25   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:36 ` [PATCH 05/13] perf tools: Add global count " Jiri Olsa
2014-06-13  6:25   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:36 ` [PATCH 06/13] perf tools: Cache dso data file descriptor Jiri Olsa
2014-06-13  6:25   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:36 ` [PATCH 07/13] perf tools: Add file size check and factor dso__data_read_offset Jiri Olsa
2014-06-13  6:26   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:36 ` [PATCH 08/13] perf tools: Allow to close dso fd in case of open failure Jiri Olsa
2014-06-13  6:26   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:36 ` [PATCH 09/13] perf tools: Add dso__data_* interface descriptons Jiri Olsa
2014-06-13  6:26   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:36 ` [PATCH 10/13] perf tests: Spawn child for each test Jiri Olsa
2014-06-13  6:26   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:37 ` [PATCH 11/13] perf tests: Allow reuse of test_file function Jiri Olsa
2014-06-13  6:26   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:37 ` [PATCH 12/13] perf tests: Add test for caching dso file descriptors Jiri Olsa
2014-06-13  6:27   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-04 14:37 ` [PATCH 13/13] perf tests: Add test for closing dso objects on EMFILE error Jiri Olsa
2014-06-13  6:27   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-06-10  5:01 ` [PATCHv4 00/13] perf tools: Speedup DWARF unwind Namhyung Kim
  -- strict thread matches above, loose matches on Subject: below --
2014-06-02 21:18 [PATCHv3 " Jiri Olsa
2014-06-02 21:18 ` [PATCH 03/13] perf tools: Add data_fd into dso object Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).