Lines Matching +full:convert +full:- +full:sample +full:- +full:format

1 // SPDX-License-Identifier: GPL-2.0
12 #include "../../../perf-sys.h"
84 #define SDT_OP_REGEX1 "^(%r)?([1-2]?[0-9]|3[0-1])$"
86 /* -NUM(REG) or NUM(REG) or -NUM(%rREG) or NUM(%rREG) */
87 #define SDT_OP_REGEX2 "^(\\-)?([0-9]+)\\((%r)?([1-2]?[0-9]|3[0-1])\\)$"
118 * Parse OP and convert it into uprobe format, which is, +/-NUM(%gprREG).
120 * Format Example
121 * -------------------------
123 * -NUM(REG) -48(18)
125 * -NUM(%rREG) -48(%r18)
129 * i-NUM i-1
131 * SDT marker arguments on Powerpc uses %rREG form with -mregnames flag
132 * and REG form with -mno-regnames. Here REG is general purpose register,
152 /* REG or %rREG --> %gprREG */ in arch_sdt_arg_parse_op()
155 new_len += (int)(rm[2].rm_eo - rm[2].rm_so); in arch_sdt_arg_parse_op()
159 return -ENOMEM; in arch_sdt_arg_parse_op()
162 (int)(rm[2].rm_eo - rm[2].rm_so), old_op + rm[2].rm_so); in arch_sdt_arg_parse_op()
165 * -NUM(REG) or NUM(REG) or -NUM(%rREG) or NUM(%rREG) --> in arch_sdt_arg_parse_op()
166 * +/-NUM(%gprREG) in arch_sdt_arg_parse_op()
168 prefix = (rm[1].rm_so == -1) ? '+' : '-'; in arch_sdt_arg_parse_op()
170 new_len = 8; /* +/- ( % g p r ) NULL */ in arch_sdt_arg_parse_op()
171 new_len += (int)(rm[2].rm_eo - rm[2].rm_so); in arch_sdt_arg_parse_op()
172 new_len += (int)(rm[4].rm_eo - rm[4].rm_so); in arch_sdt_arg_parse_op()
176 return -ENOMEM; in arch_sdt_arg_parse_op()
179 (int)(rm[2].rm_eo - rm[2].rm_so), old_op + rm[2].rm_so, in arch_sdt_arg_parse_op()
180 (int)(rm[4].rm_eo - rm[4].rm_so), old_op + rm[4].rm_so); in arch_sdt_arg_parse_op()
221 * returning the register mask to sample. in arch__intr_reg_mask()
223 fd = sys_perf_event_open(&attr, 0, -1, -1, 0); in arch__intr_reg_mask()
224 if (fd != -1) { in arch__intr_reg_mask()