Lines Matching refs:insn
19 fn alu_imm_str(name: &str, insn: &ebpf::Insn) -> String { in alu_imm_str()
20 format!("{name} r{}, {:#x}", insn.dst, insn.imm) in alu_imm_str()
24 fn alu_reg_str(name: &str, insn: &ebpf::Insn) -> String { in alu_reg_str()
25 format!("{name} r{}, r{}", insn.dst, insn.src) in alu_reg_str()
29 fn byteswap_str(name: &str, insn: &ebpf::Insn) -> String { in byteswap_str()
30 match insn.imm { in byteswap_str()
34 format!("{name}{} r{}", insn.imm, insn.dst) in byteswap_str()
38 fn ld_st_imm_str(name: &str, insn: &ebpf::Insn) -> String { in ld_st_imm_str()
39 if insn.off >= 0 { in ld_st_imm_str()
40 format!("{name} [r{}+{:#x}], {:#x}", insn.dst, insn.off, insn.imm) in ld_st_imm_str()
44 insn.dst, in ld_st_imm_str()
45 -(insn.off as isize), in ld_st_imm_str()
46 insn.imm in ld_st_imm_str()
52 fn ld_reg_str(name: &str, insn: &ebpf::Insn) -> String { in ld_reg_str()
53 if insn.off >= 0 { in ld_reg_str()
54 format!("{name} r{}, [r{}+{:#x}]", insn.dst, insn.src, insn.off) in ld_reg_str()
58 insn.dst, in ld_reg_str()
59 insn.src, in ld_reg_str()
60 -(insn.off as isize) in ld_reg_str()
66 fn st_reg_str(name: &str, insn: &ebpf::Insn) -> String { in st_reg_str()
67 if insn.off >= 0 { in st_reg_str()
68 format!("{name} [r{}+{:#x}], r{}", insn.dst, insn.off, insn.src) in st_reg_str()
72 insn.dst, in st_reg_str()
73 -(insn.off as isize), in st_reg_str()
74 insn.src in st_reg_str()
80 fn ldabs_str(name: &str, insn: &ebpf::Insn) -> String { in ldabs_str()
81 format!("{name} {:#x}", insn.imm) in ldabs_str()
85 fn ldind_str(name: &str, insn: &ebpf::Insn) -> String { in ldind_str()
86 format!("{name} r{}, {:#x}", insn.src, insn.imm) in ldind_str()
90 fn jmp_imm_str(name: &str, insn: &ebpf::Insn) -> String { in jmp_imm_str()
91 if insn.off >= 0 { in jmp_imm_str()
92 format!("{name} r{}, {:#x}, +{:#x}", insn.dst, insn.imm, insn.off) in jmp_imm_str()
96 insn.dst, in jmp_imm_str()
97 insn.imm, in jmp_imm_str()
98 -(insn.off as isize) in jmp_imm_str()
104 fn jmp_reg_str(name: &str, insn: &ebpf::Insn) -> String { in jmp_reg_str()
105 if insn.off >= 0 { in jmp_reg_str()
106 format!("{name} r{}, r{}, +{:#x}", insn.dst, insn.src, insn.off) in jmp_reg_str()
110 insn.dst, in jmp_reg_str()
111 insn.src, in jmp_reg_str()
112 -(insn.off as isize) in jmp_reg_str()
217 let insn = ebpf::get_insn(prog, insn_ptr); in to_insn_vec() localVariable
221 let mut imm = insn.imm as i64; in to_insn_vec()
222 match insn.opc { in to_insn_vec()
226 desc = ldabs_str(name, &insn); in to_insn_vec()
230 desc = ldabs_str(name, &insn); in to_insn_vec()
234 desc = ldabs_str(name, &insn); in to_insn_vec()
238 desc = ldabs_str(name, &insn); in to_insn_vec()
242 desc = ldind_str(name, &insn); in to_insn_vec()
246 desc = ldind_str(name, &insn); in to_insn_vec()
250 desc = ldind_str(name, &insn); in to_insn_vec()
254 desc = ldind_str(name, &insn); in to_insn_vec()
260 imm = ((insn.imm as u32) as u64 + ((next_insn.imm as u64) << 32)) as i64; in to_insn_vec()
262 desc = format!("{name} r{:}, {imm:#x}", insn.dst); in to_insn_vec()
268 desc = ld_reg_str(name, &insn); in to_insn_vec()
272 desc = ld_reg_str(name, &insn); in to_insn_vec()
276 desc = ld_reg_str(name, &insn); in to_insn_vec()
280 desc = ld_reg_str(name, &insn); in to_insn_vec()
286 desc = ld_st_imm_str(name, &insn); in to_insn_vec()
290 desc = ld_st_imm_str(name, &insn); in to_insn_vec()
294 desc = ld_st_imm_str(name, &insn); in to_insn_vec()
298 desc = ld_st_imm_str(name, &insn); in to_insn_vec()
304 desc = st_reg_str(name, &insn); in to_insn_vec()
308 desc = st_reg_str(name, &insn); in to_insn_vec()
312 desc = st_reg_str(name, &insn); in to_insn_vec()
316 desc = st_reg_str(name, &insn); in to_insn_vec()
320 desc = st_reg_str(name, &insn); in to_insn_vec()
324 desc = st_reg_str(name, &insn); in to_insn_vec()
330 desc = alu_imm_str(name, &insn); in to_insn_vec()
334 desc = alu_reg_str(name, &insn); in to_insn_vec()
338 desc = alu_imm_str(name, &insn); in to_insn_vec()
342 desc = alu_reg_str(name, &insn); in to_insn_vec()
346 desc = alu_imm_str(name, &insn); in to_insn_vec()
350 desc = alu_reg_str(name, &insn); in to_insn_vec()
354 desc = alu_imm_str(name, &insn); in to_insn_vec()
358 desc = alu_reg_str(name, &insn); in to_insn_vec()
362 desc = alu_imm_str(name, &insn); in to_insn_vec()
366 desc = alu_reg_str(name, &insn); in to_insn_vec()
370 desc = alu_imm_str(name, &insn); in to_insn_vec()
374 desc = alu_reg_str(name, &insn); in to_insn_vec()
378 desc = alu_imm_str(name, &insn); in to_insn_vec()
382 desc = alu_reg_str(name, &insn); in to_insn_vec()
386 desc = alu_imm_str(name, &insn); in to_insn_vec()
390 desc = alu_reg_str(name, &insn); in to_insn_vec()
394 desc = format!("{name} r{:}", insn.dst); in to_insn_vec()
398 desc = alu_imm_str(name, &insn); in to_insn_vec()
402 desc = alu_reg_str(name, &insn); in to_insn_vec()
406 desc = alu_imm_str(name, &insn); in to_insn_vec()
410 desc = alu_reg_str(name, &insn); in to_insn_vec()
414 desc = alu_imm_str(name, &insn); in to_insn_vec()
418 desc = alu_reg_str(name, &insn); in to_insn_vec()
422 desc = alu_imm_str(name, &insn); in to_insn_vec()
426 desc = alu_reg_str(name, &insn); in to_insn_vec()
430 desc = byteswap_str(name, &insn); in to_insn_vec()
434 desc = byteswap_str(name, &insn); in to_insn_vec()
440 desc = alu_imm_str(name, &insn); in to_insn_vec()
444 desc = alu_reg_str(name, &insn); in to_insn_vec()
448 desc = alu_imm_str(name, &insn); in to_insn_vec()
452 desc = alu_reg_str(name, &insn); in to_insn_vec()
456 desc = alu_imm_str(name, &insn); in to_insn_vec()
460 desc = alu_reg_str(name, &insn); in to_insn_vec()
464 desc = alu_imm_str(name, &insn); in to_insn_vec()
468 desc = alu_reg_str(name, &insn); in to_insn_vec()
472 desc = alu_imm_str(name, &insn); in to_insn_vec()
476 desc = alu_reg_str(name, &insn); in to_insn_vec()
480 desc = alu_imm_str(name, &insn); in to_insn_vec()
484 desc = alu_reg_str(name, &insn); in to_insn_vec()
488 desc = alu_imm_str(name, &insn); in to_insn_vec()
492 desc = alu_reg_str(name, &insn); in to_insn_vec()
496 desc = alu_imm_str(name, &insn); in to_insn_vec()
500 desc = alu_reg_str(name, &insn); in to_insn_vec()
504 desc = format!("{name} r{:}", insn.dst); in to_insn_vec()
508 desc = alu_imm_str(name, &insn); in to_insn_vec()
512 desc = alu_reg_str(name, &insn); in to_insn_vec()
516 desc = alu_imm_str(name, &insn); in to_insn_vec()
520 desc = alu_reg_str(name, &insn); in to_insn_vec()
524 desc = alu_imm_str(name, &insn); in to_insn_vec()
528 desc = alu_reg_str(name, &insn); in to_insn_vec()
532 desc = alu_imm_str(name, &insn); in to_insn_vec()
536 desc = alu_reg_str(name, &insn); in to_insn_vec()
542 desc = if insn.off >= 0 { in to_insn_vec()
543 format!("{name} +{:#x}", insn.off) in to_insn_vec()
545 format!("{name} -{:#x}", -insn.off) in to_insn_vec()
550 desc = jmp_imm_str(name, &insn); in to_insn_vec()
554 desc = jmp_reg_str(name, &insn); in to_insn_vec()
558 desc = jmp_imm_str(name, &insn); in to_insn_vec()
562 desc = jmp_reg_str(name, &insn); in to_insn_vec()
566 desc = jmp_imm_str(name, &insn); in to_insn_vec()
570 desc = jmp_reg_str(name, &insn); in to_insn_vec()
574 desc = jmp_imm_str(name, &insn); in to_insn_vec()
578 desc = jmp_reg_str(name, &insn); in to_insn_vec()
582 desc = jmp_imm_str(name, &insn); in to_insn_vec()
586 desc = jmp_reg_str(name, &insn); in to_insn_vec()
590 desc = jmp_imm_str(name, &insn); in to_insn_vec()
594 desc = jmp_reg_str(name, &insn); in to_insn_vec()
598 desc = jmp_imm_str(name, &insn); in to_insn_vec()
602 desc = jmp_reg_str(name, &insn); in to_insn_vec()
606 desc = jmp_imm_str(name, &insn); in to_insn_vec()
610 desc = jmp_reg_str(name, &insn); in to_insn_vec()
614 desc = jmp_imm_str(name, &insn); in to_insn_vec()
618 desc = jmp_reg_str(name, &insn); in to_insn_vec()
622 desc = jmp_imm_str(name, &insn); in to_insn_vec()
626 desc = jmp_reg_str(name, &insn); in to_insn_vec()
630 desc = jmp_imm_str(name, &insn); in to_insn_vec()
634 desc = jmp_reg_str(name, &insn); in to_insn_vec()
638 desc = format!("{name} {:#x}", insn.imm); in to_insn_vec()
652 desc = jmp_imm_str(name, &insn); in to_insn_vec()
656 desc = jmp_reg_str(name, &insn); in to_insn_vec()
660 desc = jmp_imm_str(name, &insn); in to_insn_vec()
664 desc = jmp_reg_str(name, &insn); in to_insn_vec()
668 desc = jmp_imm_str(name, &insn); in to_insn_vec()
672 desc = jmp_reg_str(name, &insn); in to_insn_vec()
676 desc = jmp_imm_str(name, &insn); in to_insn_vec()
680 desc = jmp_reg_str(name, &insn); in to_insn_vec()
684 desc = jmp_imm_str(name, &insn); in to_insn_vec()
688 desc = jmp_reg_str(name, &insn); in to_insn_vec()
692 desc = jmp_imm_str(name, &insn); in to_insn_vec()
696 desc = jmp_reg_str(name, &insn); in to_insn_vec()
700 desc = jmp_imm_str(name, &insn); in to_insn_vec()
704 desc = jmp_reg_str(name, &insn); in to_insn_vec()
708 desc = jmp_imm_str(name, &insn); in to_insn_vec()
712 desc = jmp_reg_str(name, &insn); in to_insn_vec()
716 desc = jmp_imm_str(name, &insn); in to_insn_vec()
720 desc = jmp_reg_str(name, &insn); in to_insn_vec()
724 desc = jmp_imm_str(name, &insn); in to_insn_vec()
728 desc = jmp_reg_str(name, &insn); in to_insn_vec()
732 desc = jmp_imm_str(name, &insn); in to_insn_vec()
736 desc = jmp_reg_str(name, &insn); in to_insn_vec()
742 insn.opc, insn_ptr in to_insn_vec()
748 opc: insn.opc, in to_insn_vec()
751 dst: insn.dst, in to_insn_vec()
752 src: insn.src, in to_insn_vec()
753 off: insn.off, in to_insn_vec()
797 for insn in to_insn_vec(prog) { in disassemble()
798 println!("{}", insn.desc); in disassemble()
803 for insn in to_insn_vec(prog) { in disassemble()
804 log::info!("{}", insn.desc); in disassemble()