test__insn_x86(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… test__insn_x86(9) β€” the x86 instruction decoder test, new-instructions edition πŸŽ€

okay bestie, this one lives in the Kernel API Manual (section 9, iykyk) and it's literally just called test__insn_x86. Let's get into it ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

int test__insn_x86 (struct test_suite *test , int subtest );

🌸 ARGUMENTS 🌸

  • test β€” -- undescribed -- πŸ™ˆ that's it, that's the whole description, the manpage really said "no thoughts, head empty" on this one.
  • subtest β€” also -- undescribed -- πŸ’€ same energy, bestie. No description given, no cap.

✨ DESCRIPTION ✨

so this function is basically the vibe check for the x86 instruction decoder πŸ”₯ It runs a test that decodes a whole selection of instructions and then checks the results. Like, did you decode correctly or did you fumble? πŸ‘‘

and it's not just the decoder β€” the Intel PT function that further categorizes instructions (that's intel_pt_get_insn, mwah πŸ’‹) gets checked too.

now here's the behind-the-scenes lore 🎬 The instructions originally live in insn-x86-dat-src.c, which has been processed by the scripts gen-insn-x86-dat.sh and gen-insn-x86-dat.awk to produce insn-x86-dat-32.c and insn-x86-dat-64.c β€” and those two get included into this program. i.e. it's giving pipeline realness 🧚

so if you wanna add new instructions to the test, the whole little ritual is: edit insn-x86-dat-src.c, run the gen-insn-x86-dat.sh script, make perf, and then run the test. slay, that's the workflow πŸ’…

and the results? If the test passes, 0 is returned. Otherwise -1 is returned. dramatic but fair 😭

wanna see everything? Use the verbose (-v) option to see all the instructions and whether or not they decoded successfully. that's the main character setting fr fr πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

  • Kernel file ./tools/perf/arch/x86/tests/insn-x86.c β€” go read it, it's right there 🫢

and that's the whole page, bestie! this icon was brought to you by the source tree ./tools/perf/arch/x86/tests, dated October 2026 β€” screenshot it, frame it, put it on the fridge πŸŒˆβ­πŸ’–

πŸ“¦ where this page comes from