Options - Options - 57368

uProf User Guide

Document_ID
57368
Release_Date
2025-06-09
Revision
5.1 English

The following table lists the collect command options.

Table 1. AMDuProfCLI Collect Command Options
Option Description
-h| --help Displays the help information on the console/terminal.

-o| --output-dir <directory-path>

Base directory path in which collected data files will be saved. A new sub- directory will be created in this directory.
--<collect-config>

Predefined sampling configuration to be used to collect samples.

Use the command info --list collect-configs to get the list of supported configs. Multiple occurrences of --config are allowed.

-e | --event or <predefined-event>

A predefined event can be directly be used with -e, --event which has predefined arguments.

Alternatively, for providing more granular parameters, specify Timer, PMU, IBS event, or a predefined event with arguments in the form of comma separated key=value pairs. The supported keys are:

  • event=<timer | ibs-fetch | ibs-op> or <PMU-event> or <predefined-event>
  • umask=<unit-mask>
  • user=<0 | 1>
  • os=<0 | 1>
  • cmask=<count-mask> (Value should be in the range 0x0 to 0x7f)
  • inv=<0 | 1>
  • interval=<sampling-interval>
  • frequency=<frequency (n)> (Supported only for Core PMC events, the frequency should be provided in Hz)
  • ibsop-count-control=<0 | 1> (For ibs-op event. Choose IBS OP sampling by cycle(0) count or dispatch(1) count.)
  • loadstore (for ibs-op event, only on Windows platform)
  • Ibsop-l3miss=<0 | 1> (Do not filter out any IBS OP samples (0), or filter out all IBS OP samples except loads/stores that miss in the L3 cache (1); supported only on AMD Zen4 and later processors.)
  • ibsfetch-l3miss=<0 | 1> (Do not filter out any IBS FETCH samples (0), or filter out all IBS FETCH samples except those that miss in the L3 cache (1); supported only on AMD Zen4 and later processors.)
  • call-graph
Note:
  1. It is not required to provide umask with predefined event.
  2. Use the dedicated option --call-graph to specify the arguments related to the call stack sample collection.

Argument details:

  • user – Enable(1) or disable(0) user space samples collection
  • os - Enable(1) or disable(0) kernel space samples collection
  • interval – Sample collection interval. For timer, it is the time interval in milliseconds. For PMU and predefined events, it is the count of the event occurrences. For IBS FETCH, it is the fetch count. For IBS OP, it is the cycle count or the dispatch count.
  • ibsop-count-control – Choose IBS OP sampling by cycle(0) count or dispatch(1) count.
  • loadstore – Enable only the IBS OP load/store samples collection, other IBS OP samples are not collected.
  • ibsop-l3miss – Don't filter out any IBS OP samples (0), or filter out all
  • ibsfetch-l3miss – Enable IBS FETCH sample collection only when aa l3 miss occurs. For example, -e event=ibs-fetch,interval=100000,ibsfetch- l3miss

When these arguments are not passed, then the default values are:

  • umask=0
  • cmask=0x0
  • user=1
  • os=1
  • inv=0
  • ibsop-count-control=1 (for ibs-op event)
  • ibsop-l3miss=0
  • ibsfetch-l3miss=0
  • interval=1.0 ms for timer event
  • interval=250000 (for ibs-fetch, ibs-op, PMU-event)
-p| --pid <PID...>

Profile the existing processes by attaching to a running process. The process IDs are separated by comma.

Note: A maximum of 512 processes can be attached at a time.
-a| --system-wide

System Wide Profile (SWP)

If this flag is not set, then the command line tool will profile only the launched application or the Process IDs attached with -p option.

-c| --cpu <core...>

Comma separated list of CPUs to profile. The ranges of CPUs can be specified with ‘-’, for example: 0-3. This option is not supported while profiling MPI applications.

Note: On Windows, the selected cores should belong to only one processor group. For example, 0-63, 64-127, and so on.
-d| --duration <n> Profile only for the specified duration n in seconds.
--interval <num>

Sampling interval for PMC events.

Note: This interval will override the sampling interval specified with individual events.
--affinity <core...> Set the core affinity of the launched application to be profiled. Comma separated list of core-ids. The ranges of the core-ids must be specified, for example, 0-3. The default affinity is all the available cores. This option is not supported while profiling MPI applications.
--no-inherit Do not profile the children of the launched application (processes launched by the profiled application).
-b| --terminate Terminate the launched application after the profile data collection ends. Only the launched application process will be killed. Its children (if any) may continue to execute.
--start-delay <n> Start delay n in seconds. Start profiling after the specified duration. When n is 0, there is no impact.
--start-paused Profiling paused indefinitely. The target application resumes the profiling using the profile control APIs. This option must be used only when the launched application is instrumented to control the profile data collection using the resume and pause APIs (defined in the AMDProfileControl APIs ).
-w| --working-dir <path> Specify the working directory. The default is the current working directory.
--log-path <path-to-log- dir>

Specify the path where the log file should be created. If this option is not provided, the log file will be created either in path set by AMDUPROF_LOGDIR environment variable or $TEMP path (Linux, FreeBSD) or %TEMP% path (on Windows) by default.

The log file name will be of the format $USER-AMDuProfCLI.log (on Linux, FreeBSD) or %USERNAME%-AMDuProfCLI.log (on Windows).

--enable-logts Capture the timestamp of the log records. It should be used with --enable-log option.
--limit-size <n>

Stop the profiling when the collected data file size (in MB) crosses the specified limit.

Note: This option may be deprecated in future releases.
--frequency <n> | --freq <n>| -F <n>

Enable data collection at the specified frequency 'n' (in Hz) for Core PMC events.

Note: This frequency will override the sampling frequency specified with the individual events.
--env-var <key1=value1:key2=value2:...> Use this option to set the environment variables.
--call-graph <I:D:S:F>

OS Support: Windows

Enables callstack Sampling. Specify the Unwind Interval (I) in milliseconds and Unwind Depth (D) value. Specify the Scope (S) by choosing one of the following:

  • user: Collect only for the user space code.
  • kernel: Collect only for the kernel space code.
  • all: Collect for the code executed in the user and kernel space code. Specify to collect missing frames due to Frame Pointer Omission (F) by compiler:
  • fpo: If the frame pointers are not available, collect callstack information using unwind information.
  • fp: Use the frame pointers to collect callstack information.
--call-graph <F:N>

OS Support: Linux

Enables callstack sampling. Specify (F) to collect/ignore missing frames due to omission of frame pointers by compiler:

  • fpo | dwarf: Collect the process callstack during sample collection and use the DWARF information to reconstruct callstack.
  • fp: Use the frame pointers to collect callstack information.

When F = fpo, (N) specifies the max stack-size in bytes to collect per sample collection. Valid range of the stack size: 16 - 32768. If N is not a multiple of 8, it is aligned down to the nearest value multiple of 8. The default value is 1024 bytes.

Note: Passing a large N value will generate a very large raw data file.

When F = fp; the value for N is not applicable and ignored if passed.

-g OS Support: Linux | Windows

Same as passing --call-graph fp (Linux).

Same as passing --call-graph1:128:user:fp (Windows).

--call-graph-mode <fp|fpo> OS Support: Windows

Set callstack collection mode.

  • fpo - If frame pointers are not available, collect call-stack information using unwind information.
  • fp - Use Frame pointers to collect callstack information.

Default mode is fp.

--call-graph-mode <fp|fpo|dwarf> OS Support: Linux

Callstack collection mode. Default mode is fp.

  • fp: Use Frame pointers to collect call stack information.
  • fpo | dwarf: Collect process call stack during sample collection and use DWARF information to reconstruct the call stack.
--call-graph-type <scope type> OS Support: Windows

Set callstack scope type.

Scope type should contain one of these options:

  • user - Collect only for user space code.
  • kernel - Collect only for kernel space code.
  • all - Collect for code executed in user and kernel space.

Default scope type is user.

--call-graph-interval <num> OS Support: Windows

Set callstack unwind interval. Interval must be within the range [1 - 100]. Default interval is 1 ms.

--call-graph-depth <num> OS Support: Windows

Set callstack unwind depth. Depth must be within the range [2 - 392]. Default depth is 128.

--call-graph-depth <num> OS Support: Linux

Set callstack unwind depth. Depth must be within the range [2 - 1024]. Default depth is 32.

--call-graph-size <size> OS Support: Linux

Callstack Size. Default size is 1024 bytes.

When mode = fpo | dwarf; size must be within [16 - 32768] and specifies the max stack- size (in bytes) to collect per call stack sample.

When mode = fp; the size is not applicable and ignored if passed.

--thread <thread=concurrency> OS Support: Windows

Collect the thread run time info to report thread concurrency. Thread concurrency provides how much time specific no of threads are running simultaneously.

-m| --data-buffer- count <size> OS Support: Windows

Size (number of pages per core) of the buffer used for data collection by the driver. The default size is 512 pages per core.

--limit-data <n> OS Support: Windows

Stop the profiling when the collected data file size (in MB) crosses the specified limit. When used with the option --overwrite, the limit is before the collection is terminated. Size can be specified with the suffix Mega Bytes (M/ m), Giga Bytes (G/g), or Seconds (secs).

--overwrite OS Support: Windows

Specify the profile data collection mode as a ring buffer. The collection limit can be set using the option --limit-data. The default --limit-data is to restrict the raw data file size to 512 pages per core.

--tid <TID,..> OS Support: Linux

Profile existing threads by attaching to a running thread. The thread IDs are separated by comma.

--trace <TARGET> OS Support: Linux

To trace a target domain. TARGET can be one or more of the following:

  • osrt - to enable tracing of os runtime. Use command info --list trace-events for the list of trace events.
  • func - to enable tracing of functions. Use '--func', '--func-size' and '--func-threshold' to configure additional options.
  • memory - to enable tracing of dynamic memory allocations. Use '--memory-threshold' to configure threshold.
  • mpi - to enable tracing of MPI application. Use --mpi-impl and --mpi-scope to configure additional options.
  • openmp - to enable tracing of OpenMP application.

    Use --openmp-impl and --openmp-scope to configure additional options.

    Note: Applicable to per process profiling. Not applicable to:
    • System wide profiling
    • Java app profiling
    • Attach process profiling
    • For ompt - application should be compiled with LLVM-8 or later, AOCC-2.1 or later, ICC-19.1 or later.
    • For omplib - application should be compiled with GCC-7 or later.
    • Supported base languages are: C, C++, and Fortran.
  • gpu - To trace a target application on GPU. By default, the domain is set to hip and hsa.
--mpi-impl <mpich| openmpi> OS Support: Linux

Provide MPI implementation type: openmpi for tracing OpenMPI library, mpich for tracing MPICH and it's derivative libraries. Default selection is mpich.

Note: Use this option with --trace mpi option.
--mpi-scope <lwt| full> OS Support: Linux

Provide tracing scope: lwt for light-weight tracing, full for complete tracing. Default scope type is full.

Note: Use this option with --trace mpi option.
--openmp-impl <ompt| omplib> OS Support: Linux

Provide OpenMP implementation type: ompt for tracing of OpenMP libraries supporting OMPT interface (example: LLVM, AOCC), omplib for tracing GCC OpenMP library. Default selection is ompt.

Note: Use this option with --trace openmp option.
--openmp-scope <full|basic> OS Support: Linux

Provide tracing scope: full for complete tracing, basic for basic tracing, where synchronization related OpenMP events are not traced to reduce the disk space usage. Default selection is basic.

Note:
  1. Use this option with --trace openmp option.
  2. This option is only applicable with --openmp-impl ompt.
--osrt-event <event1,event2...> OS Support: Linux

Provide event names. Use command info --list trace-events for the list of trace events.

Note: Use this option with --trace osrt option.
--osrt-threshold <event:threshold> OS Support: Linux

Provide event name and threshold value.

Note: Use this option with --trace osrt option.
--osrt-funcs <module:function- pattern> OS Support: Linux

Specify functions to trace from the library or executable.

  • Function-pattern can be a function name or partial name ending with '*'. Use only '*' to trace all the functions of a module.
  • Module can be absolute path to library or executable.
  • This option will be deprecated in a future release. Recommended to use --func.
--osrt-exclude-funcs <module:function- pattern> OS Support: Linux

Specify functions to trace from the library or executable.

  • Function-pattern can be a function name or partial name ending with '*'. Use only '*' to trace all the functions of a module.
  • Module can be absolute path to library or executable.

This option will be deprecated in a future release. Recommended is to use --exclude-func.

--osrt-func-size <size> OS Support: Linux

Provide minimum function size to trace. Default function size is 128 bytes.

This option will be deprecated in a future release. Recommended to use --func-size.

Note: Use this option with --trace osrt option.
--func <module:function - pattern> OS Support: Linux

Specify functions to trace from the library or executable:

  • Function-pattern can be a function name or partial name ending with '*' or only '*' to trace all the functions of a module.
  • Module can be a library or executable.
Note: It is recommended to provide the absolute/full path of a module.
--exclude-func <module:function- pattern> OS Support: Linux

Specify functions to exclude from the library or executable:

  • Function-pattern can be a function name or partial name ending with '*' or only '*' to trace all the functions of a module.
  • Module can be a library or executable.
Note: It is recommended to provide the absolute/full path of a module.
-m| --mmap-pages <size> OS Support: Linux

Set the kernel memory mapped data buffer to size. The size can be specified in pages or with a suffix Bytes (B/b), Kilo bytes (K/k), Megabytes (M/m), and Gigabytes (G/g).

--mpi OS Support: Linux

Pass this option while collecting CPU Profiling data of a MPI application. For MPI tracing, use the collect command with --trace option.

--kvm-guest <pid> OS Support: Linux

Specify the PID of qemu-kvm process to be profiled to collect guest-side performance profile.

--guest- kallsyms <path> OS Support: Linux

Specify the path of guest /proc/kallsyms copied on the local host. AMD uProf reads it to get the guest kernel symbols.

--guest- modules <path> OS Support: Linux

Specify the path of guest /proc/modules copied to the local host. AMD uProf reads it to get the guest kernel module information.

--guest-search-path <path> OS Support: Linux

Specify the path of guest vmlinux and kernel sources copied on the local host. AMD uProf reads it to resolve the guest kernel module information.

--branch-filter OS Support: Linux

Capture LBR data.

You can also specify the branch filter type:
  • u: user branches
  • k: kernel branches
  • any: any branch type
  • any_call: any call branch
  • any_ret: any return branch
  • ind_call: indirect calls
  • ind_jmp: indirect jumps
  • cond: conditional branches
  • call: direct calls
Note:
  1. When the above filters are not set, the default filter type will be any.
  2. This option will work only with PMC events.
  3. This is applicable to per process and attach process profiling. However, it is not applicable to Java app profiling.