Lines Matching refs:code

289 static int parse_trace_event_arg(char *arg, struct fetch_insn *code,  in parse_trace_event_arg()  argument
298 code->op = FETCH_OP_TP_ARG; in parse_trace_event_arg()
299 code->data = field; in parse_trace_event_arg()
365 struct fetch_insn *code = *pcode + 1; in check_prepare_btf_string_fetch() local
367 if (code->op == FETCH_OP_END) { in check_prepare_btf_string_fetch()
372 code->op = FETCH_OP_UDEREF; in check_prepare_btf_string_fetch()
374 code->op = FETCH_OP_DEREF; in check_prepare_btf_string_fetch()
375 code->offset = 0; in check_prepare_btf_string_fetch()
376 *pcode = code; in check_prepare_btf_string_fetch()
525 struct fetch_insn *code = *pcode; in parse_btf_field() local
582 if (++code == end) { in parse_btf_field()
586 code->op = FETCH_OP_DEREF; /* TODO: user deref support */ in parse_btf_field()
587 code->offset = bitoffs / 8; in parse_btf_field()
588 *pcode = code; in parse_btf_field()
601 struct fetch_insn *code = *pcode; in parse_btf_arg() local
626 code->op = FETCH_OP_RETVAL; in parse_btf_arg()
657 code->op = FETCH_OP_ARG; in parse_btf_arg()
659 code->param = i + 1; in parse_btf_arg()
661 code->param = i; in parse_btf_arg()
701 struct fetch_insn *code = *pcode; in parse_btf_bitfield() local
706 code++; in parse_btf_bitfield()
707 if (code->op != FETCH_OP_NOP) { in parse_btf_bitfield()
711 *pcode = code; in parse_btf_bitfield()
713 code->op = FETCH_OP_MOD_BF; in parse_btf_bitfield()
714 code->lshift = 64 - (ctx->last_bitsize + ctx->last_bitoffs); in parse_btf_bitfield()
715 code->rshift = 64 - ctx->last_bitsize; in parse_btf_bitfield()
716 code->basesize = 64 / 8; in parse_btf_bitfield()
766 struct fetch_insn *code = *pcode; in parse_probe_vars() local
774 if (code->data) in parse_probe_vars()
776 ret = parse_trace_event_arg(arg, code, ctx); in parse_probe_vars()
780 code->op = FETCH_OP_COMM; in parse_probe_vars()
795 code->op = FETCH_OP_RETVAL; in parse_probe_vars()
805 code->op = FETCH_OP_STACKP; in parse_probe_vars()
819 code->op = FETCH_OP_STACK; in parse_probe_vars()
820 code->param = (unsigned int)param; in parse_probe_vars()
827 code->op = FETCH_OP_COMM; in parse_probe_vars()
843 code->op = FETCH_OP_ARG; in parse_probe_vars()
844 code->param = (unsigned int)param - 1; in parse_probe_vars()
850 code->param++; in parse_probe_vars()
891 struct fetch_insn *code = *pcode; in parse_probe_arg() local
911 code->op = FETCH_OP_REG; in parse_probe_arg()
912 code->param = (unsigned int)ret; in parse_probe_arg()
926 code->op = FETCH_OP_IMM; in parse_probe_arg()
927 code->immediate = param; in parse_probe_arg()
940 code->op = FETCH_OP_FOFFS; in parse_probe_arg()
941 code->immediate = (unsigned long)offset; // imm64? in parse_probe_arg()
949 code->op = FETCH_NOP_SYMBOL; in parse_probe_arg()
950 code->data = kstrdup(arg + 1, GFP_KERNEL); in parse_probe_arg()
951 if (!code->data) in parse_probe_arg()
953 if (++code == end) { in parse_probe_arg()
957 code->op = FETCH_OP_IMM; in parse_probe_arg()
958 code->immediate = 0; in parse_probe_arg()
961 if (++code == end) { in parse_probe_arg()
965 *pcode = code; in parse_probe_arg()
966 code->op = FETCH_OP_DEREF; in parse_probe_arg()
967 code->offset = offset; in parse_probe_arg()
1002 ret = parse_probe_arg(arg, t2, &code, end, ctx); in parse_probe_arg()
1006 if (code->op == FETCH_OP_COMM || in parse_probe_arg()
1007 code->op == FETCH_OP_DATA) { in parse_probe_arg()
1011 if (++code == end) { in parse_probe_arg()
1015 *pcode = code; in parse_probe_arg()
1017 code->op = deref; in parse_probe_arg()
1018 code->offset = offset; in parse_probe_arg()
1028 code->op = FETCH_OP_DATA; in parse_probe_arg()
1029 code->data = tmp; in parse_probe_arg()
1031 ret = str_to_immediate(arg + 1, &code->immediate); in parse_probe_arg()
1035 code->op = FETCH_OP_IMM; in parse_probe_arg()
1048 if (!ret && code->op == FETCH_OP_NOP) { in parse_probe_arg()
1063 struct fetch_insn *code = *pcode; in __parse_bitfield_probe_arg() local
1080 code++; in __parse_bitfield_probe_arg()
1081 if (code->op != FETCH_OP_NOP) in __parse_bitfield_probe_arg()
1083 *pcode = code; in __parse_bitfield_probe_arg()
1085 code->op = FETCH_OP_MOD_BF; in __parse_bitfield_probe_arg()
1086 code->lshift = BYTES_TO_BITS(t->size) - (bw + bo); in __parse_bitfield_probe_arg()
1087 code->rshift = BYTES_TO_BITS(t->size) - bw; in __parse_bitfield_probe_arg()
1088 code->basesize = t->size; in __parse_bitfield_probe_arg()
1098 struct fetch_insn *code, *scode, *tmp = NULL; in traceprobe_parse_probe_arg_body() local
1176 code = tmp = kcalloc(FETCH_INSN_MAX, sizeof(*code), GFP_KERNEL); in traceprobe_parse_probe_arg_body()
1177 if (!code) in traceprobe_parse_probe_arg_body()
1179 code[FETCH_INSN_MAX - 1].op = FETCH_OP_END; in traceprobe_parse_probe_arg_body()
1182 ret = parse_probe_arg(arg, parg->type, &code, &code[FETCH_INSN_MAX - 1], in traceprobe_parse_probe_arg_body()
1193 ret = check_prepare_btf_string_fetch(t, &code, ctx); in traceprobe_parse_probe_arg_body()
1216 if (code->op != FETCH_OP_REG && code->op != FETCH_OP_STACK && in traceprobe_parse_probe_arg_body()
1217 code->op != FETCH_OP_RETVAL && code->op != FETCH_OP_ARG && in traceprobe_parse_probe_arg_body()
1218 code->op != FETCH_OP_DEREF && code->op != FETCH_OP_TP_ARG) { in traceprobe_parse_probe_arg_body()
1224 if (code->op != FETCH_OP_DEREF && code->op != FETCH_OP_UDEREF && in traceprobe_parse_probe_arg_body()
1225 code->op != FETCH_OP_IMM && code->op != FETCH_OP_COMM && in traceprobe_parse_probe_arg_body()
1226 code->op != FETCH_OP_DATA && code->op != FETCH_OP_TP_ARG) { in traceprobe_parse_probe_arg_body()
1233 (code->op == FETCH_OP_IMM || code->op == FETCH_OP_COMM || in traceprobe_parse_probe_arg_body()
1234 code->op == FETCH_OP_DATA) || code->op == FETCH_OP_TP_ARG || in traceprobe_parse_probe_arg_body()
1244 code++; in traceprobe_parse_probe_arg_body()
1245 if (code->op != FETCH_OP_NOP) { in traceprobe_parse_probe_arg_body()
1252 code->op == FETCH_OP_UDEREF) in traceprobe_parse_probe_arg_body()
1253 code->op = FETCH_OP_ST_USTRING; in traceprobe_parse_probe_arg_body()
1255 code->op = FETCH_OP_ST_SYMSTR; in traceprobe_parse_probe_arg_body()
1257 code->op = FETCH_OP_ST_STRING; in traceprobe_parse_probe_arg_body()
1258 code->size = parg->type->size; in traceprobe_parse_probe_arg_body()
1260 } else if (code->op == FETCH_OP_DEREF) { in traceprobe_parse_probe_arg_body()
1261 code->op = FETCH_OP_ST_MEM; in traceprobe_parse_probe_arg_body()
1262 code->size = parg->type->size; in traceprobe_parse_probe_arg_body()
1263 } else if (code->op == FETCH_OP_UDEREF) { in traceprobe_parse_probe_arg_body()
1264 code->op = FETCH_OP_ST_UMEM; in traceprobe_parse_probe_arg_body()
1265 code->size = parg->type->size; in traceprobe_parse_probe_arg_body()
1267 code++; in traceprobe_parse_probe_arg_body()
1268 if (code->op != FETCH_OP_NOP) { in traceprobe_parse_probe_arg_body()
1272 code->op = FETCH_OP_ST_RAW; in traceprobe_parse_probe_arg_body()
1273 code->size = parg->type->size; in traceprobe_parse_probe_arg_body()
1275 scode = code; in traceprobe_parse_probe_arg_body()
1278 ret = __parse_bitfield_probe_arg(t, parg->type, &code); in traceprobe_parse_probe_arg_body()
1285 ret = parse_btf_bitfield(&code, ctx); in traceprobe_parse_probe_arg_body()
1299 code++; in traceprobe_parse_probe_arg_body()
1300 if (code->op != FETCH_OP_NOP) { in traceprobe_parse_probe_arg_body()
1304 code->op = FETCH_OP_LP_ARRAY; in traceprobe_parse_probe_arg_body()
1305 code->param = parg->count; in traceprobe_parse_probe_arg_body()
1307 code++; in traceprobe_parse_probe_arg_body()
1308 code->op = FETCH_OP_END; in traceprobe_parse_probe_arg_body()
1312 parg->code = kcalloc(code - tmp + 1, sizeof(*code), GFP_KERNEL); in traceprobe_parse_probe_arg_body()
1313 if (!parg->code) in traceprobe_parse_probe_arg_body()
1316 memcpy(parg->code, tmp, sizeof(*code) * (code - tmp + 1)); in traceprobe_parse_probe_arg_body()
1320 for (code = tmp; code < tmp + FETCH_INSN_MAX; code++) in traceprobe_parse_probe_arg_body()
1321 if (code->op == FETCH_NOP_SYMBOL || in traceprobe_parse_probe_arg_body()
1322 code->op == FETCH_OP_DATA) in traceprobe_parse_probe_arg_body()
1323 kfree(code->data); in traceprobe_parse_probe_arg_body()
1418 struct fetch_insn *code = arg->code; in traceprobe_free_probe_arg() local
1420 while (code && code->op != FETCH_OP_END) { in traceprobe_free_probe_arg()
1421 if (code->op == FETCH_NOP_SYMBOL || in traceprobe_free_probe_arg()
1422 code->op == FETCH_OP_DATA) in traceprobe_free_probe_arg()
1423 kfree(code->data); in traceprobe_free_probe_arg()
1424 code++; in traceprobe_free_probe_arg()
1426 kfree(arg->code); in traceprobe_free_probe_arg()
1579 struct fetch_insn *code = arg->code; in traceprobe_update_arg() local
1585 while (code && code->op != FETCH_OP_END) { in traceprobe_update_arg()
1586 if (code->op == FETCH_NOP_SYMBOL) { in traceprobe_update_arg()
1587 if (code[1].op != FETCH_OP_IMM) in traceprobe_update_arg()
1590 tmp = strpbrk(code->data, "+-"); in traceprobe_update_arg()
1593 ret = traceprobe_split_symbol_offset(code->data, in traceprobe_update_arg()
1598 code[1].immediate = in traceprobe_update_arg()
1599 (unsigned long)kallsyms_lookup_name(code->data); in traceprobe_update_arg()
1602 if (!code[1].immediate) in traceprobe_update_arg()
1604 code[1].immediate += offset; in traceprobe_update_arg()
1606 code++; in traceprobe_update_arg()