Skip to main content

Statistics & reports

The ziskemu cost report, emitted either as a full text report (--stats) or a compact, CI-friendly SDK report (--sdk). Explains the summary's cost-distribution categories, the per-opcode breakdown, and the SDK report's optional sections.

Profiling is ziskemu's main analysis feature. After a run it can emit a cost report, either as a full text report (--stats) or as a compact SDK report (--sdk). Adding symbols (--read-symbols) unlocks the function-level views in Function analysis. Profiling works on any ELF that carries symbols, including optimized release builds — no instrumentation is required.

The cost report (--stats)

-X / --stats prints overall execution statistics plus a per-opcode breakdown.

ziskemu -e program.elf -i input.bin -X

The report begins with a summary:

REPORT
----------------------------------------
STEPS 92,875,129

COST DISTRIBUTION COST %
------------------------------------------------
BASE 293,601,280 2.57%
MAIN 6,315,508,772 55.22%
OPCODES 1,334,639,984 11.67%
PRECOMPILES 2,565,960,716 22.43%
MEMORY 927,932,629 8.11%

TOTAL 11,437,643,381 100.00%

FROPS 963,440,253 8.42%
RAM USAGE 18,465,008 3.47%
SectionMeaning
STEPSProcessor cycles / instructions executed — a proxy for execution length.
BASEFixed overhead (tables, range checks) independent of program logic.
MAINProcessor cost without per-operation cost. Proportional to STEPS.
OPCODESSimple arithmetic/logic operations on 64-bit values.
PRECOMPILESComplex operations whose operands exceed 64 bits (256-bit math, EC ops, Keccak, DMA).
MEMORYDirect memory reads/writes plus unaligned-access state machines.
TOTALSum of all categories; each row shows its share of the total.
FROPSFrequently-used operations that are pre-calculated; the figure is the cost saved by that optimization.
RAM USAGEMemory used (reported only with the default bump allocator).

Below the summary, COST BY OPCODE and FROPS BY OPCODE tables list per-operation COUNT, COST, and percentage, with the four most expensive operations marked #1#4. Rows keep a stable order across runs (they are not sorted by cost) so reports can be diffed.

SDK report mode (--sdk)

--sdk produces a compact, boxed summary ideal for CI/CD and quick checks. By default it shows only the summary; request extra sections explicitly.

ziskemu -e program.elf -i input.bin --sdk
FlagDefaultDescription
--sdkfalseEmit the compact SDK report (summary only unless a section flag is added).
--opcodesfalseAdd the opcode-distribution section.
--top-functionsfalseAdd the top-cost-functions section (requires --read-symbols).
--profile-tagsfalseAdd the profile-tags section (developer-inserted measurement markers).
--sdk-width <WIDTH>120Width, in characters, of the SDK report.
# Summary + opcodes + top functions
ziskemu -e program.elf -i input.bin --sdk --opcodes --top-functions -S

For per-function rankings, the PC histogram, call tracking, and the Firefox Profiler export, continue to Function analysis.