Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Module

The CLI Module is the straightforward entry point for users.

It parses command-line input and configure the profiler to be usable quickly and easily while providing several configuration options. The CLI acts as an adapter between the user, the core domain, and the sources. Because of this separation, the CLI can evolve independently from the core logic and sources.

Here’s a summary of all the CLI arguments:

ArgumentShortLongDefaultDescription
verbose-v--verbose0Verbosity level. Stack for more detail: -v, -vv, -vvv.
rapl_path--rapl-pathAuto-detectedOverride the base path for Intel RAPL counters. Falls back to $JOULE_PROFILER_RAPL_PATH, then /sys/devices/virtual/powercap/intel-rapl.
sockets-s--socketsAllCPU sockets to measure (e.g., 0 or 0,1).
json--jsonfalseExport results as JSON. Conflicts with --csv.
csv--csvfalseExport results as semicolon-separated CSV. Conflicts with --json.
output_file-o--output-filedata<TIMESTAMP>.csv/jsonCustom output file path for CSV/JSON export.
gpu--gpufalseEnable GPU measurement support.
perf--perffalseEnable perf_event hardware counters.
rapl_backend--rapl-backendPerfChoose RAPL backend: powercap or perf.
command(subcommand)(required)The subcommand/program to execute and profile.

The subcommand profile has also some arguments:

ArgumentShortLongDefaultDescription
token_pattern--token-pattern__[A-Z0-9_]+__Regex to detect phase tokens in the program’s stdout. If the pattern contains a capture group, the captured text becomes the token name. Phases are computed between consecutive tokens (and from START/END).
stdout_file-o--stdout-fileNoneRedirect the profiled program’s stdout to a file.
rapl_polling--rapl-pollingNoneRAPL counter polling frequency, in seconds.

The profiled command is provided after -- at the end of the arguments.