The CLI has a config type called “memory” to cache the analysis data. Run the following command to collect the profile data:
$ AMDuProfCLI collect --config memory -o /tmp/cache_analysis <target app>
This command will launch the program and collect the profile data required to
generate the cache analysis report. The raw profile data file is created in
/tmp/cache_analysis/AMDuProf- IBS_<timestamp>/ directory.
Report Generation and Analysis
$ AMDuProfCLI report -i /tmp/cache_analysis/AMDuProf-IBS_<timestamp>/
This will generate a CSV report in /tmp/cache_analysis/AMDuProf- IBS_<timestamp>/report.csv and it will have the following sections.
- SHARED DATA CACHELINE SUMMARY: Lists the summary values of all the metrics.
- SHARED DATA CACHELINE REPORT: Lists the cache lines and the associated summary values of the metrics.
- SHARED DATA CACHELINE DETAIL REPORT: Lists the following.
- The cache lines having a potential false sharing
- Offsets where those accesses occur, readers and writers to those offsets
- PID, TID, Function Name, Source File, and Line Number for those reader and writers
- Load latency for the loads to those cache lines
- Supported metrics
The following figure shows the Cache Analysis summary sections.
The following figure shows the Cache Analysis detailed report
--sort-by event=<METRIC>
option (for example, --sort-by event=ldst-count) to
change the sorting by order during the report generation.
| Sort-by Metric | Description |
|---|---|
| ldst-count | Total Loads and stores sampled |
| ld-count | Total Loads |
| st-count | Total Stores |
| cache-hitm | Loads that were serviced either from the local or remote cache (L3) and the cache hit state was Modified. |
| lcl-cache-hitm | Loads that were serviced from the local cache (L3) and the cache hit state was Modified. |
| rmt-cache-hitm | Loads that were serviced from the remote cache (L3) and the cache hit state was Modified. |
| lcl-dram-hit | Loads that hit in local memory (memory channels attached to local socket or local CCD). |
| rmt-dram-hit | Loads that hit in remote memory (memory channels attached to remote socket or other CCDs in the local socket). |
| l3-miss | Loads that are missed in local cache (L3) and serviced by remote cache, local, or remote DRAM. |
| st-dc-miss | Store operations missed in data cache. |
info --list cacheline-events for a list of supported metrics for
sort-by option.