2012-08-07 13:20:43 +00:00
|
|
|
#ifndef __PERF_REGS_H
|
|
|
|
#define __PERF_REGS_H
|
|
|
|
|
2014-04-25 19:31:02 +00:00
|
|
|
#include <linux/types.h>
|
2015-09-24 21:53:49 +00:00
|
|
|
#include <linux/compiler.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-17 17:39:10 +00:00
|
|
|
|
|
|
|
struct regs_dump;
|
2014-01-07 12:47:29 +00:00
|
|
|
|
2015-08-31 16:41:11 +00:00
|
|
|
struct sample_reg {
|
|
|
|
const char *name;
|
|
|
|
uint64_t mask;
|
|
|
|
};
|
2015-09-01 09:30:14 +00:00
|
|
|
#define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
|
|
|
|
#define SMPL_REG_END { .name = NULL }
|
2015-08-31 16:41:11 +00:00
|
|
|
|
|
|
|
extern const struct sample_reg sample_reg_masks[];
|
|
|
|
|
2013-09-30 10:07:11 +00:00
|
|
|
#ifdef HAVE_PERF_REGS_SUPPORT
|
2012-08-07 13:20:43 +00:00
|
|
|
#include <perf_regs.h>
|
2014-01-07 12:47:29 +00:00
|
|
|
|
|
|
|
int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
|
|
|
|
|
2012-08-07 13:20:43 +00: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-17 17:39:10 +00:00
|
|
|
#define PERF_REGS_MAX 0
|
2012-08-07 13:20:43 +00:00
|
|
|
|
2012-09-10 22:15:03 +00:00
|
|
|
static inline const char *perf_reg_name(int id __maybe_unused)
|
2012-08-07 13:20:43 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-01-07 12:47:29 +00: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 10:07:11 +00:00
|
|
|
#endif /* HAVE_PERF_REGS_SUPPORT */
|
2012-08-07 13:20:43 +00:00
|
|
|
#endif /* __PERF_REGS_H */
|