FPFM020.B8 PFM020.BBACKUP PERF_METER_CONST.DAT,PERF_METER.C,PERF_METER.UIL,MAKEFILE.,PERF_METER_CONST.H,PERF_METER_CONST.UIL,CPUDEF.H PFM020.B/SAVE/INTER/GROUP=0/BLO=2048 HELLER h0JV5.1 _JULIUS::  _DENEVA$DUA0: V5.0 4*[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER_CONST.DAT;4+,./h 4!-0123KPWO56k7@ /* For printf and so on. */#include #include #include #include #include #include #include "cpudef.h"&globalref long int EXE$GL_ABSTIM_TICS;&globalref long int SMP$GL_ACTIVE_CPUS;#globalref $CPU *SMP$GL_CPU_DATA[1];!globalref long int PMS$GL_FAULTS;!globalref long int PMS$GL_PREADS;"globalref long int PMS$GL_PREADIO;"globalref long int PMS$GL_PWRITES;"globalref long int PMS$GL_PWRITIO;#globalref long int PMS$GL_DZROFLTS;"globalref long int SCH<PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9;l$GL_FREECNT;!globalref long int SCH$GL_MFYCNT;&#define current_faults (PMS$GL_FAULTS)8#define current_pageio (PMS$GL_PREADIO + PMS$GL_PWRITIO)*#define current_freepages (SCH$GL_FREECNT)(#define current_modpages (SCH$GL_MFYCNT) #ifdef VMS@#include /* DECwindows Toolkit */#else@#include /* DECwindows Toolkit */#endif*#define FAILED(status) (((status)&1) == 0)"#define SIGNAL_ERROR(status) \ { \ int ___status = status; \ \ if (FAILED(___status)) \ lib$signal(___status); \ }#include "perf_meter_const.h"$#define MAX_WIDGETS (MAX_WIDGET + 1)/* * Global data */Cstatic Widget toplevel_widget, /* Root widget ID of our */: /* application. */D main_window_widget, /* Root widget ID of main */7 /* DRM fetch */4 generic_message_widget, /* generic message box */4 generic_caution_widget, /* generic caution box */- generic_wip_widget; /* generic WIP box */Knoshare widget_array[MAX_WIDGETS]; /* Place to keep all other */8 /* widget IDs */2static Display *cpu_graph_disp, *state_graph_disp;:static Window cpu_graph_wind = 0, state_graph_wind = 0;2static GC cpu_graph_gc1, state_graph_gc1;2static GC cpu_graph_gc0, state_graph_gc0;;static DwtCompString latin_create; /* VPFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9`ariables for */?static DwtCompString latin_dismiss; /* compound strings. */!static DwtCompString latin_space; static DwtCompString latin_zero;Gstatic DRMHierarchy s_DRMHierarchy; /* DRM database hierarchy ID */Astatic DRMType *dummy_class; /* and class variable. */Estatic char *db_filename_vec[] = /* DRM heirachy file list. */R {"pfm$data:perf_meter.uid" /* There is only one UID file for */? }; /* this application. */static int db_filename_num =F (sizeof db_filename_vec / sizeof db_filename_vec [0]);<#define PFM_CUSTOMIZE_FILE "DECW$USER_DEFAULTS:DECW$PFM.DAT"B#define SYS_PFM_CUSTOMIZE_FILE "DECW$SYSTEM_DEFAULTS:DECW$PFM.DAT"*static int main_xpos = 0, main_ypos = 50;static int update_period = 5;.static long int N10PerSec = -1*(10*1000*1000);static int TIMER_EFN;(static int settings_modified_p = FALSE;static readonly struct { char *parameter_name; int parameter_type;#define PARAM_STRING 0#define PARAM_INTEGER 1 char *parameter_value; int parameter_size; } parameter_specs[] = {B {"PerfMeter.XPos", PARAM_INTEGER, &main_xpos, sizeof(main_xpos)},B {"PerfMeter.YPos", PARAM_INTEGER, &main_ypos, sizeof(main_ypos)},: {"PerfMeter.UpdatePeriod", PARAM_INTEGER, &update_period, sizeof(update_period)}, {NULL, 0, NULL, 0} };/* * Forward declarations */void s_error();void get_something();static void set_something();static void activate_proc(u05PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9p );static void create_proc();static void cancel_proc();static void update();static GC MakeGC();H/* The names and addresses of things that DRM has to bind. The names do, * not have to be in alphabetical order. */#static DRMRegisterArg reglist[] = {, {"ACTIVATE_PROC", (caddr_t) activate_proc},( {"CREATE_PROC", (caddr_t) create_proc},' {"CANCEL_PROC", (caddr_t) cancel_proc}};?static int reglist_num = (sizeof reglist / sizeof reglist [0]);static char nodename[16];"static $DESCRIPTOR(NODE,nodename);/*G * OS transfer point. The main routine does all the one-time setup and * then calls XtMainLoop. */unsigned int main(argc, argv)Funsigned int argc; /* Command line argument count. */Hchar *argv[]; /* Pointers to command line args. */ { static long int utime[2]; register int status, i; long int timeup_p; XEvent event; static char header[128];# static unsigned short int nlen; static struct { unsigned short blen, icode; char *baddr; unsigned short int *rlen; } syi_itmlst[] = {5 {sizeof(nodename)-2, SYI$_SCSNODE, nodename, &nlen}, {0, 0, NULL, NULL} };( sys$getsyiw(0,0,0,syi_itmlst,0,0,0);I for (i = nlen; i >= 0 && nodename[i] == ' '; i--) nodename[i] = '\0';F sprintf(header,"System Performance Meters (V2.0) on %s",nodename);) NODE.dsc$w_length = strlen(nodename);" read_sys_customization_file(); read_customization_file();M DwtIni֔)PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9 tializeDRM(); /* Initialize DRM before initializing< /* the X Toolkit. */O /* If we had user-defined widgets, we would register them with DRM here. */I /* Initialize the X Toolkit. We get back a top level shell widget. */N toplevel_widget = XtInitialize(header, /* Main window banner text. */* "PerfMeter", /* Root class name. */) NULL, /* No option list. */, 0, /* Number of options. */) &argc, /* Address of argc */ argv); /* argv */M /* Open the UID files (the output of the UIL compiler) in the hierarchy*/@ if (DwtOpenHierarchy(db_filename_num, /* Number of files. */7 db_filename_vec, /* Array of file names. */1 NULL, /* Default OS extenstion. */5 &s_DRMHierarchy) /* Pointer to returned DRM ID */ !=DRMSuccess)( s_error("can't open hierarchy"); init_application();6 /* Register the items DRM needs to bind for us. */. DwtRegisterDRMNames(reglist, reglist_num);2 /* Go get the main part of the application. */J if (DwtFetchWidget(s_DRMHierarchy, "PERF_METER_MAIN", toplevel_widget,7 &main_window_widget, &dummy_class) != DRMSuccess)+ s_error("can't fetch main window");K /* Manage the main part and realize everything. The interface comes up * on the display now. */& XtManageChild(main_window_widget);3 set_something(toplevel_widget,DwtN {PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9Ix,main_xpos);3 set_something(toplevel_widget,DwtNy,main_ypos);% XtRealizeWidget(toplevel_widget);0 XtAddTimeOut(update_period*1000, update, 0); XtMainLoop(); }/*: * One-time initialization of application data structures. */static int init_application() { int k;5 /* Initialize the application data structures. */% for (k = 0; k < MAX_WIDGETS; k++) widget_array[k] = NULL; init_cpu_times(); }read_customization_file() { register char *p, *q; char *fgets(); FILE *custfile; static char temp[1024];- custfile = fopen(PFM_CUSTOMIZE_FILE,"r"); if (custfile != NULL) {2 while ((p = fgets(temp,1024,custfile)) != NULL) {1 q = strchr(p,'!'); if (q != NULL) *q = '\0';2 q = strchr(p,'\n'); if (q != NULL) *q = '\0'; process_cust_line(p); } fclose(custfile); } }read_sys_customization_file() { register char *p, *q; char *fgets(); FILE *custfile;- static char temp[1024];-# main_xpos = 0; main_ypos = 95; update_period = 5;1 custfile = fopen(SYS_PFM_CUSTOMIZE_FILE,"r");l if (custfile != NULL) {32 while ((p = fgets(temp,1024,custfile)) != NULL) {1 q = strchr(p,'!'); if (q != NULL) *q = '\0';a2 q = strchr(p,'\n'); if (q != NULL) *q = '\0'; process_cust_line(p); } fclose(custfile); } }-static process_cust_line(p)tregister char *p;  {  register int i;  register char ,TPFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9x *eq; char *compare_param();* while (*p != '\0' && isspace(*p)) p++; if (*p == '\0') return;uA for (i = 0; parameter_specs[i].parameter_name != NULL; i++) {B9 eq = compare_param(p,parameter_specs[i].parameter_name);e if (eq != NULL) {1 switch (parameter_specs[i].parameter_type) {b case PARAM_STRING:[ strncpy(parameter_specs[i].parameter_value,eq+1,parameter_specs[i].parameter_size-1);oU parameter_specs[i].parameter_value[parameter_specs[i].parameter_size-1] = '\0';H break; case PARAM_INTEGER:GA *((int *) parameter_specs[i].parameter_value) = atoi(eq+1);n break; }O break;I } } }n&static char *compare_param(test,pname)register char *test, *pname; {d register char *p, *q;u0 for (p = test, q = pname; *q != '\0'; q++) { if (*p == *q) p++;# else if (*p == '\0') return(NULL);/" else if (*p == '=') return(NULL); else if (*p == '*') { while (*(p+1) == '*') p++;  if (*(q+1) == '\0') p++; $ else if (*(q+1) == *(p+1)) p++; } else if (*p == '%') p++;_ else return(NULL); }* while (*p != '\0' && isspace(*p)) p++; if (*p == '=') return(p); else return(NULL); }tL/*************************************************************************** *A * These are some little utilities used by the callback routines.  */ /* * All errors are fatal. */ #static void s_error(problem_string)*char *problem_string;i {g# printf("%s\n", problem_s 5PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9tring); exit(0); }g/*M * Simplified SET VALUE routine to use only when changing a single attribute.rC * If we need to change more than one, all new values should be putJ * into one arglist and we should make one XtSetValues call (which is MUCH * more efficient).a */a-static void set_something(w, resource, value)a Widget w;nchar *resource, *value;p {_ Arg al[1];% XtSetArg(al[0], resource, value);  XtSetValues(w, al, 1); }o/*O * Simplified GET VALUE routine to use only when retrieving a single attribute. A * If we need to retrieve more than one, all values should be putcJ * into one arglist and we should make one XtGetValues call (which is MUCH * more efficient).* */t-static void get_something(w, resource, value)s Widget w;*char *resource, *value;a {] Arg al[1];% XtSetArg(al[0], resource, value);r XtGetValues(w, al, 1); }e&int get_widget_if_needed (index, name) int index; char *name;  {i& if (widget_array[index] == NULL) {8 if (DwtFetchWidget(s_DRMHierarchy,name,toplevel_widget,7 &widget_array[index],&dummy_class) != DRMSuccess)W return(FALSE);F } return(TRUE);_ }Z/*L * All widgets that are created call back to this procedure. We just log the * ID in the global array. */5'static void create_proc(w, tag, reason)* Widget w;t int *tag;Runsigned long *reason; {d int widget_num = *tag;! widget_array[widget_num] = w;m switch (widget_num) {d l PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9Ay case PFM_CPU_GRAPH:# cpu_graph_disp = XtDisplay(w);m break; case PFM_STATE_GRAPH:% state_graph_disp = XtDisplay(w);o break;E case PFM_DEVICE_0_IOCOUNT_NAME:" update_disk_name_label(w, 0); break;, case PFM_DEVICE_1_IOCOUNT_NAME:" update_disk_name_label(w, 1); break; case PFM_DEVICE_2_IOCOUNT_NAME:" update_disk_name_label(w, 2); break; case PFM_DEVICE_3_IOCOUNT_NAME:" update_disk_name_label(w, 3); break; default: break; } }o/*F * All push buttons in this application call back to this routine. WeD * use the tag to tell us what widget it is, then react accordingly. */ )static void activate_proc(w, tag, reason) Widget w;c int *tag;runsigned long *reason; {_K int widget_num = *tag; /* Convert tag to widget number. */{ switch (widget_num) {e case PFM_EXIT_BUTTON: exit(); default: break; } }z'static void cancel_proc(w, tag, reason)1 Widget w;c int *tag;Runsigned long *reason; {rK int widget_num = *tag; /* Convert tag to widget number. */l switch (widget_num) {n default: break; } }istatic int CPUPercent[101] = {, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0};estatic int Device_0_IO = -1, Device_1_IO = -1,t  &PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9 Device_2_IO = -1,e Device_3_IO = -1;cstatic int PageFaults = -1,n PageIO = -1, FreePages = -1,f ModPages = -1;#define CompTimeX 2#define NullTimeX 12#define UserTimeX 22#define SupeTimeX 32#define ExecTimeX 42#define KernTimeX 52#define InteTimeX 62#define StateBarWidth 7tstatic void update() {t static int NewNullTime, NewUserTime, NewSupeTime, NewExecTime, NewKernTime, NewInteTime, NewCompTime,@ NewDevice_0_IO, DeltaDevice_0_IO, LastDeltaDevice_0_IO = -1,@ NewDevice_1_IO, DeltaDevice_1_IO, LastDeltaDevice_1_IO = -1,@ NewDevice_2_IO, DeltaDevice_2_IO, LastDeltaDevice_2_IO = -1,@ NewDevice_3_IO, DeltaDevice_3_IO, LastDeltaDevice_3_IO = -1,3 LastDeltaPageFaults = -1, LastDeltaPageIO = -1, 4 LastDeltaFreePages = -1, LastDeltaModPages = -1;1 register int NewPageFaults, DeltaPageFaults,  NewPageIO, DeltaPageIO, ! NewFreePages, DeltaFreePages, + NewModPages, DeltaModPages, NewDispFlag; & register int total_time, NullTime, UserTime, SupeTime, ExecTime,h KernTime,e InteTime,U CompTime,  DeltaIO,ix;! static char label_buffer[32];a n if (cpu_graph_wind == 0) {8 cpu_graph_wind = XtWindow(widget_array[PFM_CPU_GRAPH]);C cpu_graph_gc1 = MakeGC(cpu_graph_disp, cpu_graph_wind, GXinvert);/B cpu_graph_gc0 = MakeGC(cpu_graph_disp, cpu_graph_wind, GXclear); } if (state_graph_wind == 0) {< state_graph_wind = XtWindow(widget_array[PFM_ i~PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9 STATE_GRAPH]);I state_graph_gc1 = MakeGC(state_graph_disp, state_graph_wind, GXinvert); H state_graph_gc0 = MakeGC(state_graph_disp, state_graph_wind, GXclear); } get_cpu_times(&NewNullTime,v &NewUserTime,m &NewSupeTime,& &NewExecTime,S &NewKernTime,_ &NewInteTime,m &NewCompTime);# NewPageFaults = current_faults;  NewPageIO = current_pageio;u% NewFreePages = current_freepages; # NewModPages = current_modpages;H total_time = NewNullTime + NewUserTime + NewSupeTime + NewExecTime ++ NewKernTime + NewInteTime + NewCompTime;W if (total_time > 0) {- NullTime = (NewNullTime * 100) / total_time;;- UserTime = (NewUserTime * 100) / total_time;m- SupeTime = (NewSupeTime * 100) / total_time;.- ExecTime = (NewExecTime * 100) / total_time;- KernTime = (NewKernTime * 100) / total_time;o- InteTime = (NewInteTime * 100) / total_time;_- CompTime = (NewCompTime * 100) / total_time; } else { NullTime = NewNullTime; UserTime = NewUserTime; SupeTime = NewSupeTime; ExecTime = NewExecTime; KernTime = NewKernTime; InteTime = NewInteTime; CompTime = NewCompTime; }F XClearArea(state_graph_disp,state_graph_wind,NullTimeX,0,7,100,0);O XFillRectangle(state_graph_disp,state_graph_wind,state_graph_gc1,NullTimeX,  100-NullTime,q 7,NullTime);F XClearArea(state_graph_disp,state_graph_wind,UserTimeX,0,7,100,0);O XFillRectangle(state_graph_disp,state_graph_wind,state_graph_gc1,UserTimeX,  צ:PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9u! 100-UserTime,t 7,UserTime);F XClearArea(state_graph_disp,state_graph_wind,SupeTimeX,0,7,100,0);O XFillRectangle(state_graph_disp,state_graph_wind,state_graph_gc1,SupeTimeX,p 100-SupeTime,) 7,SupeTime);F XClearArea(state_graph_disp,state_graph_wind,ExecTimeX,0,7,100,0);O XFillRectangle(state_graph_disp,state_graph_wind,state_graph_gc1,ExecTimeX,  100-ExecTime,_ 7,ExecTime);F XClearArea(state_graph_disp,state_graph_wind,KernTimeX,0,7,100,0);O XFillRectangle(state_graph_disp,state_graph_wind,state_graph_gc1,KernTimeX,e 100-KernTime,a 7,KernTime);F XClearArea(state_graph_disp,state_graph_wind,InteTimeX,0,7,100,0);O XFillRectangle(state_graph_disp,state_graph_wind,state_graph_gc1,InteTimeX, 100-InteTime,  7,InteTime);F XClearArea(state_graph_disp,state_graph_wind,CompTimeX,0,7,100,0);O XFillRectangle(state_graph_disp,state_graph_wind,state_graph_gc1,CompTimeX,  100-CompTime,G 7,CompTime);% CPUPercent[100] = 100 - NullTime;+" for (ix = 0; ix < 100; ix++) {# CPUPercent[ix] = CPUPercent[ix+1];c8 XClearArea(cpu_graph_disp,cpu_graph_wind,ix,0,1,100,0);R XFillRectangle(cpu_graph_disp,cpu_graph_wind,cpu_graph_gc1,ix,100-CPUPercent[ix], 1,CPUPercent[ix]); }= if ((widget_array[PFM_DEVICE_0_IOCOUNT_TOTAL] != NULL) &&r4 (widget_array[PFM_DEVICE_0_IOCOUNT_DELTA] != NULL)) {$ get_disk_opcnt(0, &NewDevice_0_IOMݨwPFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[93$);E if ((NewDispFlag = (Device_0_IO < 0))) Device_0_IO = NewDevice_0_IO;p1 DeltaDevice_0_IO = NewDevice_0_IO - Device_0_IO;0% if (DeltaDevice_0_IO || NewDispFlag)= {t Device_0_IO = NewDevice_0_IO;+ sprintf(label_buffer," %8d",Device_0_IO);*C set_something(widget_array[PFM_DEVICE_0_IOCOUNT_TOTAL],DwtNlabel,e" DwtLatin1String(label_buffer)); } . if (DeltaDevice_0_IO != LastDeltaDevice_0_IO) {t if (DeltaDevice_0_IO == 0) strcpy(label_buffer," "); else1 sprintf(label_buffer," %4d",DeltaDevice_0_IO);gC set_something(widget_array[PFM_DEVICE_0_IOCOUNT_DELTA],DwtNlabel,i" DwtLatin1String(label_buffer));* LastDeltaDevice_0_IO = DeltaDevice_0_IO; } }= if ((widget_array[PFM_DEVICE_1_IOCOUNT_TOTAL] != NULL) &&i4 (widget_array[PFM_DEVICE_1_IOCOUNT_DELTA] != NULL)) {$ get_disk_opcnt(1, &NewDevice_1_IO);E if ((NewDispFlag = (Device_1_IO < 0))) Device_1_IO = NewDevice_1_IO;]1 DeltaDevice_1_IO = NewDevice_1_IO - Device_1_IO; ; if ((DeltaDevice_1_IO || NewDispFlag) && Device_1_IO >= 0)n {" Device_1_IO = NewDevice_1_IO;. sprintf(label_buffer," %8d",Device_1_IO);F set_something(widget_array[PFM_DEVICE_1_IOCOUNT_TOTAL],DwtNlabel," DwtLatin1String(label_buffer)); }. if (DeltaDevice_1_IO != LastDeltaDevice_1_IO) { if (DeltaDevice_1_IO == 0) strcpy(label_buffer," "); elseo1 sprintf(label_buffer," %4d",DeltaDevice_1_IO);F set_something(widget_array[PFM_DEVICE_1_IOCOUNT_DELTA],DwtNlabel," DwtLatin1Stri'pwPFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9'ng(label_buffer));- LastDeltaDevice_1_IO = DeltaDevice_1_IO;m } }= if ((widget_array[PFM_DEVICE_2_IOCOUNT_TOTAL] != NULL) &&4 (widget_array[PFM_DEVICE_2_IOCOUNT_DELTA] != NULL)) {$ get_disk_opcnt(2, &NewDevice_2_IO);E if ((NewDispFlag = (Device_2_IO < 0))) Device_2_IO = NewDevice_2_IO;*1 DeltaDevice_2_IO = NewDevice_2_IO - Device_2_IO;g; if ((DeltaDevice_2_IO || NewDispFlag) && Device_2_IO >= 0)i {" Device_2_IO = NewDevice_2_IO;. sprintf(label_buffer," %8d",Device_2_IO);F set_something(widget_array[PFM_DEVICE_2_IOCOUNT_TOTAL],DwtNlabel," DwtLatin1String(label_buffer)); }. if (DeltaDevice_2_IO != LastDeltaDevice_2_IO) { if (DeltaDevice_2_IO == 0)e strcpy(label_buffer," "); elseC1 sprintf(label_buffer," %4d",DeltaDevice_2_IO); F set_something(widget_array[PFM_DEVICE_2_IOCOUNT_DELTA],DwtNlabel," DwtLatin1String(label_buffer));- LastDeltaDevice_2_IO = DeltaDevice_2_IO;( } }= if ((widget_array[PFM_DEVICE_3_IOCOUNT_TOTAL] != NULL) &&*4 (widget_array[PFM_DEVICE_3_IOCOUNT_DELTA] != NULL)) {$ get_disk_opcnt(3, &NewDevice_3_IO);E if ((NewDispFlag = (Device_3_IO < 0))) Device_3_IO = NewDevice_3_IO;i1 DeltaDevice_3_IO = NewDevice_3_IO - Device_3_IO;; if ((DeltaDevice_3_IO || NewDispFlag) && Device_3_IO >= 0)  {" Device_3_IO = NewDevice_3_IO;. sprintf(label_buffer," %8d",Device_3_IO);F set_something(widget_array[PFM_DEVICE_3_IOCOUNT_TOTAL],DwtNlabel," DwtLatin1String(label_buffer)+*RPFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9R*); }. if (DeltaDevice_3_IO != LastDeltaDevice_3_IO) { if (DeltaDevice_3_IO == 0) strcpy(label_buffer," "); else 1 sprintf(label_buffer," %4d",DeltaDevice_3_IO);eF set_something(widget_array[PFM_DEVICE_3_IOCOUNT_DELTA],DwtNlabel," DwtLatin1String(label_buffer));- LastDeltaDevice_3_IO = DeltaDevice_3_IO;  } }E if ((NewDispFlag = (PageFaults < 0))) PageFaults = NewPageFaults;,1 DeltaPageFaults = NewPageFaults - PageFaults;e' if (DeltaPageFaults || NewDispFlag) { PageFaults = NewPageFaults;) sprintf(label_buffer," %8d",PageFaults); < set_something(widget_array[PFM_PAGEFAULTS_TOTAL],DwtNlabel,% DwtLatin1String(label_buffer));e }/ if (DeltaPageFaults != LastDeltaPageFaults)f { if (DeltaPageFaults == 0)# strcpy(label_buffer," "); elsev3 sprintf(label_buffer," %4d",DeltaPageFaults); < set_something(widget_array[PFM_PAGEFAULTS_DELTA],DwtNlabel,% DwtLatin1String(label_buffer));m' LastDeltaPageFaults = DeltaPageFaults;  }9 if ((NewDispFlag = (PageIO < 0))) PageIO = NewPageIO; % DeltaPageIO = NewPageIO - PageIO;c# if (DeltaPageIO || NewDispFlag)v { PageIO = NewPageIO;% sprintf(label_buffer," %8d",PageIO);v8 set_something(widget_array[PFM_PAGEIO_TOTAL],DwtNlabel,% DwtLatin1String(label_buffer));, }' if (DeltaPageIO != LastDeltaPageIO)w { if (DeltaPageIO == 0)# strcpy(label_buffer," ");N elsea/ sprintf(label_buffer," %4d",DeltaPageIO);a8 set_somethi}#PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9F-ng(widget_array[PFM_PAGEIO_DELTA],DwtNlabel,% DwtLatin1String(label_buffer));x LastDeltaPageIO = DeltaPageIO;e }B if ((NewDispFlag = (FreePages < 0))) FreePages = NewFreePages;. DeltaFreePages = NewFreePages - FreePages;& if (DeltaFreePages || NewDispFlag) { FreePages = NewFreePages;( sprintf(label_buffer," %8d",FreePages);; set_something(widget_array[PFM_FREEPAGES_TOTAL],DwtNlabel,,% DwtLatin1String(label_buffer));d }- if (DeltaFreePages != LastDeltaFreePages)[ { if (DeltaFreePages == 0)h# strcpy(label_buffer," ");e elsew2 sprintf(label_buffer," %4d",DeltaFreePages);; set_something(widget_array[PFM_FREEPAGES_DELTA],DwtNlabel,e% DwtLatin1String(label_buffer)); % LastDeltaFreePages = DeltaFreePages;  }? if ((NewDispFlag = (ModPages < 0))) ModPages = NewModPages;u+ DeltaModPages = NewModPages - ModPages;n% if (DeltaModPages || NewDispFlag)f { ModPages = NewModPages;' sprintf(label_buffer," %8d",ModPages);w: set_something(widget_array[PFM_MODPAGES_TOTAL],DwtNlabel,% DwtLatin1String(label_buffer)); }+ if (DeltaModPages != LastDeltaModPages)i { if (DeltaModPages == 0)# strcpy(label_buffer," ");i elseS1 sprintf(label_buffer," %4d",DeltaModPages);T: set_something(widget_array[PFM_MODPAGES_DELTA],DwtNlabel,' DwtLatin1String(label_buffer)); # LastDeltaModPages = DeltaModPages;C }0 XtAddTimeOut(update_period*1000, update, 0); }Nstatic GC MakeGC(disp,wind,fun) DisplalW2PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9k0y *disp; Window wind;int fun;{eP static XGCValues gcvalues = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; gcvalues.function = fun;6 return(XCreateGC(disp,wind,GCFunction,&gcvalues)); }>static long int last_user, last_super, last_exec, last_kernel,4 last_interrupt, last_compat, last_spin, last_idle;#define K_TIME 0#define E_TIME 1#define S_TIME 2#define U_TIME 3#define I_TIME 4#define C_TIME 5#define SPIN_TIME 6r#define IDLE_TIME 7gstatic init_cpu_times()  {r register int i, j, k;i long int *PMS$GL_KERNEL;G last_user = last_super = last_exec = last_kernel = last_interrupt =a) last_compat = last_spin = last_idle = 0;pB for (k = SMP$GL_ACTIVE_CPUS, j = 0; k != 0; j++, k = k >> 1) { if ((k & 01) == 0) continue;_4 PMS$GL_KERNEL = (SMP$GL_CPU_DATA[j])->cpu$l_kernel;& last_kernel += PMS$GL_KERNEL[K_TIME];$ last_exec += PMS$GL_KERNEL[E_TIME];% last_super += PMS$GL_KERNEL[S_TIME]; $ last_user += PMS$GL_KERNEL[U_TIME];) last_interrupt += PMS$GL_KERNEL[I_TIME];c& last_compat += PMS$GL_KERNEL[C_TIME];' last_spin += PMS$GL_KERNEL[SPIN_TIME]; ' last_idle += PMS$GL_KERNEL[IDLE_TIME]; } last_interrupt -= last_idle; }iBstatic get_cpu_times(null,user,super,exec,kernel,interrupt,compat)8int *null,*user,*super,*exec,*kernel,*interrupt,*compat; {> register long int new_null, new_user, new_super, new_exec,, new_kernel, new_interrupt, new_compat, new_idle, new_spin;t register int i, j, k;1 OHfPFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[953long int *PMS$GL_KERNEL;- register long int new_abstime, totaltime;PB new_user = new_super = new_exec = new_kernel = new_interrupt =& new_compat = new_spin = new_idle = 0;B for (k = SMP$GL_ACTIVE_CPUS, j = 0; k != 0; j++, k = k >> 1) { if ((k & 01) == 0) continue;p4 PMS$GL_KERNEL = (SMP$GL_CPU_DATA[j])->cpu$l_kernel;% new_kernel += PMS$GL_KERNEL[K_TIME];[# new_exec += PMS$GL_KERNEL[E_TIME];&$ new_super += PMS$GL_KERNEL[S_TIME];# new_user += PMS$GL_KERNEL[U_TIME];n( new_interrupt += PMS$GL_KERNEL[I_TIME];% new_compat += PMS$GL_KERNEL[C_TIME];D& new_spin += PMS$GL_KERNEL[SPIN_TIME];& new_idle += PMS$GL_KERNEL[IDLE_TIME]; } new_interrupt -= new_idle;7 *user = new_user - last_user; last_user = new_user;,< *super = new_super - last_super; last_super = new_super;7 *exec = new_exec - last_exec; last_exec = new_exec;;A *kernel = new_kernel - last_kernel; last_kernel = new_kernel;(P *interrupt = new_interrupt - last_interrupt; last_interrupt = new_interrupt;A *compat = new_compat - last_compat; last_compat = new_compat;M7 *null = new_idle - last_idle; last_idle = new_idle;b }e$static get_disk_opcnt(devnum, count)register int devnum;register int *count; {I static struct {= unsigned short int blen, icode; int *buff;_ unsigned short int *rlen; } dvi_itmlst[] = {c' {sizeof(int), DVI$_OPCNT, NULL, NULL},O {0, 0, NULL, NULL}  };v static struct {i! unsigned short int istat, bytes;_ long int fill;D } iosb; char d)PFM020.B-[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.C;63[9 96evname[64];i $DESCRIPTOR(dev,devname);v int status;i3 sprintf(devname, "PFM$DEVICE_%d_NAME", devnum);; dvi_itmlst[0].buff = count;[ *count = -1;' dev.dsc$w_length = strlen(devname);l: status = sys$getdviw(0,0,&dev,dvi_itmlst,&iosb,0,0,0);2 if ((status == SS$_IVDEVNAM) && (devnum == 0)) {' $DESCRIPTOR(sysdev, "SYS$SYSDEVICE:");o1 sys$getdviw(0,0,&sysdev,dvi_itmlst,&iosb,0,0,0); } }m(static update_disk_name_label(w, devnum) Widget w;, int devnum;1 {l char devname[64];s char *title;4 sprintf(devname, "PFM$DEVICE_%d_TITLE", devnum); title = getenv(devname); if (NULL == title) {0 sprintf(devname, "PFM$DEVICE_%d_NAME", devnum); title = getenv(devname);O& if ((NULL == title) && (0 == devnum)) title = "SYS$SYSDEVICE:"; }I if (title != NULL) set_something(w,DwtNlabel,DwtLatin1String(title));| }slag) && Device_2_IO >= 0)i {" Device_2_IO = NewDevice_2_IO;. sprintf(label_buffer," %8d",Device_/*[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40+, ./h 4Ql-0123KPWO56Wk7]k89GhHJPFM020.B /[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40Qܲ/* -*-c-mode-*- */8/*------------------------------------------------------. * PERF_METER.UIL - Perf Meter User Interface5 * Robert Heller Created on Wed Nov 8 10:21:39 1989 * Last mod -: *------------------------------------------------------*/module perf_meter version = 'v2.0' names = case_insensitiveinclude file 'DwtAppl.uil'; procedure activate_proc (integer); create_proc (integer); cancel_proc (integer); valueH adb_top_attachment : argument('adbTopAttachment', integer);K adb_bottom_attachment : argument('adbBottomAttachment', integer);I adb_left_attachment : argument('adbLeftAttachment', integer);J adb_right_attachment : argument('adbRightAttachment', integer);@ adb_top_widget : argument('adbTopWidget', any);C adb_bottom_widget : argument('adbBottomWidget', any);A adb_left_widget : argument('adbLeftWidget', any);B adb_right_widget : argument('adbRightWidget', any);D adb_top_offset : argument('adbTopOffset', integer);G adb_bottom_offset : argument('adbBottomOffset', integer);E adb_left_offset : argument('adbLeftOffset', integer);F adb_right_offset : argument('adbRightOffset', integer);"! Colors, color tables, and icons.valueA yellow : color('yellow', foreground);> red : color('red', background);@ green &PFM020.B /[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40QxX : color('green', foreground);B magenta : color('magenta', background);? gold : color('gold', foreground);D lightblue : color('lightblue', background);! Fonts.valueP large_font : font('-Adobe-Courier-Bold-R-Normal--14-140-75-75-M-90-ISO8859-1');Q medium_font : font('-Adobe-Courier-Bold-R-Normal--12-120-75-75-M-70-ISO8859-1');Q small_font : font('-Adobe-Courier-Bold-R-Normal--10-100-75-75-M-60-ISO8859-1');$include file 'perf_meter_const.uil';object PERF_METER_MAIN : main_window { arguments { /* x = 10; y = 20; */" /* units = DwtPixelUnits; */ width = 400; height = 140; }; controls { menu_bar main_menu_bar;& attached_dialog_box main_dialog; }; };*OBJECT main_dialog : attached_dialog_box { arguments { width = 400; height = 120; units = DwtPixelUnits; x = 0; y = 20; }; controls { window cpu_graph; window state_graph;! label device_0_iocount_name;" label device_0_iocount_total;" label device_0_iocount_delta;! label device_1_iocount_name;" label device_1_iocount_total;" label device_1_iocount_delta;! label device_2_iocount_name;" label device_2_iocount_total;" label device_2_iocount_delta;! label device_3_iocount_name;" label device_3_iocount_total;" label device_3_iocount_delta;Z%"PFM020.B /[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40Q label pagefaults; label pagefaults_total; label pagefaults_delta; label pageio; label pageio_total; label pageio_delta; label freepages; label freepages_total; label freepages_delta; label modpages; label modpages_total; label modpages_delta; label graph_labels; label c_mode; label n_mode; label u_mode; label s_mode; label e_mode; label k_mode; label i_mode; }; };!object main_menu_bar : menu_bar { arguments {, orientation = DwtOrientationHorizontal; spacing = 15; }; controls {$ pulldown_entry file_menu_entry;/*$ pulldown_entry edit_menu_entry;) pulldown_entry customize_menu_entry;$ pulldown_entry help_menu_entry;*/ }; callbacks {3 create = PROCEDURE create_proc (PFM_MENU_BAR); }; };)OBJECT file_menu_entry : PULLDOWN_ENTRY {- ARGUMENTS {LABEL_LABEL = 'File'; };/ CONTROLS {PULLDOWN_MENU file_menu; };};"OBJECT file_menu : PULLDOWN_MENU {# CONTROLS {PUSH_BUTTON exit_button; };};I/* ----------------------------------------------------------------------* File menu pushbuttons.L* ---------------------------------------------------------------------- */"OBJECT exit_button : PUSH_BUTTON {- ARGUMENTS {LABEL_LABEL = 'Exit'; };G CALLBACKS {ACTIVATE = PROCEDURE activate_proc (pfm_exit_button); };};object cpu_graph : window { arguments {%v PFM020.B /[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40QA  x = 0; y = 0; height = 100; width = 100; /* units = DwtPixelUnits; */ }; callbacks {0 create = procedure create_proc (pfm_cpu_graph); }; };object state_graph : window { arguments { x = 100; y = 0; height = 100; width = 70; /* units = DwtPixelUnits; */ }; callbacks {2 create = procedure create_proc (pfm_state_graph); }; };&object device_0_iocount_name : label { arguments {: label_label = 'Sys Disk '; /* xxxxxxxx xxxx'; */ x = 175; y = 60; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {< create = procedure create_proc (pfm_device_0_iocount_name); }; };'object device_0_iocount_total : label { arguments {) label_label = ' '; /* xxxx'; */ x = 268; y = 60; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {= create = procedure create_proc (pfm_device_0_iocount_total); }; };'object device_0_iocount_delta : label { arguments { label_label = ' '; x = 331; y = 60; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {= create = procedure create_proc (pfm_device_0_iocount_delta); }; };&object device_1_iocount_name : label { arguments {: label_label = ' '; /* xxxxxxxx xxxx'; */ x = 175; y = 75; /* height = 20; width = 200; */]^PFM020.B /[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40QI /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {< create = procedure create_proc (pfm_device_1_iocount_name); };4 }; 'object device_1_iocount_total : label { arguments {) label_label = ' '; /* xxxx'; */ x = 268; y = 75; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {= create = procedure create_proc (pfm_device_1_iocount_total); }; };'object device_1_iocount_delta : label { arguments { label_label = ' '; x = 331; y = 75; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {= create = procedure create_proc (pfm_device_1_iocount_delta); }; };&object device_2_iocount_name : label { arguments {: label_label = ' '; /* xxxxxxxx xxxx'; */ x = 175; y = 90; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {< create = procedure create_proc (pfm_device_2_iocount_name); }; };'object device_2_iocount_total : label { arguments {) label_label = ' '; /* xxxx'; */ x = 268; y = 90; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {= create = procedure create_proc (pfm_device_2_iocount_total); }; };'object device_2_io38PFM020.B /[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40Q2count_delta : label { arguments { label_label = ' '; x = 331; y = 90; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {= create = procedure create_proc (pfm_device_2_iocount_delta); }; };&object device_3_iocount_name : label { arguments {: label_label = ' '; /* xxxxxxxx xxxx'; */ x = 175; y =105; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {< create = procedure create_proc (pfm_device_3_iocount_name); }; };'object device_3_iocount_total : label { arguments {) label_label = ' '; /* xxxx'; */ x = 268; y =105; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {= create = procedure create_proc (pfm_device_3_iocount_total); }; };'object device_3_iocount_delta : label { arguments { label_label = ' '; x = 331; y =105; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {= create = procedure create_proc (pfm_device_3_iocount_delta); }; };object pagefaults : label { arguments {5 label_label = 'Page Faults'; /* xxxxxxxx xxxx'; */ x = 175; y = 30; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; };!object pagefaults_total : Uz5PFM020.B /[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40Qplabel { arguments {) label_label = ' xxxxxxxx'; /* xxxx'; */ x = 268; y = 30; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {7 create = procedure create_proc (pfm_pagefaults_total); }; };!object pagefaults_delta : label { arguments { label_label = ' xxxx'; x = 331; y = 30; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {7 create = procedure create_proc (pfm_pagefaults_delta); }; };object pageio : label { arguments {3 label_label = 'Paging IO'; /* xxxxxxxx xxxx'; */ x = 175; y = 45; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; };object pageio_total : label { arguments {) label_label = ' xxxxxxxx'; /* xxxx'; */ x = 268; y = 45; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {3 create = procedure create_proc (pfm_pageio_total); }; };object pageio_delta : label { arguments { label_label = ' xxxx'; x = 331; y = 45; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {3 create = procedure create_proc (pfm_pageio_delta); }; };object freepages : label { arguments {4 label_label = 'Free Pages'; /* xxxxxxxx xxxx'; */ x = 175; y = 0; /* heigM=PFM020.B /[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40Qht = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; }; object freepages_total : label { arguments {) label_label = ' xxxxxxxx'; /* xxxx'; */ x = 268; y = 0; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {6 create = procedure create_proc (pfm_freepages_total); }; }; object freepages_delta : label { arguments { label_label = ' xxxx'; x = 331; y = 0; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {6 create = procedure create_proc (pfm_freepages_delta); }; };object modpages : label { arguments {8 label_label = 'Modified Pages'; /* xxxxxxxx xxxx'; */ x = 175; y = 15; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; };object modpages_total : label { arguments {) label_label = ' xxxxxxxx'; /* xxxx'; */ x = 268; y = 15; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {5 create = procedure create_proc (pfm_modpages_total); }; };object modpages_delta : label { arguments { label_label = ' xxxx'; x = 331; y = 15; /* height = 20; width = 200; */ /* units = DwtPixelUnits; */ font_argument = medium_font; }; callbacks {5 create = procedure create_proc (pfm_modpages_delta); }; >LlPFM020.B /[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER.UIL;40Q;> };object graph_labels : label { arguments { label_label = 'CPU Busy'; /* units = DwtPixelUnits; */ x = 3; y = 100; font_argument = medium_font; }; };object c_mode : label { arguments { label_label = 'C'; /* units = DwtPixelUnits; */ x = 101; y = 100; font_argument = medium_font; }; };object n_mode : label { arguments { label_label = 'N'; /* units = DwtPixelUnits; */ x = 111; y = 100; font_argument = medium_font; }; };object u_mode : label { arguments { label_label = 'U'; /* units = DwtPixelUnits; */ x = 121; y = 100; font_argument = medium_font; }; };object s_mode : label { arguments { label_label = 'S'; /* units = DwtPixelUnits; */ x = 131; y = 100; font_argument = medium_font; }; };object e_mode : label { arguments { label_label = 'E'; /* units = DwtPixelUnits; */ x = 141; y = 100; font_argument = medium_font; }; };object k_mode : label { arguments { label_label = 'K'; /* units = DwtPixelUnits; */ x = 151; y = 100; font_argument = medium_font; }; };object i_mode : label { arguments { label_label = 'I'; /* units = DwtPixelUnits; */ x = 161; y = 100; font_argument = medium_font; }; };object foo : separator {}; end module;\%PFM020.B*[HELLER.DECW_MAGIC.PERFMETERS]MAKEFILE.;30IL;40Lv**[HELLER.DECW_MAGIC.PERFMETERS]MAKEFILE.;30+,./h 4L-0123KPWO56nk 7଴ 89GhHJ## Make file for PerfMeter stuff#L!CFLAGS = /nolist/debug/noopt/obj=$(MMS$TARGET_NAME).OBJ ! /define=DEBUGGING!LDFLAGS = /debug/trace$DECWOPTIONS = DECWSHARLIBRARIES.OPTUCONST = Perf_Meter_const.datUCONST_H = Perf_Meter_const.h!UCONST_UIL = Perf_Meter_const.uilCPUDEF_H = cpudef.h PERF_METER_OBJS = Perf_Meter.objPERF_METER_SRCS = Perf_Meter.c PERF_METER_UIL = Perf_Meter.uil PERF_METER_UID = Perf_Meter.uid PERF_METER_EXE = Perf_Meter.exeKIT_A = PFM020.AKIT_B = PFM020.BGKIT_A_FILES = pfm020.release_notes, kitinstal.com, $(PERF_METER_UID), -< $(PERF_METER_OBJS), $(DECWOPTIONS), perf_meter.hlp, - pfm_startup.com.KIT_B_FILES = $(UCONST), $(PERF_METER_SRCS), -3 $(PERF_METER_UIL), Makefile., $(UCONST_H), -! $(UCONST_UIL), $(CPUDEF_H)8POST_KIT_FILES = pfm020.release_notes, kitinstal.com, -6 $(DECWOPTIONS), perf_meter.hlp, pfm_startup.com, - $(KIT_B_FILES)POST_KIT = PFM020_vsh. UIL = UIL1UIPFM020.B*[HELLER.DECW_MAGIC.PERFMETERS]MAKEFILE.;30IL;40L[LFLAGS = /NOLIST /OUTPUT=$(MMS$TARGET_NAME).UID.SUFFIXES .UID .UIL.UIL.UID# @ define uil$include decw$include:! $(UIL) $(UILFLAGS) $(MMS$SOURCE).HLP.HLB- IF "''F$SEARCH("$(MMS$TARGET)")'" .EQS. "" -4 THEN $(LIBR)/CREATE=(KEY:32)/HELP $(MMS$TARGET)1 $(LIBR) ($LIBRFLAGS) $(MMS$TARGET) $(MMS$SOURCE)2Perf_Meter. : $(PERF_METER_EXE) $(PERF_METER_UID)  @ copy nl: Perf_Meter. @ purge5$(PERF_METER_EXE) : $(PERF_METER_OBJS) $(DECWOPTIONS)L link/exe=$(PERF_METER_EXE) $(PERF_METER_OBJS),$(DECWOPTIONS)/opt/notrace, -, sys$system:sys.stb/selective $(LDFLAGS)5Perf_Meter.obj : Perf_Meter.c $(UCONST_H) $(CPUDEF_H)$(UCONST_H) : $(UCONST)- @ puc == "$rcf$util:parse-uil-constants.exe" puc $(UCONST) $(UCONST_H) C 3$(PERF_METER_UID) : $(PERF_METER_UIL) $(UCONST_UIL)$(UCONST_UIL) : $(UCONST)- @ puc == "$rcf$util:parse-uil-constants.exe" puc $(UCONST) $(UCONST_UIL) UIL! kit and source save sets3Kits. : Perf_Meter. $(KIT_A) $(KIT_B) $(POST_KIT)01 @ copy nl: kits. @ purge$(KIT_A) : $(KIT_A_FILES) @ purge $(KIT_A_FILES); backup $(KIT_A_FILES) $(KIT_A)/save/inter/group=0/blo=2048 @ purge $(KIT_A)$(KIT_B) : $(KIT_B_FILES) @ purge $(KIT_B_FILES); backup $(KIT_B_FILES) $(KIT_B)/save/inter/group=0/blo=2048 @ purge $(KIT_B)!$(POST_KIT)01 : $(POST_KIT_FILES) @ purge $(POST_KIT_FILES)H @rcf$util:vms_shar 'f$edit("$(POST_KIT_FILES)","COLLAPSE") $(POST_KIT) @ purge $(POST_KIT)* 0PFM020.B 2[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER_CONST.H;1&\2*[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER_CONST.H;1+, ./h 4&-0123KPWO56@ߗ7@y;89GhHJ/* main windows */#define PFM_MAIN_WINDOW 1 /* Menu bar */#define PFM_MENU_BAR 2 /* FIle menu */#define PFM_EXIT_BUTTON 3 /* output windows */#define PFM_CPU_GRAPH 4 #define PFM_STATE_GRAPH 5 $#define PFM_DEVICE_0_IOCOUNT_NAME 6 %#define PFM_DEVICE_0_IOCOUNT_TOTAL 7 %#define PFM_DEVICE_0_IOCOUNT_DELTA 8 $#define PFM_DEVICE_1_IOCOUNT_NAME 9 &#define PFM_DEVICE_1_IOCOUNT_TOTAL 10 &#define PFM_DEVICE_1_IOCOUNT_DELTA 11 %#define PFM_DEVICE_2_IOCOUNT_NAME 12 &#define PFM_DEVICE_2_IOCOUNT_TOTAL 13 &#define PFM_DEVICE_2_IOCOUNT_DELTA 14 %#define PFM_DEVICE_3_IOCOUNT_NAME 15 &#define PFM_DEVICE_3_IOCOUNT_TOTAL 16 &#define PFM_DEVICE_3_IOCOUNT_DELTA 17 #define PFM_PAGEFAULTS_TOTAL 18 #define PFM_PAGEFAULTS_DELTA 19 #define PFM_PAGEIO_TOTAL 20 #define PFM_PAGEIO_DELTA 21 #define PFM_FREEPAGES_TOTAL 22 #define PFM_FREEPAGES_DELTA 23 #define PFM_MODPAGES_TOTAL 24 #define PFM_MODPAGES_DELTA 25 !/* max widget - must come last */#define MAX_WIDGET!G\bPFM020.B 2[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER_CONST.H;1&  26 4*[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER_CONST.UIL;1+, ./h 4'*-0123KPWO56 vi47`489GhHJ/* main windows */VALUE PFM_MAIN_WINDOW : 1; /* Menu bar */VALUE PFM_MENU_BAR : 2; /* FIle menu */VALUE PFM_EXIT_BUTTON : 3; /* output windows */VALUE PFM_CPU_GRAPH : 4; VALUE PFM_STATE_GRAPH : 5; %VALUE PFM_DEVICE_0_IOCOUNT_NAME : 6; &VALUE PFM_DEVICE_0_IOCOUNT_TOTAL : 7; &VALUE PFM_DEVICE_0_IOCOUNT_DELTA : 8; %VALUE PFM_DEVICE_1_IOCOUNT_NAME : 9; 'VALUE PFM_DEVICE_1_IOCOUNT_TOTAL : 10; 'VALUE PFM_DEVICE_1_IOCOUNT_DELTA : 11; &VALUE PFM_DEVICE_2_IOCOUNT_NAME "lPFM020.B 4[HELLER.DECW_MAGIC.PERFMETERS]PERF_METER_CONST.UIL;1': 12; 'VALUE PFM_DEVICE_2_IOCOUNT_TOTAL : 13; 'VALUE PFM_DEVICE_2_IOCOUNT_DELTA : 14; &VALUE PFM_DEVICE_3_IOCOUNT_NAME : 15; 'VALUE PFM_DEVICE_3_IOCOUNT_TOTAL : 16; 'VALUE PFM_DEVICE_3_IOCOUNT_DELTA : 17; !VALUE PFM_PAGEFAULTS_TOTAL : 18; !VALUE PFM_PAGEFAULTS_DELTA : 19; VALUE PFM_PAGEIO_TOTAL : 20; VALUE PFM_PAGEIO_DELTA : 21; VALUE PFM_FREEPAGES_TOTAL : 22; VALUE PFM_FREEPAGES_DELTA : 23; VALUE PFM_MODPAGES_TOTAL : 24; VALUE PFM_MODPAGES_DELTA : 25; !/* max widget - must come last */VALUE MAX_WIDGET : 26; (*[HELLER.DECW_MAGIC.PERFMETERS]CPUDEF.H;8+,./h 40-0123KPWO56ے7@F=ے89gcݒGhHJ#5PpPFM020.B([HELLER.DECW_MAGIC.PERFMETERS]CPUDEF.H;8_CONST.H;10J/* -*-c-mode-*- */#define CPU$C_RESERVED 0#define CPU$C_INIT 1#define CPU$C_RUN 2#define CPU$C_STOPPING 3#define CPU$C_STOPPED 4#define CPU$C_TIMOUT 5#define CPU$C_BOOT_REJECTED 6#define CPU$C_BOOTED 7#define CPU$M_INV_TBS 1#define CPU$M_INV_TBA 2#define CPU$M_TBACK 4#define CPU$M_BUGCHK 8#define CPU$M_BUGCHKACK 16#define CPU$M_RECALSCHD 32#define CPU$M_UPDASTLVL 64#define CPU$M_UPDTODR 128#define CPU$M_WORK_FQP 256#define CPU$M_QLOST 512#define CPU$M_RESCHED 1024#define CPU$M_VIRTCONS 2048#define CPU$M_IOPOST 4096!#define CPU$M_CPUFILL_1 268435455 #define CPU$M_CPUSPEC1 268435456 #define CPU$M_CPUSPEC2 536870912!#define CPU$M_CPUSPEC3 1073741824"#define CPU$M_CPUSPEC4 -2147483648!#define CPU$M_XNNFILL_1 268435455 #define CPU$M_XNNSPEC1 268435456 #define CPU$M_XNNSPEC2 536870912!#define CPU$M_XNNSPEC3 1073741824"#define CPU$M_XNNSPEC4 -2147483648!#define CPU$M_XSSFILL_1 268435455 #define CPU$M_XSSSPEC1 268435456 #define CPU$M_XSSSPEC2 536870912!#define CPU$M_XSSSPEC3 1073741824"#define CPU$M_XSSSPEC4 -2147483648!#define CPU$M_XCCFILL_1 268435455 #define CPU$M_XCCSPEC1 268435456 #define CPU$M_XCCSPEC2 536870912!#define CPU$M_XCCSPEC3 1073741824"#define CPU$M_XCCSPEC4 -2147483648!#define CPU$M_X60FILL_1 268435455 #define CPU$M_X60SPEC1 268435456 #define CPU$M_X60SPEC2 536870912!#define CPU$M_X60SPEC3 1073741824"#define CPU$M_X60SPEC4 -2147483648#define CPU$C_MAX_CPUS 32#define CPU$C_8NN_CPUS 2#define CPU$C_8PS_CPUS 4$O:PFM020.B([HELLER.DECW_MAGIC.PERFMETERS]CPUDEF.H;8_CONST.H;10#define CPU$C_8SS_CPUS 16#define CPU$C_9CC_CPUS 16#define CPU$C_9RR_CPUS 16#define CPU$C_60_CPUS 32#define CPU$K_PAGE0_LENGTH 120#define CPU$C_PAGE0_LENGTH 120#define CPU$K_NUM_SWIQS 6#define CPU$K_LENGTH 828#define CPU$C_LENGTH 828#define CPU$C_PAGECNT 2#define CPU$C_STACK 2048#define CPU$S_CPUDEF_PAGE0 512#define CPU$T_CPUDEF_PAGE0 0typedef struct cpu { unsigned char *cpu$l_curpcb; unsigned char *cpu$l_realstack; short int cpu$w_size; unsigned char cpu$b_type; unsigned char cpu$subtype; unsigned char cpu$b_busywait; unsigned char cpu$b_state; unsigned char cpu$b_cpumtx; unsigned char cpu$b_cur; unsigned char *cpu$l_intstk;!#define CPU$R_WORK_REQ_OVERLAY 20 long int cpu$l_work_req;#define CPU$V_INV_TBS 0#define CPU$V_INV_TBA 1#define CPU$V_TBACK 2#define CPU$V_BUGCHK 3#define CPU$V_BUGCHKACK 4#define CPU$V_RECALSCHD 5#define CPU$V_UPDASTLVL 6#define CPU$V_UPDTODR 7#define CPU$V_WORK_FQP 8#define CPU$V_QLOST 9#define CPU$V_RESCHED 10#define CPU$V_VIRTCONS 11#define CPU$V_IOPOST 12 #define CPU$R_CPUSPEC_OVERLAY 20#define CPU$S_CPUFILL_1 28#define CPU$V_CPUFILL_1 0#define CPU$V_CPUSPEC1 28#define CPU$V_CPUSPEC2 29#define CPU$V_CPUSPEC3 30#define CPU$V_CPUSPEC4 31#define CPU$S_XNNFILL_1 28#define CPU$V_XNNFILL_1 0#define CPU$V_XNNSPEC1 28#define CPU$V_XNNSPEC2 29#define CPU$V_XNNSPEC3 30#define CPU$V_XNNSPEC4 31#define CPU$S_XSSFILL_1 28#define CPU$V_XSSFILL_1 0#define CPU$V_XS%PFM020.B([HELLER.DECW_MAGIC.PERFMETERS]CPUDEF.H;8_CONST.UIL;10{tSSPEC1 28#define CPU$V_XSSSPEC2 29#define CPU$V_XSSSPEC3 30#define CPU$V_XSSSPEC4 31#define CPU$S_XCCFILL_1 28#define CPU$V_XCCFILL_1 0#define CPU$V_XCCSPEC1 28#define CPU$V_XCCSPEC2 29#define CPU$V_XCCSPEC3 30#define CPU$V_XCCSPEC4 31#define CPU$S_X60FILL_1 28#define CPU$V_X60FILL_1 0#define CPU$V_X60SPEC1 28#define CPU$V_X60SPEC2 29#define CPU$V_X60SPEC3 30#define CPU$V_X60SPEC4 31 long int cpu$l_percpuva; long int cpu$l_saved_ap; long int cpu$l_haltpc; long int cpu$l_haltpsl; long int cpu$l_saved_isp; long int cpu$l_pcbb; long int cpu$l_scbb; long int cpu$l_sisr; long int cpu$l_p0br; long int cpu$l_p0lr; long int cpu$l_p1br; long int cpu$l_p1lr; long int cpu$l_bugcode;#define CPU$S_CPUDATA 32 union {0 unsigned char cpu$b_cpudata[CPU$S_CPUDATA];(#define cpu$l_sid cpu_data.cpu$l_xxx_sid struct { long int cpu$l_xxx_sid; long int cpu_filler[7]; } cpu_data; struct { long int cpu$l_8nn_sid; long int cpu$l_8nn_revr2; long int cpu$l_8nn_spare; long int cpu$l_8nn_info; long int cpu$l_8nn_spare1; long int cpu$l_8nn_spare2; long int cpu$l_8nn_spare3; long int cpu$l_8nn_spare4; } cpu_8nn_data; struct { long int cpu$l_8ss_sid; short int cpu$w_8ss_bootcnt; short int cpu$w_8ss_ipintr; long int cpu$l_8ss_biwindow; long int cpu$l_8ss_mpb; long int cpu$l_8ss_spare1; long int cpu$l_8ss_spare2; long int cpu$l_8ss_spare3; long int cpu$l_8ss_spare4;&PFM020.B([HELLER.DECW_MAGIC.PERFMETERS]CPUDEF.H;8_CONST.H;10  } cpu_8ss_data; struct { long int cpu$l_9cc_sid; long int cpu$l_9cc_nodespace; long int cpu$l_9cc_mpb; long int cpu$l_9cc_xsid; long int cpu$l_9cc_spare1; long int cpu$l_9cc_spare2; long int cpu$l_9cc_spare3; long int cpu$l_9cc_spare4; } cpu_9cc_data; struct { long int cpu$l_9rr_sid; long int cpu$l_9rr_nodespace; long int cpu$l_9rr_mpb; long int cpu$l_9rr_xsid; long int cpu$l_9rr_spare1; long int cpu$l_9rr_spare2; long int cpu$l_9rr_spare3; long int cpu$l_9rr_spare4; } cpu_9rr_data; struct { long int cpu$l_60_sid; long int cpu$l_60_nodespace; long int cpu$l_60_mpb; long int cpu$l_60_xsid; long int cpu$l_60_spare1; long int cpu$l_60_spare2; long int cpu$l_60_spare3; long int cpu$l_60_spare4; } cpu_60_data; } cpu_data; long int cpu$l_mchk_mask; long int cpu$l_mchk_sp; long int cpu$l_p0pt_page; unsigned char cpu_fill2[392];#define CPU$S_SWIQFL 48 long int cpu$q_swiqfl[12]; long int cpu$l_psfl; long int cpu$l_psbl;#define CPU$S_WORK_FQFL 8 long int cpu$q_work_fqfl[2];#define CPU$S_WORK_IFQ 8&#define cpu$q_work_ifq cpu$w_work_fdfl long int cpu$l_qlost_fqfl; long int cpu$l_qlost_fqbl; short int cpu$w_qlost_size; unsigned char cpu$b_qlost_type; unsigned char cpu$b_qlost_flck; long int cpu$l_qlost_fpc; long int cpu$l_qlost_fr3; long int cpu$l_qlost_fr4;#define CPU$S_BOOT_TIME 8 long int cpu$q_boot_time[2];#define CPU$S_CPUID_MASK 8 long in'yHPFM020.B([HELLER.DECW_MAGIC.PERFMETERS]CPUDEF.H;8_CONST.H;108- t cpu$q_cpuid_mask[2];,#define cpu$l_cpuid_mask cpu$q_cpuid_mask[0] long int cpu$l_phy_cpuid; long int cpu$l_capability; long int cpu$l_tenusec; long int cpu$l_ubdelay;#define CPU$S_KERNEL 7% long int cpu$l_kernel[CPU$S_KERNEL]; long int cpu$l_nullcpu;#define CPU$S_UKERNEL 7( short int cpu$w_ukernel[CPU$S_UKERNEL]; short int cpu$w_unullcpu; short int cpu$w_clkutics; short int cpu$w_hardaff; long int cpu$l_rank_vec; long int cpu$l_ipl_vec;#define CPU$S_IPL_ARRAY 32+ long int cpu$l_ipl_array[CPU$S_IPL_ARRAY]; long int cpu$l_tpointer; short int cpu$w_sanity_timer; short int cpu$w_sanity_ticks; } $CPU;