| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ProcessDescriptor.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_PROCESS_H
2 #define GAUDIKERNEL_PROCESS_H
3
4 // Framework include files
5 #include "GaudiKernel/Kernel.h"
6 #include "GaudiKernel/SystemBase.h"
7
8 namespace System
9 {
10 // Forward declarations
11 class ProcessDescriptor;
13 ProcessDescriptor* getProcess();
14
18 typedef struct _PEB* PPEB;
19 struct PROCESS_BASIC_INFORMATION {
20 long ExitStatus;
21 PPEB PebBaseAddress;
22 unsigned long AffinityMask;
23 long BasePriority;
24 unsigned long UniqueProcessId;
25 unsigned long InheritedFromUniqueProcessId;
26 };
27
33 struct QUOTA_LIMITS {
34 unsigned long PagedPoolLimit;
35 unsigned long NonPagedPoolLimit;
36 unsigned long MinimumWorkingSetSize;
37 unsigned long MaximumWorkingSetSize;
38 unsigned long PagefileLimit;
39 longlong TimeLimit;
40 };
41
45 struct IO_COUNTERS {
46 unsigned long ReadOperationCount;
47 unsigned long WriteOperationCount;
48 unsigned long OtherOperationCount;
49 // longlong ReadOperationCount;
50 // longlong WriteOperationCount;
51 // longlong OtherOperationCount;
52 longlong ReadTransferCount;
53 longlong WriteTransferCount;
54 longlong OtherTransferCount;
55 };
56
60 struct VM_COUNTERS {
61 unsigned long PeakVirtualSize;
62 unsigned long VirtualSize;
63 unsigned long PageFaultCount;
64 unsigned long PeakWorkingSetSize;
65 unsigned long WorkingSetSize;
66 unsigned long QuotaPeakPagedPoolUsage;
67 unsigned long QuotaPagedPoolUsage;
68 unsigned long QuotaPeakNonPagedPoolUsage;
69 unsigned long QuotaNonPagedPoolUsage;
70 unsigned long PagefileUsage;
71 unsigned long PeakPagefileUsage;
72 };
73
77 struct POOLED_USAGE_AND_LIMITS {
78 unsigned long PeakPagedPoolUsage;
79 unsigned long PagedPoolUsage;
80 unsigned long PagedPoolLimit;
81 unsigned long PeakNonPagedPoolUsage;
82 unsigned long NonPagedPoolUsage;
83 unsigned long NonPagedPoolLimit;
84 unsigned long PeakPagefileUsage;
85 unsigned long PagefileUsage;
86 unsigned long PagefileLimit;
87 };
88
93 struct KERNEL_USER_TIMES {
94 longlong CreateTime;
95 longlong ExitTime;
96 longlong KernelTime;
97 longlong UserTime;
98 // longlong EllapsedTime; // Added by M.Frank
99 };
100
109 class ProcessDescriptor
110 {
111 class ProcessHandle
112 {
113 void* m_handle;
114 bool m_needRelease;
115
116 public:
117 ProcessHandle( long pid );
118 virtual ~ProcessHandle();
119 long item() { return m_needRelease ? 1 : 0; }
120 void* handle() { return m_handle; }
121 };
122
123 public:
124 ProcessDescriptor();
125 virtual ~ProcessDescriptor();
126 long query( long pid, InfoType info, PROCESS_BASIC_INFORMATION* buffer );
127 long query( long pid, InfoType info, POOLED_USAGE_AND_LIMITS* buffer );
128 long query( long pid, InfoType info, KERNEL_USER_TIMES* buffer );
129 long query( long pid, InfoType info, QUOTA_LIMITS* buffer );
130 long query( long pid, InfoType info, VM_COUNTERS* buffer );
131 long query( long pid, InfoType info, IO_COUNTERS* buffer );
132 long query( long pid, InfoType info, long* buffer );
133 };
134
135 inline ProcessDescriptor* getProcess()
136 {
137 static ProcessDescriptor p;
138 return &p;
139 }
140 }
141 #endif // GAUDIKERNEL_PROCESS_H
System::VM_COUNTERS::QuotaPeakPagedPoolUsage
unsigned long QuotaPeakPagedPoolUsage
Definition: ProcessDescriptor.h:66
System::VM_COUNTERS::PagefileUsage
unsigned long PagefileUsage
Definition: ProcessDescriptor.h:70
System::KERNEL_USER_TIMES
Process/Thread System and User Time NtQueryInformationProcess using ProcessTimes NtQueryInformationTh...
Definition: ProcessDescriptor.h:93
Kernel.h
System::IO_COUNTERS::WriteTransferCount
longlong WriteTransferCount
Definition: ProcessDescriptor.h:53
System::IO_COUNTERS::ReadTransferCount
longlong ReadTransferCount
Definition: ProcessDescriptor.h:52
System::QUOTA_LIMITS::MaximumWorkingSetSize
unsigned long MaximumWorkingSetSize
Definition: ProcessDescriptor.h:37
System
Note: OS specific details for environment resolution.
Definition: Debugger.h:19
System::QUOTA_LIMITS::TimeLimit
longlong TimeLimit
Definition: ProcessDescriptor.h:39
System::VM_COUNTERS::PeakPagefileUsage
unsigned long PeakPagefileUsage
Definition: ProcessDescriptor.h:71
System::KERNEL_USER_TIMES::ExitTime
longlong ExitTime
Definition: ProcessDescriptor.h:95
System::IO_COUNTERS
Process I/O Counters NtQueryInformationProcess using ProcessIoCounters.
Definition: ProcessDescriptor.h:45
System::POOLED_USAGE_AND_LIMITS::PagefileUsage
unsigned long PagefileUsage
Definition: ProcessDescriptor.h:85
System::QUOTA_LIMITS::PagefileLimit
unsigned long PagefileLimit
Definition: ProcessDescriptor.h:38
System::VM_COUNTERS::WorkingSetSize
unsigned long WorkingSetSize
Definition: ProcessDescriptor.h:65
System::QUOTA_LIMITS::NonPagedPoolLimit
unsigned long NonPagedPoolLimit
Definition: ProcessDescriptor.h:35
System::POOLED_USAGE_AND_LIMITS::PeakPagedPoolUsage
unsigned long PeakPagedPoolUsage
Definition: ProcessDescriptor.h:78
System::IO_COUNTERS::OtherTransferCount
longlong OtherTransferCount
Definition: ProcessDescriptor.h:54
System::VM_COUNTERS::PeakWorkingSetSize
unsigned long PeakWorkingSetSize
Definition: ProcessDescriptor.h:64
System::VM_COUNTERS::VirtualSize
unsigned long VirtualSize
Definition: ProcessDescriptor.h:62
System::IO_COUNTERS::OtherOperationCount
unsigned long OtherOperationCount
Definition: ProcessDescriptor.h:48
System::POOLED_USAGE_AND_LIMITS::PagedPoolLimit
unsigned long PagedPoolLimit
Definition: ProcessDescriptor.h:80
System::ProcessDescriptor::ProcessHandle::item
long item()
Definition: ProcessDescriptor.h:119
System::PROCESS_BASIC_INFORMATION
Definition: ProcessDescriptor.h:19
System::VM_COUNTERS::PageFaultCount
unsigned long PageFaultCount
Definition: ProcessDescriptor.h:63
System::PROCESS_BASIC_INFORMATION::AffinityMask
unsigned long AffinityMask
Definition: ProcessDescriptor.h:22
__longlong
Definition: Kernel.h:56
System::VM_COUNTERS::QuotaNonPagedPoolUsage
unsigned long QuotaNonPagedPoolUsage
Definition: ProcessDescriptor.h:69
System::POOLED_USAGE_AND_LIMITS::PagefileLimit
unsigned long PagefileLimit
Definition: ProcessDescriptor.h:86
System::IO_COUNTERS::ReadOperationCount
unsigned long ReadOperationCount
Definition: ProcessDescriptor.h:46
System::POOLED_USAGE_AND_LIMITS::NonPagedPoolLimit
unsigned long NonPagedPoolLimit
Definition: ProcessDescriptor.h:83
System::PROCESS_BASIC_INFORMATION::PebBaseAddress
PPEB PebBaseAddress
Definition: ProcessDescriptor.h:21
System::ProcessDescriptor::ProcessHandle
Definition: ProcessDescriptor.h:111
System::VM_COUNTERS::PeakVirtualSize
unsigned long PeakVirtualSize
Definition: ProcessDescriptor.h:61
System::POOLED_USAGE_AND_LIMITS::PeakNonPagedPoolUsage
unsigned long PeakNonPagedPoolUsage
Definition: ProcessDescriptor.h:81
System::PROCESS_BASIC_INFORMATION::BasePriority
long BasePriority
Definition: ProcessDescriptor.h:23
System::PROCESS_BASIC_INFORMATION::InheritedFromUniqueProcessId
unsigned long InheritedFromUniqueProcessId
Definition: ProcessDescriptor.h:25
System::KERNEL_USER_TIMES::KernelTime
longlong KernelTime
Definition: ProcessDescriptor.h:96
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135
System::POOLED_USAGE_AND_LIMITS::PagedPoolUsage
unsigned long PagedPoolUsage
Definition: ProcessDescriptor.h:79
System::QUOTA_LIMITS
Process Quotas NtQueryInformationProcess using ProcessQuotaLimits NtQueryInformationProcess using Pro...
Definition: ProcessDescriptor.h:33
System::PPEB
struct _PEB * PPEB
Basic Process Information NtQueryInformationProcess using ProcessBasicInfo.
Definition: ProcessDescriptor.h:18
System::ProcessDescriptor::ProcessHandle::m_needRelease
bool m_needRelease
Definition: ProcessDescriptor.h:114
System::ProcessDescriptor
Provides access to process information.
Definition: ProcessDescriptor.h:109
System::PROCESS_BASIC_INFORMATION::UniqueProcessId
unsigned long UniqueProcessId
Definition: ProcessDescriptor.h:24
System::VM_COUNTERS
Process Virtual Memory Counters NtQueryInformationProcess using ProcessVmCounters.
Definition: ProcessDescriptor.h:60
System::QUOTA_LIMITS::PagedPoolLimit
unsigned long PagedPoolLimit
Definition: ProcessDescriptor.h:34
System::POOLED_USAGE_AND_LIMITS
Process Pooled Quota Usage and Limits NtQueryInformationProcess using ProcessPooledUsageAndLimits.
Definition: ProcessDescriptor.h:77
System::POOLED_USAGE_AND_LIMITS::PeakPagefileUsage
unsigned long PeakPagefileUsage
Definition: ProcessDescriptor.h:84
System::ProcessDescriptor::ProcessHandle::m_handle
void * m_handle
Definition: ProcessDescriptor.h:113
System::QUOTA_LIMITS::MinimumWorkingSetSize
unsigned long MinimumWorkingSetSize
Definition: ProcessDescriptor.h:36
SystemBase.h
System::IO_COUNTERS::WriteOperationCount
unsigned long WriteOperationCount
Definition: ProcessDescriptor.h:47
System::VM_COUNTERS::QuotaPeakNonPagedPoolUsage
unsigned long QuotaPeakNonPagedPoolUsage
Definition: ProcessDescriptor.h:68
System::POOLED_USAGE_AND_LIMITS::NonPagedPoolUsage
unsigned long NonPagedPoolUsage
Definition: ProcessDescriptor.h:82
System::KERNEL_USER_TIMES::UserTime
longlong UserTime
Definition: ProcessDescriptor.h:97
System::KERNEL_USER_TIMES::CreateTime
longlong CreateTime
Definition: ProcessDescriptor.h:94
System::InfoType
InfoType
Enumeration for fetching information.
Definition: SystemBase.h:19
System::ProcessDescriptor::ProcessHandle::handle
void * handle()
Definition: ProcessDescriptor.h:120
System::ProcessHandle
void * ProcessHandle
Definition of the process handle.
Definition: ModuleInfo.h:33
System::PROCESS_BASIC_INFORMATION::ExitStatus
long ExitStatus
Definition: ProcessDescriptor.h:20
System::VM_COUNTERS::QuotaPagedPoolUsage
unsigned long QuotaPagedPoolUsage
Definition: ProcessDescriptor.h:67