Memory tracing helps to analyze total dynamic memory allocated, total time taken to allocate the memory, allocation and de-allocating count by a process. This is crucial for identifying and diagnosing issues such as memory leaks and excessive memory usage by application.
Prerequisites
- Linux kernel 4.15 or later is required.
- From the AMDuProf installed directory, run the script AMDuProfSetup.sh with root
access.
sudo ./AMDuProfSetup.sh
If you install AMD uProf using DEB installer, the script is run by the installer and the info about eBPF (Extended Berkeley Packet Filter) support on the host and memory tracing support is provided.
Options
| Option | Description |
|---|---|
--memory-threshold <threshold in
bytes>
|
By default, AMDuProf traces memory allocations of size more than or equals to 1KB. To trace memory allocations of custom size, use this option to set the threshold. |
Data Collection using CLI
- Memory tracing with default threshold value
>=1KB
AMDuProfCLI collect --trace memory -o <output-dir> <application> - Memory tracing with threshold value
>=4KB
AMDuProfCLI collect --trace memory --memory-threshold 4096 -o <output-dir> <application>
Once profile data collection is complete, a session directory will be generated. Use session directory to generate the csv report (or) to import the session in GUI.
Refer Table 1 for all supported options.
amd@uprof-ethanolx5 bin]$ ./AMDuProfCLI t --trace memory -o /tmp/ /tmp/ScimarkStable
Profiling started
………
Profiling (data collection) completed
Generated data files path: /tmp/AMDuProf-ScimarkStable-CpuTrace_Sep-06-2024_03-38-23
Here, the generated session directory is
/tmp/AMDuProf-ScimarkStable-CpuTrace_Sep-06-2024_03-38-23.
Analyze the Data Using CLI
AMDuProfCLI report -i <session directory>
Refer Table 1 for all supported options.
[amd@uprof-ethanolx5 bin]$ ./AMDuProfCLI report -i /tmp/ AMDuProf-ScimarkStable-CpuTrace_Sep-06-2024_03-38-23
Translation started
…
Report generation started
…
Report generation completed...
Generated report file: /tmp/ AMDuProf-ScimarkStable-CpuTrace_Sep-06-2024_03-38-23/report.csv
Limitations
- System wide data collection is not supported by memory tracing.
- Analyzing the 32-bit applications is not supported.
- Memory tracing is supported only in CLI.
- Memory tracing CLI session cannot be imported to GUI and is not supported.