Lines Matching refs:code
280 struct fetch_insn *code, unsigned int flags, int offs) in parse_probe_vars() argument
287 if (code->data) in parse_probe_vars()
289 code->data = kstrdup(arg, GFP_KERNEL); in parse_probe_vars()
290 if (!code->data) in parse_probe_vars()
292 code->op = FETCH_OP_TP_ARG; in parse_probe_vars()
295 code->op = FETCH_OP_RETVAL; in parse_probe_vars()
302 code->op = FETCH_OP_STACKP; in parse_probe_vars()
312 code->op = FETCH_OP_STACK; in parse_probe_vars()
313 code->param = (unsigned int)param; in parse_probe_vars()
318 code->op = FETCH_OP_COMM; in parse_probe_vars()
330 code->op = FETCH_OP_ARG; in parse_probe_vars()
331 code->param = (unsigned int)param - 1; in parse_probe_vars()
374 struct fetch_insn *code = *pcode; in parse_probe_arg() local
383 ret = parse_probe_vars(arg + 1, type, code, flags, offs); in parse_probe_arg()
394 code->op = FETCH_OP_REG; in parse_probe_arg()
395 code->param = (unsigned int)ret; in parse_probe_arg()
409 code->op = FETCH_OP_IMM; in parse_probe_arg()
410 code->immediate = param; in parse_probe_arg()
423 code->op = FETCH_OP_FOFFS; in parse_probe_arg()
424 code->immediate = (unsigned long)offset; // imm64? in parse_probe_arg()
432 code->op = FETCH_NOP_SYMBOL; in parse_probe_arg()
433 code->data = kstrdup(arg + 1, GFP_KERNEL); in parse_probe_arg()
434 if (!code->data) in parse_probe_arg()
436 if (++code == end) { in parse_probe_arg()
440 code->op = FETCH_OP_IMM; in parse_probe_arg()
441 code->immediate = 0; in parse_probe_arg()
444 if (++code == end) { in parse_probe_arg()
448 *pcode = code; in parse_probe_arg()
449 code->op = FETCH_OP_DEREF; in parse_probe_arg()
450 code->offset = offset; in parse_probe_arg()
484 ret = parse_probe_arg(arg, t2, &code, end, flags, offs); in parse_probe_arg()
487 if (code->op == FETCH_OP_COMM || in parse_probe_arg()
488 code->op == FETCH_OP_DATA) { in parse_probe_arg()
492 if (++code == end) { in parse_probe_arg()
496 *pcode = code; in parse_probe_arg()
498 code->op = deref; in parse_probe_arg()
499 code->offset = offset; in parse_probe_arg()
507 code->op = FETCH_OP_DATA; in parse_probe_arg()
508 code->data = tmp; in parse_probe_arg()
510 ret = str_to_immediate(arg + 1, &code->immediate); in parse_probe_arg()
514 code->op = FETCH_OP_IMM; in parse_probe_arg()
518 if (!ret && code->op == FETCH_OP_NOP) { in parse_probe_arg()
533 struct fetch_insn *code = *pcode; in __parse_bitfield_probe_arg() local
550 code++; in __parse_bitfield_probe_arg()
551 if (code->op != FETCH_OP_NOP) in __parse_bitfield_probe_arg()
553 *pcode = code; in __parse_bitfield_probe_arg()
555 code->op = FETCH_OP_MOD_BF; in __parse_bitfield_probe_arg()
556 code->lshift = BYTES_TO_BITS(t->size) - (bw + bo); in __parse_bitfield_probe_arg()
557 code->rshift = BYTES_TO_BITS(t->size) - bw; in __parse_bitfield_probe_arg()
558 code->basesize = t->size; in __parse_bitfield_probe_arg()
567 struct fetch_insn *code, *scode, *tmp = NULL; in traceprobe_parse_probe_arg_body() local
653 code = tmp = kcalloc(FETCH_INSN_MAX, sizeof(*code), GFP_KERNEL); in traceprobe_parse_probe_arg_body()
654 if (!code) in traceprobe_parse_probe_arg_body()
656 code[FETCH_INSN_MAX - 1].op = FETCH_OP_END; in traceprobe_parse_probe_arg_body()
658 ret = parse_probe_arg(arg, parg->type, &code, &code[FETCH_INSN_MAX - 1], in traceprobe_parse_probe_arg_body()
667 if (code->op != FETCH_OP_DEREF && code->op != FETCH_OP_UDEREF && in traceprobe_parse_probe_arg_body()
668 code->op != FETCH_OP_IMM && code->op != FETCH_OP_COMM && in traceprobe_parse_probe_arg_body()
669 code->op != FETCH_OP_DATA && code->op != FETCH_OP_TP_ARG) { in traceprobe_parse_probe_arg_body()
674 if ((code->op == FETCH_OP_IMM || code->op == FETCH_OP_COMM || in traceprobe_parse_probe_arg_body()
675 code->op == FETCH_OP_DATA) || code->op == FETCH_OP_TP_ARG || in traceprobe_parse_probe_arg_body()
683 code++; in traceprobe_parse_probe_arg_body()
684 if (code->op != FETCH_OP_NOP) { in traceprobe_parse_probe_arg_body()
691 code->op == FETCH_OP_UDEREF) in traceprobe_parse_probe_arg_body()
692 code->op = FETCH_OP_ST_USTRING; in traceprobe_parse_probe_arg_body()
694 code->op = FETCH_OP_ST_STRING; in traceprobe_parse_probe_arg_body()
695 code->size = parg->type->size; in traceprobe_parse_probe_arg_body()
697 } else if (code->op == FETCH_OP_DEREF) { in traceprobe_parse_probe_arg_body()
698 code->op = FETCH_OP_ST_MEM; in traceprobe_parse_probe_arg_body()
699 code->size = parg->type->size; in traceprobe_parse_probe_arg_body()
700 } else if (code->op == FETCH_OP_UDEREF) { in traceprobe_parse_probe_arg_body()
701 code->op = FETCH_OP_ST_UMEM; in traceprobe_parse_probe_arg_body()
702 code->size = parg->type->size; in traceprobe_parse_probe_arg_body()
704 code++; in traceprobe_parse_probe_arg_body()
705 if (code->op != FETCH_OP_NOP) { in traceprobe_parse_probe_arg_body()
709 code->op = FETCH_OP_ST_RAW; in traceprobe_parse_probe_arg_body()
710 code->size = parg->type->size; in traceprobe_parse_probe_arg_body()
712 scode = code; in traceprobe_parse_probe_arg_body()
715 ret = __parse_bitfield_probe_arg(t, parg->type, &code); in traceprobe_parse_probe_arg_body()
731 code++; in traceprobe_parse_probe_arg_body()
732 if (code->op != FETCH_OP_NOP) { in traceprobe_parse_probe_arg_body()
736 code->op = FETCH_OP_LP_ARRAY; in traceprobe_parse_probe_arg_body()
737 code->param = parg->count; in traceprobe_parse_probe_arg_body()
739 code++; in traceprobe_parse_probe_arg_body()
740 code->op = FETCH_OP_END; in traceprobe_parse_probe_arg_body()
744 parg->code = kcalloc(code - tmp + 1, sizeof(*code), GFP_KERNEL); in traceprobe_parse_probe_arg_body()
745 if (!parg->code) in traceprobe_parse_probe_arg_body()
748 memcpy(parg->code, tmp, sizeof(*code) * (code - tmp + 1)); in traceprobe_parse_probe_arg_body()
752 for (code = tmp; code < tmp + FETCH_INSN_MAX; code++) in traceprobe_parse_probe_arg_body()
753 if (code->op == FETCH_NOP_SYMBOL || in traceprobe_parse_probe_arg_body()
754 code->op == FETCH_OP_DATA) in traceprobe_parse_probe_arg_body()
755 kfree(code->data); in traceprobe_parse_probe_arg_body()
824 struct fetch_insn *code = arg->code; in traceprobe_free_probe_arg() local
826 while (code && code->op != FETCH_OP_END) { in traceprobe_free_probe_arg()
827 if (code->op == FETCH_NOP_SYMBOL || in traceprobe_free_probe_arg()
828 code->op == FETCH_OP_DATA) in traceprobe_free_probe_arg()
829 kfree(code->data); in traceprobe_free_probe_arg()
830 code++; in traceprobe_free_probe_arg()
832 kfree(arg->code); in traceprobe_free_probe_arg()
840 struct fetch_insn *code = arg->code; in traceprobe_update_arg() local
846 while (code && code->op != FETCH_OP_END) { in traceprobe_update_arg()
847 if (code->op == FETCH_NOP_SYMBOL) { in traceprobe_update_arg()
848 if (code[1].op != FETCH_OP_IMM) in traceprobe_update_arg()
851 tmp = strpbrk(code->data, "+-"); in traceprobe_update_arg()
854 ret = traceprobe_split_symbol_offset(code->data, in traceprobe_update_arg()
859 code[1].immediate = in traceprobe_update_arg()
860 (unsigned long)kallsyms_lookup_name(code->data); in traceprobe_update_arg()
863 if (!code[1].immediate) in traceprobe_update_arg()
865 code[1].immediate += offset; in traceprobe_update_arg()
867 code++; in traceprobe_update_arg()