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>
|
2015-09-25 05:53:49 +08: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-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;
|
|
|
|
};
|
2015-09-01 17:30:14 +08:00
|
|
|
#define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
|
|
|
|
#define SMPL_REG_END { .name = NULL }
|
2015-09-01 00:41:11 +08:00
|
|
|
|
|
|
|
extern const struct sample_reg sample_reg_masks[];
|
|
|
|
|
2017-03-28 17:47:53 +08:00
|
|
|
enum {
|
|
|
|
SDT_ARG_VALID = 0,
|
|
|
|
SDT_ARG_SKIP,
|
|
|
|
};
|
|
|
|
|
|
|
|
int arch_sdt_arg_parse_op(char *old_op, char **new_op);
|
2016-12-14 08:07:32 +08:00
|
|
|
|
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 */
|