diff options
Diffstat (limited to 'sysutils/xperfmon/files/patch-aa')
-rw-r--r-- | sysutils/xperfmon/files/patch-aa | 540 |
1 files changed, 287 insertions, 253 deletions
diff --git a/sysutils/xperfmon/files/patch-aa b/sysutils/xperfmon/files/patch-aa index b4a0fb0e7010..c53c1fc383c6 100644 --- a/sysutils/xperfmon/files/patch-aa +++ b/sysutils/xperfmon/files/patch-aa @@ -1,34 +1,5 @@ -diff -ca ../xperfmon++/StripCharP.h ./StripCharP.h -*** ../xperfmon++/StripCharP.h Wed Jul 27 22:29:30 1994 ---- ./StripCharP.h Sun Dec 21 23:03:44 1997 -*************** -*** 62,71 **** - #define HIGHLIGHT 1 << 1 - #define ALL_GCS (FOREGROUND | HIGHLIGHT) - - /* New fields for the PerfChart widget instance record */ - - typedef struct { -! double valuedata[2048]; /* record of data points */ - Pixel fgpixel; /* color index for graph */ - Pixel hipixel; /* color index for lines */ - Pixel warnColor; ---- 62,73 ---- - #define HIGHLIGHT 1 << 1 - #define ALL_GCS (FOREGROUND | HIGHLIGHT) - -+ #define NUM_VALUES 2048 -+ - /* New fields for the PerfChart widget instance record */ - - typedef struct { -! double valuedata[NUM_VALUES]; /* record of data points */ - Pixel fgpixel; /* color index for graph */ - Pixel hipixel; /* color index for lines */ - Pixel warnColor; -diff -ca ../xperfmon++/StripChart.c ./StripChart.c *** ../xperfmon++/StripChart.c Wed Jul 27 22:29:30 1994 ---- ./StripChart.c Sun Dec 21 23:03:44 1997 +--- ./StripChart.c Thu Apr 30 15:03:27 1998 *************** *** 53,58 **** --- 53,70 ---- @@ -40,10 +11,10 @@ diff -ca ../xperfmon++/StripChart.c ./StripChart.c + #include <sys/param.h> + #endif + -+ #if (defined(BSD) && (BSD >= 199306)) ++ #if (defined(BSD) && (BSD >= 199506)) + # include <osreldate.h> + #else -+ # error You have to use at least a FreeBSD 2.X system ++ # error You have to use at least a FreeBSD 2.2.X system + #endif + + # include "system.h" @@ -98,25 +69,6 @@ diff -ca ../xperfmon++/StripChart.c ./StripChart.c if ( mono_screen ) { *************** -*** 323,330 **** - w->strip_chart.interval = repaint_window(w, 0, (int) w->core.width); - } - } -! if (value < w->strip_chart.min_value) -! w->strip_chart.min_value = value; - - w->strip_chart.valuedata[w->strip_chart.interval] = value; - if (XtIsRealized((Widget)w)) { ---- 354,361 ---- - w->strip_chart.interval = repaint_window(w, 0, (int) w->core.width); - } - } -! if (value < w->strip_chart.min_value) -! w->strip_chart.min_value = value; - - w->strip_chart.valuedata[w->strip_chart.interval] = value; - if (XtIsRealized((Widget)w)) { -*************** *** 343,361 **** if ( checkValue >= w->strip_chart.highAlarm ) { /* check for high alarm */ @@ -204,7 +156,7 @@ diff -ca ../xperfmon++/StripChart.c ./StripChart.c /* Compute the minimum scale required to graph the data, but don't go lower than min_scale. */ ! if (w->strip_chart.interval != 0 || scale <= (int)w->strip_chart.max_value) -! scale = ((int) (w->strip_chart.max_value)) + 1; + scale = ((int) (w->strip_chart.max_value)) + 1; if (scale < w->strip_chart.min_scale) scale = w->strip_chart.min_scale; @@ -216,11 +168,11 @@ diff -ca ../xperfmon++/StripChart.c ./StripChart.c ! if (w->strip_chart.interval != 0 || scale <= (int)w->strip_chart.max_value) { ! #if (defined(BSD) && (BSD >= 199306)) ! if (strcmp(w->strip_chart.botLabel, botNames[FREE_MEM]) != 0 || w->strip_chart.max_value == 100) -! scale = ((int) (w->strip_chart.max_value)) + 1; -! #else -! scale = ((int) (w->strip_chart.max_value)) + 1; -! #endif -! } + scale = ((int) (w->strip_chart.max_value)) + 1; ++ #else ++ scale = ((int) (w->strip_chart.max_value)) + 1; ++ #endif ++ } if (scale < w->strip_chart.min_scale) scale = w->strip_chart.min_scale; @@ -251,9 +203,8 @@ diff -ca ../xperfmon++/StripChart.c ./StripChart.c x = 4; XDS(w->strip_chart.botLabel); } -diff -ca ../xperfmon++/TimeChart.c ./TimeChart.c *** ../xperfmon++/TimeChart.c Wed Jul 27 22:29:31 1994 ---- ./TimeChart.c Sun Dec 21 23:03:44 1997 +--- ./TimeChart.c Thu Apr 30 15:03:27 1998 *************** *** 47,52 **** --- 47,62 ---- @@ -264,48 +215,17 @@ diff -ca ../xperfmon++/TimeChart.c ./TimeChart.c + #include <sys/param.h> + #endif + -+ #if (defined(BSD) && (BSD >= 199306)) ++ #if (defined(BSD) && (BSD >= 199506)) + # include <osreldate.h> + #else -+ # error You have to use at least a FreeBSD 2.X system ++ # error You have to use at least a FreeBSD 2.2.X system + #endif + #include <stdio.h> #include <X11/IntrinsicP.h> #include <X11/StringDefs.h> -diff -ca ../xperfmon++/TimeChart.h ./TimeChart.h -*** ../xperfmon++/TimeChart.h Wed Jul 27 22:29:31 1994 ---- ./TimeChart.h Sun Dec 21 23:03:45 1997 -*************** -*** 88,99 **** - #define XtCFillRect "FillRect" - - #define XtNgetValue "getValue" -! #define XtNhighlight "highlight" - #define XtNjumpScroll "jumpScroll" - #define XtNminScale "minScale" - #define XtNscale "scale" - #define XtNfillRect "fillRect" -! #define XtNupdate "update" - #define XtNvmunix "vmunix" - - typedef struct _TimeChartRec *TimeChartWidget; ---- 88,99 ---- - #define XtCFillRect "FillRect" - - #define XtNgetValue "getValue" -! /* #define XtNhighlight "highlight" */ - #define XtNjumpScroll "jumpScroll" - #define XtNminScale "minScale" - #define XtNscale "scale" - #define XtNfillRect "fillRect" -! /* #define XtNupdate "update" */ - #define XtNvmunix "vmunix" - - typedef struct _TimeChartRec *TimeChartWidget; -diff -ca ../xperfmon++/misc.c ./misc.c *** ../xperfmon++/misc.c Wed Jul 27 22:29:33 1994 ---- ./misc.c Sun Dec 21 23:03:45 1997 +--- ./misc.c Thu Apr 30 15:03:27 1998 *************** *** 22,27 **** --- 22,38 ---- @@ -317,10 +237,10 @@ diff -ca ../xperfmon++/misc.c ./misc.c + #include <sys/param.h> + #endif + -+ #if (defined(BSD) && (BSD >= 199306)) ++ #if (defined(BSD) && (BSD >= 199506)) + # include <osreldate.h> + #else -+ # error You have to use at least a FreeBSD 2.X system ++ # error You have to use at least a FreeBSD 2.2.X system + #endif + #include <stdio.h> @@ -343,79 +263,8 @@ diff -ca ../xperfmon++/misc.c ./misc.c switch (keycode) { case 'Q': case 'q': -diff -ca ../xperfmon++/system.h ./system.h -*** ../xperfmon++/system.h Wed Jul 27 22:29:34 1994 ---- ./system.h Sun Dec 21 23:03:45 1997 -*************** -*** 151,168 **** ---- 151,182 ---- - "Idle", - "Free", - "Disk", -+ #if (defined(BSD) && (BSD >= 199306)) -+ "Inter-", -+ #else - "Interrupts", -+ #endif - "Input", - "Output", -+ #if (defined(BSD) && (BSD >= 199306)) -+ "Collis", -+ "NFS Clt", -+ "NFS Srv", -+ #else - "Collision", - "NFS Client", - "NFS Server", -+ #endif - }; - static char *widgetLabels[] = { - "User", - "System", - "Idle", -+ #if (defined(BSD) && (BSD >= 199306)) -+ "Swap", -+ #else - "Free", -+ #endif - "Disk", - "Intrpts", - "Input", -*************** -*** 171,177 **** ---- 185,205 ---- - "NFSClient", - "NFSServer", - }; -+ - static char *botNames[] = { -+ #if (defined(BSD) && (BSD >= 199306)) -+ "CPU (%)", -+ "CPU (%)", -+ "CPU (%)", -+ "Swap (%)", -+ "Trsf/s", -+ "rupts/s", -+ "Pkts/s", -+ "Pkts/s", -+ "Pkts/s", -+ "Calls/s", -+ "Calls/s", -+ #else - "CPU", - "CPU", - "CPU", -*************** -*** 183,186 **** ---- 211,215 ---- - "Packets", - "Calls", - "Calls", -+ #endif - }; -diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c *** ../xperfmon++/xperfmon.c Wed Jul 27 22:29:39 1994 ---- ./xperfmon.c Sun Dec 21 23:03:45 1997 +--- ./xperfmon.c Thu Aug 13 18:59:02 1998 *************** *** 58,63 **** --- 58,73 ---- @@ -426,18 +275,33 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c + #include <sys/param.h> + #endif + -+ #if (defined(BSD) && (BSD >= 199306)) ++ #if (defined(BSD) && (BSD >= 199506)) + # include <osreldate.h> + #else -+ # error You have to use at least a FreeBSD 2.X system ++ # error You have to use at least a FreeBSD 2.2.X system + #endif + #include <stdio.h> #include <X11/IntrinsicP.h> #include <X11/StringDefs.h> *************** +*** 76,82 **** +--- 86,97 ---- + extern void start_graphs(); + extern time_t timeStamp; + extern Dimension oldHeight, oldWidth; ++ ++ #if __FreeBSD_version >= 220000 ++ extern float current_values[NUM_GRAPHS]; ++ #else + extern int current_values[NUM_GRAPHS]; ++ #endif + + char *gprogname; + double testValue; +*************** *** 94,99 **** ---- 104,114 ---- +--- 109,119 ---- { NULL, NULL }, }; @@ -450,7 +314,7 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c #define XtNcount "count" #define XtCCount "Count" *************** -*** 101,110 **** +*** 101,120 **** #define XtCFill "Fill" #define XtNfast "fast" #define XtCFast "Fast" @@ -461,9 +325,53 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c #define XtNdebug "debug" #define XtCDebug "Debug" #define XtNusercpuAdd "usercpuAdd" ---- 116,121 ---- + #define XtCUsercpuAdd "UsercpuAdd" + #define XtNusercpuSub "usercpuSub" + #define XtCUsercpuSub "UsercpuSub" + #define XtNsystemcpuAdd "systemcpuAdd" + #define XtCSystemcpuAdd "SystemcpuAdd" + #define XtNsystemcpuSub "systemcpuSub" + #define XtCSystemcpuSub "SystemcpuSub" + #define XtNidlecpuAdd "idlecpuAdd" + #define XtCIdlecpuAdd "IdlecpuAdd" + #define XtNidlecpuSub "idlecpuSub" +--- 121,154 ---- + #define XtCFill "Fill" + #define XtNfast "fast" + #define XtCFast "Fast" + #define XtNdebug "debug" + #define XtCDebug "Debug" ++ #if __FreeBSD_version >= 220000 ++ #define XtNsysloadAdd "sysloadAdd" ++ #define XtCSysloadAdd "SysloadAdd" ++ #define XtNsysloadSub "sysloadSub" ++ #define XtCSysloadSub "SysloadSub" ++ #endif + #define XtNusercpuAdd "usercpuAdd" + #define XtCUsercpuAdd "UsercpuAdd" + #define XtNusercpuSub "usercpuSub" + #define XtCUsercpuSub "UsercpuSub" ++ #if __FreeBSD_version >= 220000 ++ #define XtNnicecpuAdd "nicecpuAdd" ++ #define XtCNicecpuAdd "NicecpuAdd" ++ #define XtNnicecpuSub "nicecpuSub" ++ #define XtCNicecpuSub "NicecpuSub" ++ #endif + #define XtNsystemcpuAdd "systemcpuAdd" + #define XtCSystemcpuAdd "SystemcpuAdd" + #define XtNsystemcpuSub "systemcpuSub" + #define XtCSystemcpuSub "SystemcpuSub" ++ #if __FreeBSD_version >= 220000 ++ #define XtNintercpuAdd "intercpuAdd" ++ #define XtCIntercpuAdd "IntercpuAdd" ++ #define XtNintercpuSub "intercpuSub" ++ #define XtCIntercpuSub "IntercpuSub" ++ #endif + #define XtNidlecpuAdd "idlecpuAdd" + #define XtCIdlecpuAdd "IdlecpuAdd" + #define XtNidlecpuSub "idlecpuSub" *************** -*** 171,181 **** +*** 171,192 **** static XrmOptionDescRec optionDescList[] = { { "-interval", ".interval", XrmoptionSepArg, (caddr_t) NULL}, { "-immediate", "*PerfChart.immediate", XrmoptionNoArg, "True" }, @@ -472,34 +380,92 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c { "-lowmemWarn", "*perfChartFree.lowWarn", XrmoptionSepArg, NULL }, { "-highmemAlarm", "*perfChartFree.highAlarm", XrmoptionSepArg, NULL }, { "-highmemWarn", "*perfChartFree.highWarn", XrmoptionSepArg, NULL }, - +! { "-lowuserAlarm", "*perfChartUser.lowAlarm", XrmoptionSepArg, NULL }, { "-lowuserWarn", "*perfChartUser.lowWarn", XrmoptionSepArg, NULL }, ---- 182,198 ---- + { "-highuserAlarm", "*perfChartUser.highAlarm", XrmoptionSepArg, NULL }, + { "-highuserWarn", "*perfChartUser.highWarn", XrmoptionSepArg, NULL }, + + { "-lowsysAlarm", "*perfChartSystem.lowAlarm", XrmoptionSepArg, NULL }, + { "-lowsysWarn", "*perfChartSystem.lowWarn", XrmoptionSepArg, NULL }, + { "-highsysAlarm", "*perfChartSystem.highAlarm", XrmoptionSepArg, NULL }, + { "-highsysWarn", "*perfChartSystem.highWarn", XrmoptionSepArg, NULL }, + + { "-lowidleAlarm", "*perfChartIdle.lowAlarm", XrmoptionSepArg, NULL }, + { "-lowidleWarn", "*perfChartIdle.lowWarn", XrmoptionSepArg, NULL }, + { "-highidleAlarm", "*perfChartIdle.highAlarm", XrmoptionSepArg, NULL }, +--- 205,250 ---- static XrmOptionDescRec optionDescList[] = { { "-interval", ".interval", XrmoptionSepArg, (caddr_t) NULL}, { "-immediate", "*PerfChart.immediate", XrmoptionNoArg, "True" }, -! #if (defined(BSD) && (BSD >= 199306)) -! { "-lowswapAlarm", "*perfChartFree.lowAlarm", XrmoptionSepArg, NULL }, -! { "-lowswapWarn", "*perfChartFree.lowWarn", XrmoptionSepArg, NULL }, -! { "-highswapAlarm", "*perfChartFree.highAlarm", XrmoptionSepArg, NULL }, -! { "-highswapWarn", "*perfChartFree.highWarn", XrmoptionSepArg, NULL }, +! #if __FreeBSD_version >= 220000 +! { "-lowloadAlarm", "*perfChartLoad.lowAlarm", XrmoptionSepArg, NULL }, +! { "-lowloadWarn", "*perfChartLoad.lowWarn", XrmoptionSepArg, NULL }, +! { "-highloadAlarm", "*perfChartLoad.highAlarm", XrmoptionSepArg, NULL }, +! { "-highloadWarn", "*perfChartLoad.highWarn", XrmoptionSepArg, NULL }, +! +! { "-lowswapAlarm", "*perfChartSwap.lowAlarm", XrmoptionSepArg, NULL }, +! { "-lowswapWarn", "*perfChartSwap.lowWarn", XrmoptionSepArg, NULL }, +! { "-highswapAlarm", "*perfChartSwap.highAlarm", XrmoptionSepArg, NULL }, +! { "-highswapWarn", "*perfChartSwap.highWarn", XrmoptionSepArg, NULL }, ! #else { "-lowmemAlarm", "*perfChartFree.lowAlarm", XrmoptionSepArg, NULL }, { "-lowmemWarn", "*perfChartFree.lowWarn", XrmoptionSepArg, NULL }, { "-highmemAlarm", "*perfChartFree.highAlarm", XrmoptionSepArg, NULL }, { "-highmemWarn", "*perfChartFree.highWarn", XrmoptionSepArg, NULL }, -+ #endif - +! #endif { "-lowuserAlarm", "*perfChartUser.lowAlarm", XrmoptionSepArg, NULL }, { "-lowuserWarn", "*perfChartUser.lowWarn", XrmoptionSepArg, NULL }, -*************** -*** 237,244 **** ---- 254,266 ---- + { "-highuserAlarm", "*perfChartUser.highAlarm", XrmoptionSepArg, NULL }, + { "-highuserWarn", "*perfChartUser.highWarn", XrmoptionSepArg, NULL }, + ++ #if __FreeBSD_version >= 220000 ++ { "-lowniceAlarm", "*perfChartNice.lowAlarm", XrmoptionSepArg, NULL }, ++ { "-lowniceWarn", "*perfChartNice.lowWarn", XrmoptionSepArg, NULL }, ++ { "-highniceAlarm", "*perfChartNice.highAlarm", XrmoptionSepArg, NULL }, ++ { "-highniceWarn", "*perfChartNice.highWarn", XrmoptionSepArg, NULL }, ++ #endif ++ + { "-lowsysAlarm", "*perfChartSystem.lowAlarm", XrmoptionSepArg, NULL }, + { "-lowsysWarn", "*perfChartSystem.lowWarn", XrmoptionSepArg, NULL }, + { "-highsysAlarm", "*perfChartSystem.highAlarm", XrmoptionSepArg, NULL }, + { "-highsysWarn", "*perfChartSystem.highWarn", XrmoptionSepArg, NULL }, + ++ #if __FreeBSD_version >= 220000 ++ { "-lowinterAlarm", "*perfChartInter.lowAlarm", XrmoptionSepArg, NULL }, ++ { "-lowinterWarn", "*perfChartInter.lowWarn", XrmoptionSepArg, NULL }, ++ { "-highinterAlarm", "*perfChartInter.highAlarm", XrmoptionSepArg, NULL }, ++ { "-highinterWarn", "*perfChartInter.highWarn", XrmoptionSepArg, NULL }, ++ #endif ++ + { "-lowidleAlarm", "*perfChartIdle.lowAlarm", XrmoptionSepArg, NULL }, + { "-lowidleWarn", "*perfChartIdle.lowWarn", XrmoptionSepArg, NULL }, + { "-highidleAlarm", "*perfChartIdle.highAlarm", XrmoptionSepArg, NULL }, +*************** +*** 231,244 **** +--- 289,319 ---- + { "-fill", "*fill", XrmoptionNoArg, "True" }, + { "-debug", "*debug", XrmoptionNoArg, "True" }, + { "-fast", "*fast", XrmoptionNoArg, (XtPointer)"True" }, ++ #if __FreeBSD_version >= 220000 ++ { "-sysload", XtNsysloadSub, XrmoptionNoArg, "True" }, ++ { "+sysload", XtNsysloadAdd, XrmoptionNoArg, "TRUE" }, ++ #endif + { "-usercpu", XtNusercpuSub, XrmoptionNoArg, "True" }, + { "+usercpu", XtNusercpuAdd, XrmoptionNoArg, "TRUE" }, ++ #if __FreeBSD_version >= 220000 ++ { "-nicecpu", XtNnicecpuSub, XrmoptionNoArg, "True" }, ++ { "+nicecpu", XtNnicecpuAdd, XrmoptionNoArg, "TRUE" }, ++ #endif + { "-systemcpu", XtNsystemcpuSub, XrmoptionNoArg, "True" }, { "+systemcpu", XtNsystemcpuAdd, XrmoptionNoArg, "TRUE" }, ++ #if __FreeBSD_version >= 220000 ++ { "-intercpu", XtNintercpuSub, XrmoptionNoArg, "True" }, ++ { "+intercpu", XtNintercpuAdd, XrmoptionNoArg, "TRUE" }, ++ #endif { "-idlecpu", XtNidlecpuSub, XrmoptionNoArg, "True" }, { "+idlecpu", XtNidlecpuAdd, XrmoptionNoArg, "TRUE" }, -+ #if __FreeBSD_version >= 199504 ++ #if __FreeBSD_version >= 220000 + { "-freeswap", XtNfreememSub, XrmoptionNoArg, "True" }, + { "+freeswap", XtNfreememAdd, XrmoptionNoArg, "TRUE" }, + #else @@ -528,26 +494,99 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c { XtNinterval, XtCInterval, XtRInt, sizeof(int), XtOffsetOf(AppData, interval), XtRImmediate, (caddr_t) DEF_INTERVAL }, { XtNcount, XtCCount, XtRInt, sizeof(int), ---- 275,285 ---- +--- 328,338 ---- +*************** +*** 274,288 **** + XtOffsetOf(AppData, debug), XtRImmediate, (caddr_t)NULL }, + { XtNfast, XtCFast, XtRBoolean, sizeof(Boolean), + XtOffsetOf(AppData, fast), XtRImmediate, (XtPointer) NULL }, +! + { XtNusercpuAdd, XtCUsercpuAdd, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, addG[USR_CPU]), XtRImmediate, (XtPointer) NULL }, + { XtNusercpuSub, XtCUsercpuSub, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, subG[USR_CPU]), XtRImmediate, (XtPointer) NULL }, + { XtNsystemcpuAdd, XtCSystemcpuAdd, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, addG[SYS_CPU]), XtRImmediate, (XtPointer) NULL }, + { XtNsystemcpuSub, XtCSystemcpuSub, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, subG[SYS_CPU]), XtRImmediate, (XtPointer) NULL }, + { XtNidlecpuAdd, XtCIdlecpuAdd, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, addG[IDL_CPU]), XtRImmediate, (XtPointer) NULL }, + { XtNidlecpuSub, XtCIdlecpuSub, XtRBool, sizeof(Bool), +--- 343,374 ---- + XtOffsetOf(AppData, debug), XtRImmediate, (caddr_t)NULL }, + { XtNfast, XtCFast, XtRBoolean, sizeof(Boolean), + XtOffsetOf(AppData, fast), XtRImmediate, (XtPointer) NULL }, +! #if __FreeBSD_version >= 220000 +! { XtNsysloadAdd, XtCSysloadAdd, XtRBool, sizeof(Bool), +! XtOffsetOf(AppData, addG[SYS_LOAD]), XtRImmediate, (XtPointer) NULL }, +! { XtNsysloadSub, XtCSysloadSub, XtRBool, sizeof(Bool), +! XtOffsetOf(AppData, subG[SYS_LOAD]), XtRImmediate, (XtPointer) NULL }, +! #endif + { XtNusercpuAdd, XtCUsercpuAdd, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, addG[USR_CPU]), XtRImmediate, (XtPointer) NULL }, + { XtNusercpuSub, XtCUsercpuSub, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, subG[USR_CPU]), XtRImmediate, (XtPointer) NULL }, ++ #if __FreeBSD_version >= 220000 ++ { XtNnicecpuAdd, XtCNicecpuAdd, XtRBool, sizeof(Bool), ++ XtOffsetOf(AppData, addG[NICE_CPU]), XtRImmediate, (XtPointer) NULL }, ++ { XtNnicecpuSub, XtCNicecpuSub, XtRBool, sizeof(Bool), ++ XtOffsetOf(AppData, subG[NICE_CPU]), XtRImmediate, (XtPointer) NULL }, ++ #endif + { XtNsystemcpuAdd, XtCSystemcpuAdd, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, addG[SYS_CPU]), XtRImmediate, (XtPointer) NULL }, + { XtNsystemcpuSub, XtCSystemcpuSub, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, subG[SYS_CPU]), XtRImmediate, (XtPointer) NULL }, ++ #if __FreeBSD_version >= 220000 ++ { XtNintercpuAdd, XtCIntercpuAdd, XtRBool, sizeof(Bool), ++ XtOffsetOf(AppData, addG[INT_CPU]), XtRImmediate, (XtPointer) NULL }, ++ { XtNintercpuSub, XtCIntercpuSub, XtRBool, sizeof(Bool), ++ XtOffsetOf(AppData, subG[INT_CPU]), XtRImmediate, (XtPointer) NULL }, ++ #endif + { XtNidlecpuAdd, XtCIdlecpuAdd, XtRBool, sizeof(Bool), + XtOffsetOf(AppData, addG[IDL_CPU]), XtRImmediate, (XtPointer) NULL }, + { XtNidlecpuSub, XtCIdlecpuSub, XtRBool, sizeof(Bool), *************** *** 324,329 **** ---- 340,348 ---- +--- 410,418 ---- void usage() { -+ #if (defined(BSD) && (BSD >= 199306)) -+ fprintf(stderr, "\nxperfmon++ V1.40 for FreeBSD-2.X and 3.X\n"); ++ #if __FreeBSD_version >= 220000 ++ fprintf(stderr, "\nxperfmon++ V2.0 for FreeBSD-2.2.X and 3.X\n"); + #endif fprintf(stderr, "\nusage: xperfmon++ option option option .....\n"); fprintf(stderr, "options:\n"); fprintf(stderr, " [-display [{host}]:[{vs}]]\n"); *************** -*** 344,350 **** ---- 363,373 ---- +*** 340,350 **** + fprintf(stderr, " [-fast] (changes interval from seconds to milliseconds)\n"); + fprintf(stderr, " [-immediate] (background limit alarm color is based on current sample)\n"); + fprintf(stderr, " [-fill] (output filled graph instead of line graph)\n\n"); +! fprintf(stderr, " [{-+}usercpu] ({remove|add} usercpu to list of graphs\n"); fprintf(stderr, " [{-+}systemcpu] ({remove|add} systemcpu to list of graphs\n"); fprintf(stderr, " [{-+}idlecpu] ({remove|add} idlecpu to list of graphs\n"); -+ #if (defined(BSD) && (BSD >= 199306)) + fprintf(stderr, " [{-+}freemem] ({remove|add} freemem to list of graphs\n"); + fprintf(stderr, " [{-+}diskxfr] ({remove|add} disk transfers to list of graphs\n"); + fprintf(stderr, " [{-+}interrupts] ({remove|add} interrupts to list of graphs\n"); + fprintf(stderr, " [{-+}inputpkts] ({remove|add} input packets to list of graphs\n"); +--- 429,451 ---- + fprintf(stderr, " [-fast] (changes interval from seconds to milliseconds)\n"); + fprintf(stderr, " [-immediate] (background limit alarm color is based on current sample)\n"); + fprintf(stderr, " [-fill] (output filled graph instead of line graph)\n\n"); +! #if __FreeBSD_version >= 220000 +! fprintf(stderr, " [{-+}sysload] ({remove|add} sysload to list of graphs\n"); +! #endif + fprintf(stderr, " [{-+}usercpu] ({remove|add} usercpu to list of graphs\n"); ++ #if __FreeBSD_version >= 220000 ++ fprintf(stderr, " [{-+}nicecpu] ({remove|add} nicecpu to list of graphs\n"); ++ #endif + fprintf(stderr, " [{-+}systemcpu] ({remove|add} systemcpu to list of graphs\n"); ++ #if __FreeBSD_version >= 220000 ++ fprintf(stderr, " [{-+}intercpu] ({remove|add} intercpu to list of graphs\n"); ++ #endif + fprintf(stderr, " [{-+}idlecpu] ({remove|add} idlecpu to list of graphs\n"); ++ #if __FreeBSD_version >= 220000 + fprintf(stderr, " [{-+}freeswap] ({remove|add} freeswap to list of graphs\n"); + #else fprintf(stderr, " [{-+}freemem] ({remove|add} freemem to list of graphs\n"); @@ -557,18 +596,28 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c fprintf(stderr, " [{-+}inputpkts] ({remove|add} input packets to list of graphs\n"); *************** *** 361,370 **** ---- 384,401 ---- fprintf(stderr, " [-high*Alarm {value}] ( Set High Alarm value for *)\n"); fprintf(stderr, " [-high*Warn {value}] ( Set High Warning value for *)\n"); fprintf(stderr, " Where \"*\" is one of the following:\n"); -+ #if (defined(BSD) && (BSD >= 199306)) -+ fprintf(stderr, " [swap | user | sys | idle | disk | intrpts |\n"); + fprintf(stderr, " [mem | user | sys | idle | disk | intrpts |\n"); +! fprintf(stderr, " input | output | collision | nfsclient | nfsserver]\n"); + fprintf(stderr, " For Example:\n"); + fprintf(stderr, " [-lowmemAlarm {value}] ( Set low Free Memory Alarm Value)\n"); + fprintf(stderr, "WARNING: It is an error condition to set both a high, and a low, limit warning or alarm.\n"); + exit(1); + } +--- 462,479 ---- + fprintf(stderr, " [-high*Alarm {value}] ( Set High Alarm value for *)\n"); + fprintf(stderr, " [-high*Warn {value}] ( Set High Warning value for *)\n"); + fprintf(stderr, " Where \"*\" is one of the following:\n"); ++ #if __FreeBSD_version >= 220000 ++ fprintf(stderr, " [load | user | nice | sys | inter | idle | swap | disk |\n"); + #else fprintf(stderr, " [mem | user | sys | idle | disk | intrpts |\n"); -+ #endif - fprintf(stderr, " input | output | collision | nfsclient | nfsserver]\n"); +! #endif +! fprintf(stderr, " intrpts | input | output | collision | nfsclient | nfsserver]\n"); fprintf(stderr, " For Example:\n"); -+ #if (defined(BSD) && (BSD >= 199306)) ++ #if __FreeBSD_version >= 220000 + fprintf(stderr, " [-lowswapAlarm {value}] ( Set low Free Swap Alarm Value)\n"); + #else fprintf(stderr, " [-lowmemAlarm {value}] ( Set low Free Memory Alarm Value)\n"); @@ -578,7 +627,7 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c } *************** *** 386,391 **** ---- 417,423 ---- +--- 495,501 ---- time(&timeStamp); return; } @@ -595,7 +644,7 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c char eventString[60]; switch (event->type) { case Expose: ---- 426,433 ---- +--- 504,511 ---- Boolean *contin2disp; { Dimension neww, newh; @@ -619,7 +668,7 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c strcpy(eventString,"reparent"); break; case ConfigureNotify: ---- 436,453 ---- +--- 514,531 ---- strcpy(eventString,"expose"); break; case MapNotify: @@ -648,12 +697,12 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c ! if ( neww < 250 + 10 ) { ! neww = 250 + 10; ! w->core.width = 250 + 10; -! XtResizeWindow(w); - } + XtResizeWindow(w); +! } if ( appData.debug ) printf("Resize Request: type=%d %s, oldw=%hu, oldh=%hu, neww=%hu, newh=%hu\n", (int)event->type, eventString, ---- 455,489 ---- +--- 533,567 ---- newh=event->xconfigure.height; strcpy(eventString,"configure"); break; @@ -665,32 +714,32 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c + window_size_changed = TRUE; + } else { + w->core.width = neww; ++ } ++ ++ if ( newh < MIN_HEIGHT ) { ++ newh = MIN_HEIGHT; ++ w->core.height = MIN_HEIGHT; ++ window_size_changed = TRUE; ++ } ++ ++ /* Now the graphs fit perfect into the window! */ ++ hOverHead = (5.6 * appData.numGraphsOn) - (6 / appData.numGraphsOn); ++ boxH = labelBox->core.height; ++ timeH = timechart->core.height; ++ newWidgetH = (newh - (boxH+7) - (timeH+10) - hOverHead) / appData.numGraphsOn; ++ w->core.height = newWidgetH * appData.numGraphsOn + hOverHead + (boxH+7) + (timeH+10); ++ if(w->core.height != newh) { ++ newh = w->core.height; } ! -! if ( newh < MIN_HEIGHT ) { -! newh = MIN_HEIGHT; -! w->core.height = MIN_HEIGHT; -! window_size_changed = TRUE; -! } +! if( neww != oldWidth || newh != oldHeight || window_size_changed == TRUE ) + XtResizeWindow(w); ! -! /* Now the graphs fit perfect into the window! */ -! hOverHead = (5.6 * appData.numGraphsOn) - (6 / appData.numGraphsOn); -! boxH = labelBox->core.height; -! timeH = timechart->core.height; -! newWidgetH = (newh - (boxH+7) - (timeH+10) - hOverHead) / appData.numGraphsOn; -! w->core.height = newWidgetH * appData.numGraphsOn + hOverHead + (boxH+7) + (timeH+10); -! if(w->core.height != newh) { -! newh = w->core.height; - } -+ -+ if( neww != oldWidth || newh != oldHeight || window_size_changed == TRUE ) -+ XtResizeWindow(w); -+ if ( appData.debug ) printf("Resize Request: type=%d %s, oldw=%hu, oldh=%hu, neww=%hu, newh=%hu\n", (int)event->type, eventString, *************** -*** 431,448 **** +*** 431,441 **** neww, newh); if ( event->type == ConfigureNotify ) { @@ -702,14 +751,7 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c if ( oldWidth == neww && oldHeight == newh ) return; if ( appData.debug ) - printf("BoxH=%hu, timeH=%hu, numGraphOn=%hu, newWidgetH=%hu\n", - boxH, timeH, appData.numGraphsOn, newWidgetH); - -! neww -= 10; /* allow for spacing and borders */ - - for ( i=0; i<NUM_GRAPHS; i++ ) { - if ( appData.graphOn[i] ) { ---- 491,504 ---- +--- 569,575 ---- neww, newh); if ( event->type == ConfigureNotify ) { @@ -717,16 +759,9 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c if ( oldWidth == neww && oldHeight == newh ) return; if ( appData.debug ) - printf("BoxH=%hu, timeH=%hu, numGraphOn=%hu, newWidgetH=%hu\n", - boxH, timeH, appData.numGraphsOn, newWidgetH); - -! neww -= 10; /* allow for spacing and borders */ - - for ( i=0; i<NUM_GRAPHS; i++ ) { - if ( appData.graphOn[i] ) { *************** *** 455,460 **** ---- 511,517 ---- +--- 589,595 ---- XFlush(XtDisplay(w)); } @@ -745,7 +780,7 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c char *progname = argv[0]; Bool foundAnAdd = FALSE; ---- 521,533 ---- +--- 599,611 ---- int argc; char **argv; { @@ -761,8 +796,8 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c Bool foundAnAdd = FALSE; *************** *** 478,483 **** ---- 539,548 ---- - optionDescList, XtNumber(optionDescList), +--- 617,626 ---- + optionDescList, XtNumber(optionDescList), &argc, argv, NULL, NULL); + @@ -796,13 +831,13 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c XtNjustify, XtJustifyLeft, XtNinternalHeight, 0, XtNtop, XtChainTop, ---- 605,656 ---- +--- 683,734 ---- xperfmon_width, xperfmon_height)); XtSetValues(appData.toplevel, &arg, 1); } /* create windows */ - pappaBox = XtVaCreateManagedWidget("PappaBox", boxWidgetClass, appData.toplevel, + pappaBox = XtVaCreateManagedWidget("PappaBox", boxWidgetClass, appData.toplevel, XtNborderWidth, 0, NULL); XtOverrideTranslations(pappaBox, XtParseTranslationTable(defaultTranslations)); @@ -859,8 +894,8 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c XtNupdate, appData.interval*appData.ms_per_sec, XtNfillRect, (int)appData.fill, XtNjumpScroll, 1, ---- 665,672 ---- - perfmon[i] = XtVaCreateManagedWidget(hostname, perfChartWidgetClass, pappaBox, +--- 743,750 ---- + perfmon[i] = XtVaCreateManagedWidget(hostname, perfChartWidgetClass, pappaBox, XtNtopLabel, topNames[i], XtNbotLabel, botNames[i], ! XtNwidth, newWidgetW, @@ -891,10 +926,10 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c - XtRealizeWidget(appData.toplevel); XtAppMainLoop(appData.app_context); } ---- 675,696 ---- +--- 753,773 ---- } - timechart = XtVaCreateManagedWidget("timeChart", timeChartWidgetClass, pappaBox, - XtNfromVert, perfmon[1], + timechart = XtVaCreateManagedWidget("timeChart", timeChartWidgetClass, pappaBox, + XtNfromVert, perfmon[1], ! XtNwidth, newWidgetW, ! XtNheight, timeH, XtNupdate, appData.interval*appData.ms_per_sec, @@ -904,8 +939,8 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c sys_setup(); XtAddCallback(timechart, XtNgetValue, update_time_stat, NULL); - for ( i=0; i<NUM_GRAPHS; i++ ) - if ( appData.graphOn[i] ) + for ( i=0; i<NUM_GRAPHS; i++ ) + if ( appData.graphOn[i] ) ! XtAddCallback(perfmon[i], XtNgetValue, update_stat, (XtPointer)i); appData.interval_id = XtAppAddTimeOut(appData.app_context, @@ -913,4 +948,3 @@ diff -ca ../xperfmon++/xperfmon.c ./xperfmon.c XtAppMainLoop(appData.app_context); } -+ |