6 #include "../../perf.h" 7 #include "../../util/util.h" 8 #include "../../util/perf_regs.h" 9 #include "../../util/debug.h" 46 SMPL_REG(orig_r3, PERF_REG_POWERPC_ORIG_R3),
48 SMPL_REG(link, PERF_REG_POWERPC_LINK),
51 SMPL_REG(softe, PERF_REG_POWERPC_SOFTE),
52 SMPL_REG(trap, PERF_REG_POWERPC_TRAP),
54 SMPL_REG(dsisr, PERF_REG_POWERPC_DSISR),
59 #define SDT_OP_REGEX1 "^(%r)?([1-2]?[0-9]|3[0-1])$" 62 #define SDT_OP_REGEX2 "^(\\-)?([0-9]+)\\((%r)?([1-2]?[0-9]|3[0-1])\\)$" 68 static int initialized;
117 if (old_op[0] ==
'i') {
118 pr_debug4(
"Skipping unsupported SDT argument: %s\n", old_op);
130 new_len += (int)(rm[2].rm_eo - rm[2].rm_so);
132 *new_op =
zalloc(new_len);
136 scnprintf(*new_op, new_len,
"%%gpr%.*s",
137 (
int)(rm[2].rm_eo - rm[2].rm_so), old_op + rm[2].rm_so);
143 prefix = (rm[1].rm_so == -1) ?
'+' :
'-';
146 new_len += (int)(rm[2].rm_eo - rm[2].rm_so);
147 new_len += (int)(rm[4].rm_eo - rm[4].rm_so);
149 *new_op =
zalloc(new_len);
153 scnprintf(*new_op, new_len,
"%c%.*s(%%gpr%.*s)", prefix,
154 (
int)(rm[2].rm_eo - rm[2].rm_so), old_op + rm[2].rm_so,
155 (
int)(rm[4].rm_eo - rm[4].rm_so), old_op + rm[4].rm_so);
157 pr_debug4(
"Skipping unsupported SDT argument: %s\n", old_op);
const struct sample_reg sample_reg_masks[]
static int sdt_init_op_regex(void)
int arch_sdt_arg_parse_op(char *old_op, char **new_op)
static regex_t sdt_op_regex1
#define pr_debug4(fmt,...)
static regex_t sdt_op_regex2
void static void * zalloc(size_t size)