Command reference
usage: ntprof <command> [options] [files]
| Command | What it does |
|---|---|
record | profile the running kernel or SPDK (needs root) |
report FILE... | report recordings: the host's, and the target's |
compare BASE LOAD | each stage's latency amplification (LAD) between two runs; a run is host.ntp or host.ntp,target.ntp |
probe | check which hooks this kernel offers, and load them without attaching |
dump FILE... | print the records of recordings as CSV |
version | print the version |
Record options
| Option | Meaning |
|---|---|
-r, --role ROLE | host (default), target, or both |
-t, --transport T | tcp (default) or rdma |
-d, --duration SEC | stop after SEC seconds (default: Ctrl-C) |
-i, --interval SEC | one line per group every SEC seconds (default 1) |
--offline | no interval lines, only the final report |
-s, --sample N | record one command in N (default 1000); the host and the target must use the same N |
-o, --output FILE | save the records to FILE |
--spdk-host PATH | the host is SPDK: the binary with ntprof's probes (with a shared build, its libraries, comma-separated) |
--spdk-target PATH | the target is SPDK, for example build/bin/nvmf_tgt |
--exact-queues | count queue lengths per command (costs map operations on every I/O; default: the mean number in each stage, by Little's law) |
--btf DIR | BTF from tools/gen-btf.sh, for kernels or modules without BTF |
--kprobes | use kprobes even where fentry/fexit work |
--fentry | use fentry/fexit even when a busy CPU would make attaching them wait |
Filters
For record (what is recorded) and for report, compare and dump (what is read):
| Option | Meaning |
|---|---|
--session DEV | one namespace, nvmeXnY (default: all) |
--io-type T | read, write, or both (default) |
--size LIST | only these I/O sizes, for example 4K,128K |
Report options
For record, report and compare:
| Option | Meaning |
|---|---|
--detail | every component, not only the stages |
--all-groups | also groups with under 1 % of the records |
--aggregation A | avg (mean, p50, p99, p99.9), min, max, or dist (all quantiles) |
-j, --json FILE | write the final report as JSON |
Other options
| Option | Meaning |
|---|---|
-c, --config FILE | a task file in ini format (examples/ntprof.ini in the repository lists every key); options on the command line override it |
-v, --verbose | more messages (twice: libbpf's debug output) |
-h, --help | the usage text; -V, --version: the version |
NTPROF_SKIP=prog,prog leaves the named programs out, to measure what each hook costs.
Task file
A task file holds a run's settings in ini format, so that a run can be repeated exactly: ntprof record -c run.ini.
It is read by record, report, compare and dump alike; options given on the command line override it, and
every key is optional. The repository's examples/ntprof.ini lists them all:
examples/ntprof.ini (shortened)
[Workload]
IO_TYPE="read"
IO_SIZE="4K"
[Profiling]
FREQUENCY=1000
[Report]
ENABLE_GROUP_BY_SIZE=true
| Key | Meaning | Option |
|---|---|---|
| [Workload] | ||
SESSION_NAME | one namespace | --session |
IO_TYPE | read, write or both | --io-type |
IO_SIZE | only these sizes, for example "4K,128K" | --size |
MIN_IO_SIZE, MAX_IO_SIZE | a range of sizes, used when IO_SIZE is not set | |
| [Profiling] | ||
FREQUENCY | record one command in N; the same on both sides | -s |
TIME_INTERVAL | seconds between progress lines | -i |
IS_ONLINE | false: only the final report | --offline |
AGGREGATION | avg, min, max or dist | --aggregation |
BUFFER_SIZE | MB of ring buffer for the records (at most 256) | |
SPDK_HOST, SPDK_TARGET | the binaries of an SPDK host or target | --spdk-host, --spdk-target |
| [Report] | ||
ENABLE_GROUP_BY_SIZE, ENABLE_GROUP_BY_TYPE, ENABLE_GROUP_BY_SESSION | false leaves the size, the I/O type or the namespace out of the groups | |
SHOW_ALL_GROUPS | also groups under 1 % of the records | --all-groups |
ENABLE_COMPONENT_DETAIL | every component, not only the stages | --detail |
QUEUE_TRACKING | estimate (Little's law) or exact | --exact-queues |
ENABLE_LATENCY_DISTRIBUTION, ENABLE_LATENCY_BREAKDOWN, ENABLE_QUEUE_LENGTH, ENABLE_THROUGHPUT | false leaves the quantiles, the stage table, the queue lengths or the throughput out of the report |
The [Report] keys also apply to saved recordings: ntprof report -c run.ini host.ntp target.ntp reports them
with that file's grouping and statistics.