/* * Parse OP and convert it into uprobe format, which is, +/-NUM(%gprREG). * Possible variants of OP are: * Format Example * ------------------------- * NUM(REG) 48(18) * -NUM(REG) -48(18) * NUM(%rREG) 48(%r18) * -NUM(%rREG) -48(%r18) * REG 18 * %rREG %r18 * iNUM i0 * i-NUM i-1 * * SDT marker arguments on Powerpc uses %rREG form with -mregnames flag * and REG form with -mno-regnames. Here REG is general purpose register, * which is in 0 to 31 range.
*/ int arch_sdt_arg_parse_op(char *old_op, char **new_op)
{ int ret, new_len;
regmatch_t rm[5]; char prefix;
/* Constant argument. Uprobe does not support it */ if (old_op[0] == 'i') {
pr_debug4("Skipping unsupported SDT argument: %s\n", old_op); return SDT_ARG_SKIP;
}
ret = sdt_init_op_regex(); if (ret < 0) return ret;
if (!regexec(&sdt_op_regex1, old_op, 3, rm, 0)) { /* REG or %rREG --> %gprREG */
new_len = 5; /* % g p r NULL */
new_len += (int)(rm[2].rm_eo - rm[2].rm_so);
*new_op = zalloc(new_len); if (!*new_op) return -ENOMEM;
/* * Get the PVR value to set the extended * mask specific to platform.
*/
version = (((mfspr(SPRN_PVR)) >> 16) & 0xFFFF); if (version == PVR_POWER9)
extended_mask = PERF_REG_PMU_MASK_300; elseif ((version == PVR_POWER10) || (version == PVR_POWER11))
extended_mask = PERF_REG_PMU_MASK_31; else return mask;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.