added ShowCommitInSummary option

This commit is contained in:
Wen Jia Liu
2011-12-17 23:55:35 +00:00
parent 026669e8b1
commit 05ab0e3a01
6 changed files with 100 additions and 41 deletions
+2
View File
@@ -2,6 +2,8 @@ Process Hacker
2.26
* NEW/IMPROVED:
* Added option to show Commit Charge in system information
summary view
* Added -selectpid command line option
* Updated ExtendedTools plugin:
* Improved support for multiple GPUs
+16 -14
View File
@@ -1361,26 +1361,28 @@ BEGIN
CONTROL "Mapped",IDC_MAPPED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,49,41,10
END
IDD_OPTGRAPHS DIALOGEX 0, 0, 250, 145
IDD_OPTGRAPHS DIALOGEX 0, 0, 250, 156
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Graphs"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "CPU Kernel:",IDC_STATIC,7,36,39,8
CONTROL "CPU Kernel",IDC_CPUKERNEL,"PhColorBox",WS_CLIPSIBLINGS,73,34,33,13
LTEXT "CPU User:",IDC_STATIC,7,53,34,8
CONTROL "CPU User",IDC_CPUUSER,"PhColorBox",WS_CLIPSIBLINGS,73,51,33,13
LTEXT "CPU Kernel:",IDC_STATIC,7,48,39,8
CONTROL "CPU Kernel",IDC_CPUKERNEL,"PhColorBox",WS_CLIPSIBLINGS,73,46,33,13
LTEXT "CPU User:",IDC_STATIC,7,65,34,8
CONTROL "CPU User",IDC_CPUUSER,"PhColorBox",WS_CLIPSIBLINGS,73,63,33,13
CONTROL "Show text",IDC_SHOWTEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,49,10
LTEXT "I/O R+O:",IDC_STATIC,7,70,32,8
CONTROL "I/O R+O",IDC_IORO,"PhColorBox",WS_CLIPSIBLINGS,73,68,33,13
LTEXT "I/O W:",IDC_STATIC,7,86,23,8
CONTROL "I/O W",IDC_IOW,"PhColorBox",WS_CLIPSIBLINGS,73,85,33,13
LTEXT "Private Bytes:",IDC_STATIC,7,103,46,8
CONTROL "Private Bytes",IDC_PRIVATE,"PhColorBox",WS_CLIPSIBLINGS,73,101,33,13
LTEXT "Physical Memory:",IDC_STATIC,7,119,56,8
CONTROL "Physical Memory",IDC_PHYSICAL,"PhColorBox",WS_CLIPSIBLINGS,73,117,33,13
LTEXT "I/O R+O:",IDC_STATIC,7,82,32,8
CONTROL "I/O R+O",IDC_IORO,"PhColorBox",WS_CLIPSIBLINGS,73,80,33,13
LTEXT "I/O W:",IDC_STATIC,7,98,23,8
CONTROL "I/O W",IDC_IOW,"PhColorBox",WS_CLIPSIBLINGS,73,97,33,13
LTEXT "Private Bytes:",IDC_STATIC,7,115,46,8
CONTROL "Private Bytes",IDC_PRIVATE,"PhColorBox",WS_CLIPSIBLINGS,73,113,33,13
LTEXT "Physical Memory:",IDC_STATIC,7,131,56,8
CONTROL "Physical Memory",IDC_PHYSICAL,"PhColorBox",WS_CLIPSIBLINGS,73,129,33,13
CONTROL "Use old colors (black background)",IDC_USEOLDCOLORS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,19,123,10
CONTROL "Show Commit Charge instead of Physical Memory in summary view",IDC_SHOWCOMMITINSUMMARY,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,31,227,10
END
IDD_PLUGINS DIALOGEX 0, 0, 291, 272
@@ -2204,7 +2206,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 243
TOPMARGIN, 7
BOTTOMMARGIN, 138
BOTTOMMARGIN, 149
END
IDD_PLUGINS, DIALOG
+2
View File
@@ -1107,6 +1107,7 @@ INT_PTR CALLBACK PhpOptionsGraphsDlgProc(
// Show Text
SetDlgItemCheckForSetting(hwndDlg, IDC_SHOWTEXT, L"GraphShowText");
SetDlgItemCheckForSetting(hwndDlg, IDC_USEOLDCOLORS, L"GraphColorMode");
SetDlgItemCheckForSetting(hwndDlg, IDC_SHOWCOMMITINSUMMARY, L"ShowCommitInSummary");
ColorBox_SetColor(GetDlgItem(hwndDlg, IDC_CPUUSER), PhCsColorCpuUser);
ColorBox_SetColor(GetDlgItem(hwndDlg, IDC_CPUKERNEL), PhCsColorCpuKernel);
@@ -1126,6 +1127,7 @@ INT_PTR CALLBACK PhpOptionsGraphsDlgProc(
{
SetSettingForDlgItemCheck(hwndDlg, IDC_SHOWTEXT, L"GraphShowText");
SetSettingForDlgItemCheck(hwndDlg, IDC_USEOLDCOLORS, L"GraphColorMode");
SetSettingForDlgItemCheck(hwndDlg, IDC_SHOWCOMMITINSUMMARY, L"ShowCommitInSummary");
PH_SET_INTEGER_CACHED_SETTING(ColorCpuUser, ColorBox_GetColor(GetDlgItem(hwndDlg, IDC_CPUUSER)));
PH_SET_INTEGER_CACHED_SETTING(ColorCpuKernel, ColorBox_GetColor(GetDlgItem(hwndDlg, IDC_CPUKERNEL)));
PH_SET_INTEGER_CACHED_SETTING(ColorIoReadOther, ColorBox_GetColor(GetDlgItem(hwndDlg, IDC_IORO)));
+1
View File
@@ -516,6 +516,7 @@
#define IDC_EMPTY 1360
#define IDC_CHECK2 1361
#define IDC_SAMPLECOUNTAUTOMATIC 1361
#define IDC_SHOWCOMMITINSUMMARY 1361
#define IDC_ZLISTSTANDBY4_V 1364
#define IDC_ZLISTSTANDBY5_V 1365
#define IDC_ZLISTSTANDBY6_V 1366
+1
View File
@@ -155,6 +155,7 @@ VOID PhSettingsInitialization(
PhpAddStringSetting(L"ServiceTreeListColumns", L"");
PhpAddStringSetting(L"ServiceTreeListSort", L"0,1"); // 0, AscendingSortOrder
PhpAddIntegerPairSetting(L"SessionShadowHotkey", L"106,2"); // VK_MULTIPLY,KBDCTRL
PhpAddIntegerSetting(L"ShowCommitInSummary", L"0");
PhpAddIntegerSetting(L"ShowCpuBelow001", L"0");
PhpAddIntegerSetting(L"StartHidden", L"0");
PhpAddIntegerSetting(L"SysInfoWindowAlwaysOnTop", L"0");
+78 -27
View File
@@ -2849,28 +2849,57 @@ BOOLEAN PhSipMemorySectionCallback(
PPH_GRAPH_DRAW_INFO drawInfo = Parameter1;
ULONG i;
drawInfo->Flags = PH_GRAPH_USE_GRID;
Section->Parameters->ColorSetupFunction(drawInfo, PhCsColorPhysical, 0);
PhGetDrawInfoGraphBuffers(&Section->GraphState.Buffers, drawInfo, PhPhysicalHistory.Count);
if (!Section->GraphState.Valid)
if (PhGetIntegerSetting(L"ShowCommitInSummary"))
{
for (i = 0; i < drawInfo->LineDataCount; i++)
{
Section->GraphState.Data1[i] = (FLOAT)PhGetItemCircularBuffer_ULONG(&PhPhysicalHistory, i);
}
drawInfo->Flags = PH_GRAPH_USE_GRID;
Section->Parameters->ColorSetupFunction(drawInfo, PhCsColorPrivate, 0);
PhGetDrawInfoGraphBuffers(&Section->GraphState.Buffers, drawInfo, PhCommitHistory.Count);
if (PhSystemBasicInformation.NumberOfPhysicalPages != 0)
if (!Section->GraphState.Valid)
{
// Scale the data.
PhxfDivideSingle2U(
Section->GraphState.Data1,
(FLOAT)PhSystemBasicInformation.NumberOfPhysicalPages,
drawInfo->LineDataCount
);
}
for (i = 0; i < drawInfo->LineDataCount; i++)
{
Section->GraphState.Data1[i] = (FLOAT)PhGetItemCircularBuffer_ULONG(&PhCommitHistory, i);
}
Section->GraphState.Valid = TRUE;
if (PhPerfInformation.CommitLimit != 0)
{
// Scale the data.
PhxfDivideSingle2U(
Section->GraphState.Data1,
(FLOAT)PhPerfInformation.CommitLimit,
drawInfo->LineDataCount
);
}
Section->GraphState.Valid = TRUE;
}
}
else
{
drawInfo->Flags = PH_GRAPH_USE_GRID;
Section->Parameters->ColorSetupFunction(drawInfo, PhCsColorPhysical, 0);
PhGetDrawInfoGraphBuffers(&Section->GraphState.Buffers, drawInfo, PhPhysicalHistory.Count);
if (!Section->GraphState.Valid)
{
for (i = 0; i < drawInfo->LineDataCount; i++)
{
Section->GraphState.Data1[i] = (FLOAT)PhGetItemCircularBuffer_ULONG(&PhPhysicalHistory, i);
}
if (PhSystemBasicInformation.NumberOfPhysicalPages != 0)
{
// Scale the data.
PhxfDivideSingle2U(
Section->GraphState.Data1,
(FLOAT)PhSystemBasicInformation.NumberOfPhysicalPages,
drawInfo->LineDataCount
);
}
Section->GraphState.Valid = TRUE;
}
}
}
return TRUE;
@@ -2879,14 +2908,28 @@ BOOLEAN PhSipMemorySectionCallback(
PPH_SYSINFO_GRAPH_GET_TOOLTIP_TEXT getTooltipText = Parameter1;
ULONG usedPages;
usedPages = PhGetItemCircularBuffer_ULONG(&PhPhysicalHistory, getTooltipText->Index);
if (PhGetIntegerSetting(L"ShowCommitInSummary"))
{
usedPages = PhGetItemCircularBuffer_ULONG(&PhCommitHistory, getTooltipText->Index);
PhSwapReference2(&Section->GraphState.TooltipText, PhFormatString(
L"Physical Memory: %s\n%s",
PhaFormatSize(UInt32x32To64(usedPages, PAGE_SIZE), -1)->Buffer,
((PPH_STRING)PHA_DEREFERENCE(PhGetStatisticsTimeString(NULL, getTooltipText->Index)))->Buffer
));
getTooltipText->Text = Section->GraphState.TooltipText->sr;
PhSwapReference2(&Section->GraphState.TooltipText, PhFormatString(
L"Commit Charge: %s\n%s",
PhaFormatSize(UInt32x32To64(usedPages, PAGE_SIZE), -1)->Buffer,
((PPH_STRING)PHA_DEREFERENCE(PhGetStatisticsTimeString(NULL, getTooltipText->Index)))->Buffer
));
getTooltipText->Text = Section->GraphState.TooltipText->sr;
}
else
{
usedPages = PhGetItemCircularBuffer_ULONG(&PhPhysicalHistory, getTooltipText->Index);
PhSwapReference2(&Section->GraphState.TooltipText, PhFormatString(
L"Physical Memory: %s\n%s",
PhaFormatSize(UInt32x32To64(usedPages, PAGE_SIZE), -1)->Buffer,
((PPH_STRING)PHA_DEREFERENCE(PhGetStatisticsTimeString(NULL, getTooltipText->Index)))->Buffer
));
getTooltipText->Text = Section->GraphState.TooltipText->sr;
}
}
return TRUE;
case SysInfoGraphDrawPanel:
@@ -2895,8 +2938,16 @@ BOOLEAN PhSipMemorySectionCallback(
ULONG totalPages;
ULONG usedPages;
totalPages = PhSystemBasicInformation.NumberOfPhysicalPages;
usedPages = totalPages - PhPerfInformation.AvailablePages;
if (PhGetIntegerSetting(L"ShowCommitInSummary"))
{
totalPages = PhPerfInformation.CommitLimit;
usedPages = PhPerfInformation.CommittedPages;
}
else
{
totalPages = PhSystemBasicInformation.NumberOfPhysicalPages;
usedPages = totalPages - PhPerfInformation.AvailablePages;
}
drawPanel->Title = PhCreateString(L"Memory");
drawPanel->SubTitle = PhFormatString(