• Aucun résultat trouvé

Monitoring a Processor's CPU Activity

Dans le document About This Guide (Page 124-128)

To optimize an application, it is helpful to know where in the application most of the processing activity is occurring.

The system programmer can then concentrate on optimizing that area of the application.

The MHISTOGRAM command generates a listing that indicates the level of activity for specified areas of a processor's central processing unit (CPU) memory. You can then isolate the memory address ranges where an

application is spending the most CPU processing time.

The mHistogrammer utility displays a series of prompts through which you determine the target processor, address range, and number of samples to histogram.

To monitor an application's CPU time, use the following procedure:

1 Use the MPARTITION STATUS command with the verbose option to find out the address range the

application is executing in. (Refer to section 7 for more information about the MPARTITION STATUS

command.)

Note the target address range, using paragraph

numbers. (Refer to the BTOS II Language Development Reference Manual for more information on memory paragraphs.)

2 Install the mHistogrammer monitoring program on the target processor. The run file for the mHistogrammer monitoring program is [sys]<sys>mHistoProc.run.

You can install the monitoring program in a primary or secondary partition. Refer to section 7 for more

information on how to install an application into a processor.

10·2 Monitoring XE520 Processor Activity 3 Execute die MHISTOGRAM command by entering

MHISTOGRAM on the Executive command line.

To exercise either of the available options, creating a log file or suppressing page pauses, press RETURN and fill in the command form. Figure 10-1 shows the MHISTOGRAM command form. Table 10-1 describes the MHISTOGRAM command form fields.

Press GO.

The mHistogrammer utility prompts for the processor to histogram.

4 Enter the processor designation (for example, FPOO, CPO 1) of the processor the application is running on.

Press RETURN.

The utility prompts for the starting paragraph number, in hexadecimal (hex).

5 Enter the starting paragraph number, in hex, and press RETURN. You must use four digits (for example, 0040 for paragraph 40).

The utility prompts for the ending paragraph number, in hex.

6 Enter the ending paragraph number, in hex, and press RETURN. You must use four digits (for example, 0040 for paragraph 40).

The mHistogrammer utility prompts for the bucket size, by paragraphs, in hex.

Buckets are the areas the targeted address range is divided into. Each bucket in the range is monitored for CPU activity. The mHistogrammer generates a listing of the buckets, by address range, and the percent of CPU time spent in each bucket.

7 Enter the size, in hex, of a bucket, and press RETURN.

The resulting number of buckets [(EndPara - StartPara

+

1)/BucketSize] must be an integer from 1 to 512. If the bucket size is too small, the number of buckets exceeds 512, and the utility picks a size for you.

The utility prompts for the number of clock ticks to histogram.

8 Enter the number of CPU clock ticks for the sample interval and press RETURN.

This number represents the number of times you want the mHistogrammer utility to interrupt processing and check to see the address of the instruction that the CPU is currently executing.

For FPs, DPs, and SPs, the interrupt rate is 100 Hz.

Therefore, if you want to sample for one second, enter 100; for 10 seconds, 1000; and so on.

For CPs and TPs, the interrupt rate is 1302 Hz.

Therefore, if you want to sample for approximately one second, enter 1300; for approximately 10 seconds, 13000; and so on.

Figure 10-1 MHISTOGRAM Command Form mHlstogram

I

[Log file]

[Suppress pause between pages?]

Table 10-1 Field [Log file]

MHISTOGRAM Command Form Fields Action/Explanation

Enter the name of the file the mHistogrammer report is to be written to. If the log file already exists, the existing file is deleted and the new file created in its place. If it does not exist, the log file is created.

To have the report automatically printed and not saved, enter the name of a printer queue, enclosed in square brackets.

If you do not name a print file; the information only displays on screen.

10·4 Monitoring XE520 Processor Activity Table 10-1 MHISTOGRAM Command Form Fields

(continued)

Field Action/Explanation

[Suppress pauses between pages?]

The default is no; leave this field blank to have the system prompt you before each screen of data when the MHistogrammer report displays.

Enter yes to suppress the Next page prompts.

The report will scroll forward to its end when it displays.

After you enter the number of clock ticks and press RETURN, the histogramming utility executes and a generates a report. The report lists the following information:

o the number of slots in the array (that is, the number of buckets)

o the total number of ticks counted

o the number of ticks for which the CPU executed an instruction in the specified address range, and this number expressed as a percentage of the total number of ticks counted

o the range of each bucket, by paragraph

o the number of ticks for each bucket (that is, the number of times the CPU was found to be executing an

instruction in that bucket's address range)

o

the number of ticks in each bucket expressed as a percentage of (1) the number of ticks in the specified range and (2) the number of total ticks counted After displaying the report, the mHistogrammer utility prompts you- to choose whether to do another histogram.

You enter yes and press RETURN to run through the prompts again and specify new parameters. You enter no and press RETURN to return to the Executive.

Figure 10-2 shows a sample report for two sets of parameters.

Figure 10-2 Sample mHistogrammer Report

,

XESOO Hlatogramrner. Vllllon LX

ProoeMOI to hlatogram ( .. g. TpOO. Fp1. Cp. eto.): cpOO Buckel lile fl*lIOrlPha) dIeD: 100 Clodl tIcka to hIatogram: 1000

XE520 processors communicate through a facility called Inter-CPU Communication (ICC). You can use the MPSTAT command to generate ICC statistics for all FPs, DPs, SPs, CPs, and TPs in the system.

Dans le document About This Guide (Page 124-128)