Step 3: creating the hpcpi database directory, Step 4: starting the hpcpi daemon, Step 5: running the code you want to analyze – HP XC System 3.x Software User Manual

Page 32: Step 6: flushing the hpcpi data to disk

Advertising
background image

You will create the directory in the next step.

The following example uses the directory /tmp/hpcpidb:

% setenv HPCPIDB /tmp/hpcpidb

For information about selecting directories for HPCPI databases, see

“Selecting a Location for

the HPCPI Database Directory” (page 36)

.

Step 3: Creating the HPCPI Database Directory

Enter the following command to create the directory for the database:

% mkdir -p $HPCPIDB

Step 4: Starting the HPCPI Daemon

Enter the following command to start the HPCPI daemon (hpcpid):

% hpcpid

The HPCPI daemon displays information about the events it monitors. By default, the daemon
monitors CPU cycles used. For information on specifying other events for monitoring, see

“Selecting Events to Monitor” (page 37)

.

Step 5: Running the Code You Want to Analyze

Run the code you want to analyze. In this example, the user analyzes the code for myApp:

% ./myApp

Step 6: Flushing the HPCPI Data to Disk

After you run the application, enter the following command to flush the HPCPI data to disk:

% hpcpictl flush

By default, the hpcpid daemon flushes data to disk every 10 minutes. Running the hpcpictl
flush

command causes hpcpid to immediately flush the data to disk so the HPCPI analysis

tools can read the data.

Step 7: Viewing Per Image Statistics for the System

The following command displays per-image statistics for all binary images that were active on
the system and for which HPCPI recorded performance data:

% hpcpiprof

The hpcpiprof utility prints a header, followed by a table with an entry containing data for
each image or procedure. In this example, the header is as follows:

Event Name Events Period Samples
---------- ------------- ------ ---------
CPU_CYCLES 7969037220000 60000 132817287

The header contains one entry for each event.

Next, hpcpiprof displays a data table with per-image statistics:

CPU_CYCLES % cum% image
---------- ----- ------ ----------------------------
385649e7 48.4% 48.4% vmlinux-2.6.9-34.7hp.XCsmp
198708e7 24.9% 73.3% libm-2.3.4.so
192510e7 24.2% 97.5% myApp
10636e7 1.3% 98.8% libperl.so
:
:

For descriptions of the output data, see

“Viewing Per-Image Data: hpcpiprof” (page 44)

.

32

Getting Started with HPCPI

Advertising