2012-08-07 21:20:43 +08:00
|
|
|
#ifndef __PERF_REGS_H
|
|
|
|
#define __PERF_REGS_H
|
|
|
|
|
2014-04-26 03:31:02 +08:00
|
|
|
#include <linux/types.h>
|
perf tools: Cache register accesses for unwind processing
Caching registers value into an array. Got about 4% speed up
of perf_reg_value function for report command processing
dwarf unwind stacks.
Output from report over 1.5 GB data with DWARF unwind stacks:
(TODO fix perf diff)
current code:
5.84% perf perf [.] perf_reg_value
change:
1.94% perf perf [.] perf_reg_value
And little bit of overall speed up:
(perf stat -r 5 -e '{cycles,instructions}:u' ...)
current code:
310,298,611,754 cycles ( +- 0.33% )
439,669,689,341 instructions ( +- 0.03% )
188.656753166 seconds time elapsed ( +- 0.82% )
change:
291,315,329,878 cycles ( +- 0.22% )
391,763,485,304 instructions ( +- 0.03% )
180.742249687 seconds time elapsed ( +- 0.64% )
Acked-by: Namhyung Kim <namhyung@kernel.org>
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>
Link: http://lkml.kernel.org/r/1401892622-30848-2-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
2014-04-18 01:39:10 +08:00
|
|
|
|
|
|
|
struct regs_dump;
|
2014-01-07 20:47:29 +08:00
|
|
|
|
2015-09-01 00:41:11 +08:00
|
|
|
struct sample_reg {
|
|
|
|
const char *name;
|
|
|
|
uint64_t mask;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern const struct sample_reg sample_reg_masks[];
|
|
|
|
|
2013-09-30 18:07:11 +08:00
|
|
|
#ifdef HAVE_PERF_REGS_SUPPORT
|
2012-08-07 21:20:43 +08:00
|
|
|
#include <perf_regs.h>
|
2014-01-07 20:47:29 +08:00
|
|
|
|
|
|
|
int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
|
|
|
|
|
2012-08-07 21:20:43 +08:00
|
|
|
#else
|
|
|
|
#define PERF_REGS_MASK 0
|
perf tools: Cache register accesses for unwind processing
Caching registers value into an array. Got about 4% speed up
of perf_reg_value function for report command processing
dwarf unwind stacks.
Output from report over 1.5 GB data with DWARF unwind stacks:
(TODO fix perf diff)
current code:
5.84% perf perf [.] perf_reg_value
change:
1.94% perf perf [.] perf_reg_value
And little bit of overall speed up:
(perf stat -r 5 -e '{cycles,instructions}:u' ...)
current code:
310,298,611,754 cycles ( +- 0.33% )
439,669,689,341 instructions ( +- 0.03% )
188.656753166 seconds time elapsed ( +- 0.82% )
change:
291,315,329,878 cycles ( +- 0.22% )
391,763,485,304 instructions ( +- 0.03% )
180.742249687 seconds time elapsed ( +- 0.64% )
Acked-by: Namhyung Kim <namhyung@kernel.org>
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>
Link: http://lkml.kernel.org/r/1401892622-30848-2-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
2014-04-18 01:39:10 +08:00
|
|
|
#define PERF_REGS_MAX 0
|
2012-08-07 21:20:43 +08:00
|
|
|
|
2012-09-11 06:15:03 +08:00
|
|
|
static inline const char *perf_reg_name(int id __maybe_unused)
|
2012-08-07 21:20:43 +08:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-01-07 20:47:29 +08:00
|
|
|
|
|
|
|
static inline int perf_reg_value(u64 *valp __maybe_unused,
|
|
|
|
struct regs_dump *regs __maybe_unused,
|
|
|
|
int id __maybe_unused)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2013-09-30 18:07:11 +08:00
|
|
|
#endif /* HAVE_PERF_REGS_SUPPORT */
|
2012-08-07 21:20:43 +08:00
|
|
|
#endif /* __PERF_REGS_H */
|