Power Profiler Command Line Interface

CodeXL

PreviousNext
CodeXL User Guide
Help > Using CodeXL > Power Profiler > Power Profiler Command Line Interface
Power Profiler Command Line Interface

CodeXL Power Profiler provides a command line interface utility for users who prefer to use command interpreters like cmd.exe on Windows and bash on Linux. This CLI utility can be used to collect and analyze the profile data. It can also be used from a batch file or a test script.

Usage:

On Windows:

CodeXLPowerProfiler.exe <options>

On Linux:

CodeXLPowerProfiler <options>

The following options are supported:

-P <profile options>

Specify what types of data will be collected during the profile session. The following data types are supported.

power - collect all the available power counters

temperature - collect all the available temperature counters

frequency - collect all the available frequency counters

cu_power - collect cpu compute-unit power counters

cu_temperature - collect cpu compute-unit temperature counters

gpu_power - collect gpu power counters

gpu_temperature - collect gpu temperature counters

core - collect core specific attributes. This includes core frequency, p-state and process id executing on the core.

all - collect all the supported counters

-l

List all the counters supported by the local hardware, and the hardware devices that the profiler recognizes.

The counter IDs can be used with the ‘-e’ option.

The hardware device IDs can be used with the ‘-D’ option.

-e <counter,...>

Specify the comma separated list of counter names to be collected.

Use option ‘-l’ to get the supported counter names.

Note: use any one of the options -P or -e.

-D <counter,...>

Specify the comma separated list of device ids. All the counters of these devices will be profiled and collected.

Use option (-l) to get the supported devices.

-T <sampling interval>

Sampling interval in milli-seconds. The minimum value is 20ms.

-d <duration>

Profile duration in seconds.

-o <path>

Specify the output file path. The default path will be %Temp%\Codexl-Power_<timestamp> on Windows and /tmp/ Codexl-Power_<timestamp> on Linux.

-F <csv|txt>

Define the output file format:

·         csv - Comma Separated Value text file

·         txt - plain text file

The default file format is CSV file.

-C <core mask>

Specify core affinity mask for the application to be launched. Default affinity mask is all the available CPU cores.

0x1 = Core 0

0x2 = Core 1

0x4 = Core 2

0x8 = Core 3

-b

Terminate the launched application after the specified profile duration.

-w

Specify the working directory. Default will be the path of the launched application.

-h

Displays this help information.

-v

Print version string.

-z <db file output dir>

Export results to a *.cxldb file which can be imported to CodeXL GUI application.

-M process

Process profiling is based on the IPC load. Collects power consumption of all running processes during their profile run. These power values may differ with the actual power consumption. These power values can be used to get a notion of power trend and relative power consumption among running processes.

Note: Currently PMC counters are supported only on windows operating system. Supported AMD platforms are  Kaveri, Mullins, Temash and Carrizo. Please refer limitation section for further details.

 

Examples

·         Collect power values for CPU Compute Units and GPU for the duration of 10 seconds, with sampling interval of 100 milliseconds:

CodeXLPowerProfiler.exe –P cpu_power -P gpu_power -o c:\Temp\powerprof-out.txt –T 100 –d 10

·         Collect all the supported counter values for the duration of 10 seconds with sampling interval of 100 milliseconds:

CodeXLPowerProfiler.exe –P all -o c:\Temp\powerprof-out.txt –T 100 –d 10

·         Collect all the supported counter values for the duration of 300 seconds with sampling interval of 100 milliseconds, and output the data to a binary file that can be imported into the graphic client:

CodeXLPowerProfiler.exe –P all –C 0x3 -z c:\Temp\PowerOutput –T 100 –d 300

·         Collect all running process with their energy consumption shares as well as all counters during a particular profile run. Where profile duration is set to 300 seconds and profile sampling period is set to 10 milliseconds.

   CodeXLPowerProfiler.exe –M process –e all c:\Temp\PowerOutput –T 10 –d 300

·         Display help:

CodeXLPowerProfiler.exe -h

·         Display version string:

CodeXLPowerProfiler.exe -v

Sample Text output files

Sample 1: Collecting non-cumulative counters

The following command collects all non-cumulative power counters for 10 seconds, sampling them every 500 milliseconds and dumping the results to a text file:

CodeXLPowerProfiler.exe -P power -d 10 -T 500 -o C:\temp\pwr_out.txt –F txt

When run on a Kaveri APU, the content of the result text file is as below:

CODEXL POWER PROFILE REPORT

                     

PROFILE DETAILS

    CPU Details:                   Family(0x15) Model(48)

    CPU Core Mask:                 0xf

    Sampling Interval:             500 milli-seconds

    Profile Start Time:            Dec-09-2014_18-10-08

    Profile Duration:              10 seconds

 

PROFILED COUNTERS

    COUNTER ID      NAME                      CATEGORY        UNIT            DESCRIPTION   

         0.         pcie-ctrl-power           Power           Watt            Average PCIe-Controller Power for the sampling period, …        

         1.         mem-ctrl-power            Power           Watt            Average DDR Memory-Controller Power for the sampling period,…

         2.         total-apu-power           Power           Watt            Average APU Power for the sampling period, reported in Watts…

         4.         display-ctrl-power        Power           Watt            Average Display-Controller Power for the sampling period,…

         5.         cpu-cu0-power             Power           Watt            Average CPU Compute Unit Power for the sampling period, …

        16.         cpu-cu1-power             Power           Watt            Average CPU Compute Unit Power for the sampling period,…

        27.         igpu-power                Power           Watt            Average Integrated-GPU Power for the sampling period, …

PROFILE RECORDS

RecordId  Timestamp       pcie-ctrl-power   mem-ctrl-power    total-apu-power   display-ctrl-powe cpu-cu0-power     cpu-cu1-power     igpu-power       

 

     0    18:10:9:002        0.56              4.88             56.28              0.00             15.49             17.36             17.98          

     1    18:10:9:501        0.56              4.79             39.92              0.00             13.29             13.19              8.08          

     2    18:10:10:003       0.56              4.83             38.00              0.00             12.86             11.58              8.17          

     3    18:10:10:503       0.56              4.80             38.05              0.00             12.70             12.02              7.96          

     4    18:10:11:003       0.56              4.79             38.80              0.00             12.84             12.53              8.07          

     5    18:10:11:503       0.56              4.79             38.95              0.00             13.05             12.63              7.92          

     6    18:10:12:003       0.56              4.82             38.16              0.00             12.15             12.57              8.06          

     7    18:10:12:503       0.56              4.81             37.93              0.00             12.23             12.42              7.91          

     8    18:10:13:003       0.56              4.80             37.46              0.00             11.97             12.06              8.05          

     9    18:10:13:503       0.56              4.80             37.64              0.00             12.32             11.97              7.99          

    10    18:10:14:003       0.56              4.83             38.91              0.00             12.49             12.99              8.04          

    11    18:10:14:501       0.56              4.79             38.56              0.00             12.54             12.71              7.96          

    12    18:10:15:003       0.56              4.81             38.89              0.00             12.38             13.08              8.06          

    13    18:10:15:501       0.56              4.80             39.38              0.00             12.71             13.30              8.00          

    14    18:10:16:003       0.56              4.80             39.37              0.00             13.03             12.91              8.07          

    15    18:10:16:503       0.56              4.80             39.25              0.00             12.99             12.91              7.99          

    16    18:10:17:003       0.56              4.80             39.72              0.00             12.50             13.80              8.05          

    17    18:10:17:503       0.56              4.80             38.97              0.00             12.93             12.67              8.01          

    18    18:10:18:003       0.56              4.81             38.95              0.00             12.97             12.56              8.05          

    19    18:10:18:503       0.56              4.80             39.21              0.00             12.75             13.11              7.99          

    20    18:10:19:003       0.56              4.80             38.66              0.00             12.69             12.56              8.05          

Sample 2: Collecting cumulative counters

The following command collects the cumulative power counters for 10 seconds and dumping the results to a text file:

CodeXLPowerProfiler.exe -d 10 -o c:\temp\cumulative.txt -e 3,6,17,28 –F txt

When run on a Kaveri APU, the content of the result text file is as below:

 

CODEXL POWER PROFILE REPORT

 

 

PROFILE DETAILS

    CPU Details:                   Family(0x15) Model(48)

    CPU Core Mask:                 0xf

    Sampling Interval:             100 milli-seconds

    Profile Start Time:            Dec-11-2014_15-57-44

    Profile Duration:              10 seconds

 

PROFILED COUNTERS

    COUNTER ID      NAME                      CATEGORY        UNIT            DESCRIPTION   

         3.         total-apu-power-cuml      Power           Joule           Cumulative APU Power, reported in Joules.

         6.         cpu-cu0-power-cuml        Power           Joule           Cumulative CPU Compute Unit Power, reported in Joules.

        17.         cpu-cu1-power-cuml        Power           Joule           Cumulative CPU Compute Unit Power, reported in Joules.

        28.         igpu-power-cuml           Power           Joule           Cumulative Integrated-GPU Power, reported in Joules.

 

 

CUMULATIVE COUNTERS

    COUNTER                   CUMULATIVE VALUE 

    total-apu-power-cuml          228.11        

    cpu-cu0-power-cuml             48.85        

    cpu-cu1-power-cuml             50.30        

    igpu-power-cuml                78.65        

Sample 3: Collecting histogram counters

The following command collects the frequency histogram counters for 10 seconds and dumping the results to a text file:

CodeXLPowerProfiler.exe -d 10 -o c:\temp\histogram.txt -e 10,14,21,25,31 –F txt

When run on a Kaveri APU, the content of the result text file is as below:

 

CODEXL POWER PROFILE REPORT

 

 

PROFILE DETAILS

    CPU Details:                   Family(0x15) Model(48)

    CPU Core Mask:                 0xf

    Sampling Interval:             100 milli-seconds

    Profile Start Time:            Dec-11-2014_16-00-35

    Profile Duration:              10 seconds

 

PROFILED COUNTERS

    COUNTER ID      NAME                      CATEGORY        UNIT            DESCRIPTION   

        10.         cpu-core0-frequency-hist  Frequency       MHz             Histogram of CPU Core Effective Frequency.

        14.         cpu-core1-frequency-hist  Frequency       MHz             Histogram of CPU Core Effective Frequency.

        21.         cpu-core2-frequency-hist  Frequency       MHz             Histogram of CPU Core Effective Frequency.

        25.         cpu-core3-frequency-hist  Frequency       MHz             Histogram of CPU Core Effective Frequency.

        31.         igpu-frequency-hist       Frequency       MHz             Histogram of Integrated-GPU Frequency.

 

 

HISTOGRAMS OF COUNTERS

 

    COUNTER                  cpu-core0-frequency-hist 

      HISTOGRAM           

       low      high      count

         0       200         0

       200       400         0

       400       600         0

       600       800        16

       800      1000        16

      1000      1200         5

      1200      1400        22

      1400      1600        29

      1600      1800        11

      1800      2000         1

      2000      2200         0

      2200      2400         0

      2400      2600         0

      2600      2800         0

      2800      3000         0

      3000      3200         0

      3200      3400         0

      3400      3600         0

      3600      3800         0

      3800      4000         0

 

    COUNTER                  cpu-core1-frequency-hist 

      HISTOGRAM           

       low      high      count

         0       200         0

       200       400         0

       400       600         0

       600       800         6

       800      1000        79

      1000      1200        13

      1200      1400         1

      1400      1600         1

      1600      1800         0

      1800      2000         0

      2000      2200         0

      2200      2400         0

      2400      2600         0

      2600      2800         0

      2800      3000         0

      3000      3200         0

      3200      3400         0

      3400      3600         0

      3600      3800         0

      3800      4000         0

 

    COUNTER                  cpu-core2-frequency-hist 

      HISTOGRAM           

       low      high      count

         0       200         0

       200       400         0

       400       600         0

       600       800         0

       800      1000         0

      1000      1200         0

      1200      1400         0

      1400      1600         2

      1600      1800        98

      1800      2000         0

      2000      2200         0

      2200      2400         0

      2400      2600         0

      2600      2800         0

      2800      3000         0

      3000      3200         0

      3200      3400         0

      3400      3600         0

      3600      3800         0

      3800      4000         0

 

    COUNTER                  cpu-core3-frequency-hist 

      HISTOGRAM           

       low      high      count

         0       200         0

       200       400         0

       400       600         0

       600       800         0

       800      1000        28

      1000      1200        45

      1200      1400        25

      1400      1600         1

      1600      1800         1

      1800      2000         0

      2000      2200         0

      2200      2400         0

      2400      2600         0

      2600      2800         0

      2800      3000         0

      3000      3200         0

      3200      3400         0

      3400      3600         0

      3600      3800         0

      3800      4000         0

 

    COUNTER                  igpu-frequency-hist      

      HISTOGRAM           

       low      high      count

         0       100         0

       100       200         0

       200       300         0

       300       400       100

       400       500         0

       500       600         0

       600       700         0

       700       800         0

       800       900         0

       900      1000         0

Sample 3: Collecting process profiling data

The following command collects the process profiling data for 100 seconds and dumping the results to a text file:

CodeXLPowerProfiler.exe -d 10 –T 10 -o c:\temp\histogram.txt –M process –F txt

When run on a Carrizo APU, the content of the result text file is as below:

CODEXL POWER PROFILE REPORT

PROFILE DETAILS

    CPU Details:                   Family(0x15) Model(0x60)

    CPU Core Mask:                 0xf

    Sampling Interval:             10 milli-seconds

    Profile Start Time:            Mar-30-2016_00-20-44

    Profile Duration:              100 seconds

 

PROCESS PROFILING DATA

SNo     PID      Samples IPC   Power(Joules)           Power(%)      Name                          Path

 

0          4956   11        3.34     0.04                 0.03                 CodeXLPowerProfiler.exe             \Program Files (x86)\CodeXL

1          0          383503           31755   109.58                 95.28              [System Process]                                       Unable to read path

2          648     1          0.38     0.01                 0.01                 lsass.exe                                                C:\Windows\System32

3          900     54        13.72  0.06                 0.05                 dwm.exe                                                  C:\Windows\System32

4          4          224     96.76  0.24                 0.21                 System                                                   Unable to read path

5          2140   294     232.54            0.82                 0.71                 explorer.exe                                             C:\Windows

6          760     4          1.04     0.00                 0.00                 svchost.exe                                              C:\Windows\System32

7          1648   16        5.71     0.02                 0.01                 MsMpEng.exe                                 Unable to read path

8          548     15        2.21     0.01                 0.01                 csrss.exe                                                Unable to read path

9          4396   1066   710.18            3.86                 3.36                 iexplore.exe                                             C:\Program Files (x86)\Internet Explorer

10        680     178     170.15            0.29                 0.25                 svchost.exe                                              C:\Windows\System32

11        5296   1          0.44     0.00                 0.00                 conhost.exe                                              C:\Windows\System32

12        2500   2          0.29     0.00                 0.00                 svchost.exe                                              C:\Windows\System32

13        1320   6          2.57     0.01                 0.01                 svchost.exe                                              C:\Windows\System32

14        1160   2          0.80     0.00                 0.00                 SearchIndexer.exe                         C:\Windows\System32

15        456     35        15.70  0.04                 0.03                 svchost.exe                                              C:\Windows\System32

16        1108   11        7.65     0.02                 0.01                 svchost.exe                                              C:\Windows\System32

17        640     3          0.84     0.00                 0.00                 services.exe                                             Unable to read path

18        936     2          1.00     0.00                 0.00                 svchost.exe                                              C:\Windows\System32

19        1448   3          1.22     0.00                 0.00                 taskhostex.exe                                           C:\Windows\System32

20        720     2          0.46     0.00                 0.00                 svchost.exe                                              C:\Windows\System32

21        1612   2          0.63     0.00                 0.00                 WUDFHost.exe                               C:\Windows\System32

22        1296   4          1.42     0.00                 0.00                 spoolsv.exe                                              C:\Windows\System32

23        2736   1          0.25     0.00                 0.00                 sppsvc.exe                                               Unable to read path

 

Profile Sesssion Power Consumption:        115.00

Total PID record collected 385440