Skip to main content

Command reference

usage: ntprof <command> [options] [files]
CommandWhat it does
recordprofile the running kernel or SPDK (needs root)
report FILE...report recordings: the host's, and the target's
compare BASE LOADeach stage's latency amplification (LAD) between two runs; a run is host.ntp or host.ntp,target.ntp
probecheck which hooks this kernel offers, and load them without attaching
dump FILE...print the records of recordings as CSV
versionprint the version

Record options​

OptionMeaning
-r, --role ROLEhost (default), target, or both
-t, --transport Ttcp (default) or rdma
-d, --duration SECstop after SEC seconds (default: Ctrl-C)
-i, --interval SECone line per group every SEC seconds (default 1)
--offlineno interval lines, only the final report
-s, --sample Nrecord one command in N (default 1000); the host and the target must use the same N
-o, --output FILEsave the records to FILE
--spdk-host PATHthe host is SPDK: the binary with ntprof's probes (with a shared build, its libraries, comma-separated)
--spdk-target PATHthe target is SPDK, for example build/bin/nvmf_tgt
--exact-queuescount queue lengths per command (costs map operations on every I/O; default: the mean number in each stage, by Little's law)
--btf DIRBTF from tools/gen-btf.sh, for kernels or modules without BTF
--kprobesuse kprobes even where fentry/fexit work
--fentryuse 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):

OptionMeaning
--session DEVone namespace, nvmeXnY (default: all)
--io-type Tread, write, or both (default)
--size LISTonly these I/O sizes, for example 4K,128K

Report options​

For record, report and compare:

OptionMeaning
--detailevery component, not only the stages
--all-groupsalso groups with under 1 % of the records
--aggregation Aavg (mean, p50, p99, p99.9), min, max, or dist (all quantiles)
-j, --json FILEwrite the final report as JSON

Other options​

OptionMeaning
-c, --config FILEa task file in ini format (examples/ntprof.ini in the repository lists every key); options on the command line override it
-v, --verbosemore messages (twice: libbpf's debug output)
-h, --helpthe 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
KeyMeaningOption
[Workload]
SESSION_NAMEone namespace--session
IO_TYPEread, write or both--io-type
IO_SIZEonly these sizes, for example "4K,128K"--size
MIN_IO_SIZE, MAX_IO_SIZEa range of sizes, used when IO_SIZE is not set
[Profiling]
FREQUENCYrecord one command in N; the same on both sides-s
TIME_INTERVALseconds between progress lines-i
IS_ONLINEfalse: only the final report--offline
AGGREGATIONavg, min, max or dist--aggregation
BUFFER_SIZEMB of ring buffer for the records (at most 256)
SPDK_HOST, SPDK_TARGETthe binaries of an SPDK host or target--spdk-host, --spdk-target
[Report]
ENABLE_GROUP_BY_SIZE, ENABLE_GROUP_BY_TYPE, ENABLE_GROUP_BY_SESSIONfalse leaves the size, the I/O type or the namespace out of the groups
SHOW_ALL_GROUPSalso groups under 1 % of the records--all-groups
ENABLE_COMPONENT_DETAILevery component, not only the stages--detail
QUEUE_TRACKINGestimate (Little's law) or exact--exact-queues
ENABLE_LATENCY_DISTRIBUTION, ENABLE_LATENCY_BREAKDOWN, ENABLE_QUEUE_LENGTH, ENABLE_THROUGHPUTfalse 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.