14. Reference

14.1. CPU Profiling

The AMD uProf CPU Performance Profiling follows a sampling-based approach to gather the profile data periodically. It uses a variety of software and hardware resources available in AMD x86 based processor families. CPU Profiling uses the OS timer, HW Performance Monitor Counters (PMC), and HW IBS feature.

The following section explains the various key concepts related to CPU Profiling.

14.2. Virtualization Support

AMD uProf supports profiling in the virtualized environments. Availability of the profiling features depends on the counters virtualized by the hypervisor manager. Currently, AMD uProf supports the following hypervisors (with Linux and Windows OS as guest on these virtualized environments):

CPU Profiling supports:

14.2.1. Feature Support Matrix on Various Hypervisors

Table 14.1 Feature Support Matrix#

Microsoft Hyper-V

Microsoft Hyper-V

Microsoft Hyper-V

KVM

KVM

VMware ESXi

VMware ESXi

Citrix Xen

Citrix Xen

Features

Host Root Partition (system mode)

Host Root Partition

Guest VMs

Host

Guest VMs

Host

Guest VMs

Host

Guest VMs

CPU Profiling

Time Based Profiling (TBP)

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Micro- architecture Analysis (EBP)

Yes

Yes

Yes

Yes

Yes

Yes

Yes

No

No

Instruction Based Sampling (IBS)

Yes

No

No

No

No

No

No

No

No

Cache Analysis

Yes

No

No

No

No

No

No

No

No

HPC – MPI Code Profiling

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

HPC– OpenMP Tracing

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

HPC– MPI Tracing

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

OSTracing

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Power Profiling

LivePower Profile

Yes

Yes

No

Yes

No

No

No

No

No

Power Application Analysis

No

No

No

No

No

No

No

No

No

User Interface

Graphical Interface

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Command Line

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

API

ProfileControl API

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

PowerProfiler API

No

No

No

No

No

No

No

No

No

Instrumental API

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

System Analysis

AMDuProfPCM

Yes

Yes

Yes

Yes

Yes

Yes

Yes

No

No

AMDuProfSys

Yes

Yes

Yes

Yes

Yes

Yes

Yes

No

No

14.3. Troubleshooting

14.3.1. Enable Logging

Scenario: To report any issues observed in the uProf, it might be helpful to generate the logs and pass the log files to uProf team to analyze the issue.

Suggestion/Solution: Follow the steps below to enable logging in uProf before running the use case.

Table 14.2 Enable Logging#

uProfCLI Option

Description

--enable-logts

Use this option to capture the timestamps of the log records. This is same as --log ts.

--log-level <level>

Specify the verbosity of log messages generated. Valid values are 1 to 5.

  • 1 - ERROR

  • 2 - ERROR + WARNING (default level)

  • 3 - ERROR + WARNING + INFO

  • 4 - ERROR + WARNING + INFO + DEBUG

  • 5 - ERROR + WARNING + INFO + DEBUG + TRACE

Note

Levels are accumulated, for example selecting level 4 means enabling all the levels 1 to 4.

--log <level>,ts,<path>

This is a shorthand option for all relevant log settings.

  • <level> - verbosity of log messages, same as --log-level option.

  • ts - capture timestamp of log messages.

  • <path> - path where log files will be generated.

--log-path <path-to-log-dir>

Specify the path to where log file should be created. If this option is not provided, by default the log file will be created either in path set by AMDUPROF_LOGDIR environment variable or default path.

Note

  1. If AMDUPROF_LOGDIR is set, its value is used as the path to create the log file.

  2. Refer the table Log File Path for OS specific log file names.

The default location of the generated log files:

Table 14.3 Default Log File Paths#

Platform

Interface

Default Path

FreeBSD

CLI

  • /tmp/${USER}-AMDuProfCLI.log

  • /tmp/${USER}-AMDuProfCLI.log

Linux

GUI

${HOME}/.AMDuProf/http/logs/<pid>.log

Windows

GUI

%userprofile%\.AMDuProf\http\logs\<pid>.log

Windows

CLI

%TEMP%\%USERNAME%-AMDuProfCLI.log

After enabling logging, run the use case to generate the log. The log file can be shared with the uProf team to analyze any issue observed.

AMDuProfPcm option --verbose prints logs to standard output stream. Only available for Perf mode.

14.3.2. Running the AMDuProf Installer with Verbose Logging

To assist with troubleshooting installation issues, you can run the AMDuProf installer from the command line and enable detailed logging. This captures verbose output that may help diagnose problems.

Command Syntax:

AMDuProf-<version>.exe /debuglog"c:\temp\uProfInstallerLogfile.txt"

Where:

Example:

AMDuProf-<version>.exe /debuglog"c:\temp\uProfInstallerLogfile.txt"

Notes:

14.4. Useful URLs

For the processor specific PMC events and their descriptions, refer the following AMD developer documents: