Example 6-2, Starting and stopping a measurement – HP NonStop G-Series User Manual
Page 123
![background image](/manuals/397027/123/background.png)
Creating a Custom Measurement Application
Measure User’s Guide — 520560-003
6- 11
Step 4: Call MEASCLOSE (Optional)
Example 6-2. Starting and Stopping a Measurement (page 1 of 2)
STRUCT .CONTAB; ! structure for configuration table
BEGIN
STRUCT HEADER(CONTAB^HDR);
STRUCT CPU(CPU^DESC)[0:1];
STRUCT TRAILER(CONTAB^TRAILER);
END;
STRUCT .MEASCB(MEASCB^DEF);
INT DFNAME[0:11] := ["$SYSTEM MEASURE CPUDATA "],
DFNUM, ! returned by MEASOPEN
SWAPVOL[0:3] := ["$SWAP "],
MEASNUM, ! returned by MEASCONFIGURE
ERROR;
.
.
.
! Initialize the configuration table header record.
CONTAB.HEADER.TYPE := CONTAB^T;
CONTAB.HEADER.LEN := $LEN(CONTAB);
CONTAB.HEADER.SECTIONS ':=' 0 &
CONTAB.HEADER.SECTIONS FOR MAX^T;
CONTAB.HEADER.SECTIONS[CPU^T] := $OFFSET(CONTAB.CPU);
! Initialize the first CPU descriptor to measure all CPUs.
CONTAB.CPU.TYPE := CPU^T;
CONTAB.CPU.LEN := $LEN(CPU^DESC);
CONTAB.CPU.CPU^NUMBER := ALL;
! Initialize the second CPU descriptor to remove CPU 0
! from the measurement configuration. The first two
! assignment statements use these DEFINEs declared in the
! file MEASDECS:
DEFINE DESCTYPE = TYPE.<1:15>#;
DEFINE EXCLUDE = TYPE.<0>#;
CONTAB.CPU[1].EXCLUDE := 1; ! set exclude flag bit
CONTAB.CPU[1].DESCTYPE := CPU^T;
CONTAB.CPU[1].LEN := $LEN(CPU^DESC);
CONTAB.CPU[1].CPU^NUMBER := 0;