.claude/skills/analyze-jitc-log/SKILL.md
Analyze jitc.log to find JIT compilation issues — fragment gaps, branch overflow, bad codegen
npx skillsauth add sebastianbiallas/pearpc analyze-jitc-logInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The jitc.log file contains all translated PPC→AArch64 code. Each entry shows:
Read the END of the log first — the most recently compiled code is at the bottom:
tail -100 ${ARGUMENTS:-jitc.log}
Check for fragment gaps — look for large jumps in native addresses between consecutive instructions. Two consecutive AArch64 instructions should be 4 bytes apart. If the gap is >512 bytes, a new fragment was allocated:
python3 -c "
import re, sys
lines = open('${ARGUMENTS:-jitc.log}').readlines()
prev_addr = None
for line in lines:
m = re.match(r'\s+([0-9a-f]+)\s+[0-9a-f]+\s+', line)
if m and len(m.group(1)) > 6: # native address (long hex)
addr = int(m.group(1), 16)
if prev_addr and addr - prev_addr > 512:
print(f'FRAGMENT GAP: {prev_addr:x} -> {addr:x} (distance: {addr - prev_addr} bytes)')
prev_addr = addr
"
Check for conditional branch overflow risk — any B.cc (0x54xxxxxx) instruction followed by a fragment gap means the conditional branch might not reach its target. B.cc range is ±1MB (±0x100000):
54 prefix instructions near fragment boundariesCheck for unresolved fixups — 14000000 is B #0 (branch to self), which means a fixup was never resolved:
grep '14000000' ${ARGUMENTS:-jitc.log}
Check for GEN_INTERPRET overhead — look for the pattern: store current_opc, compute pc from base+offset, store pc, store npc, mov x0 cpu, blr interpreter. Count how many bytes each PPC instruction takes in native code.
Identify the PPC page being compiled — the first column shows PPC offsets within the page. The current_code_base (stored at CPU offset 904) gives the page base EA.
tools
--- name: dump-printk description: Extract and display the Linux kernel printk ring buffer from a PearPC memory dump allowed-tools: Bash, Read argument-hint: [dump-file] [search-term] --- # Extract Kernel Printk Buffer Use `scripts/debug/memdump.py printk` to extract the printk ring buffer. ``` python3 scripts/debug/memdump.py printk $ARGUMENTS ``` If no arguments, use `memdump_jit.bin`. Report the last printk message, any Oops, and what boot stage was reached.
tools
--- name: compare-dumps description: Compare memory regions between generic and JIT memory dumps to find divergences allowed-tools: Bash, Read argument-hint: [subcommand] [args...] --- # Compare Memory Dumps Use `scripts/debug/memdump.py` subcommands: ``` # Read words at a PA (accepts kernel VA, auto-converts): python3 scripts/debug/memdump.py read memdump_jit.bin PA [count] # Diff two dumps at a PA: python3 scripts/debug/memdump.py diff memdump_generic.bin memdump_jit.bin PA [count] # Sear
testing
Analyze the JIT dispatch trace to diagnose boot stalls or crashes
testing
Check that aarch64 JIT interpreter functions match generic CPU behavior