| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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 // Forward declarations
10 class ProcessDescriptor;
12 ProcessDescriptor* getProcess();
13
17 typedef struct _PEB *PPEB;
18 struct PROCESS_BASIC_INFORMATION {
19 long ExitStatus;
20 PPEB PebBaseAddress;
21 unsigned long AffinityMask;
22 long BasePriority;
23 unsigned long UniqueProcessId;
24 unsigned long InheritedFromUniqueProcessId;
25 };
26
32 struct QUOTA_LIMITS {
33 unsigned long PagedPoolLimit;
34 unsigned long NonPagedPoolLimit;
35 unsigned long MinimumWorkingSetSize;
36 unsigned long MaximumWorkingSetSize;
37 unsigned long PagefileLimit;
38 longlong TimeLimit;
39 };
40
44 struct IO_COUNTERS {
45 unsigned long ReadOperationCount;
46 unsigned long WriteOperationCount;
47 unsigned long OtherOperationCount;
48 // longlong ReadOperationCount;
49 // longlong WriteOperationCount;
50 // longlong OtherOperationCount;
51 longlong ReadTransferCount;
52 longlong WriteTransferCount;
53 longlong OtherTransferCount;
54 };
55
59 struct VM_COUNTERS {
60 unsigned long PeakVirtualSize;
61 unsigned long VirtualSize;
62 unsigned long PageFaultCount;
63 unsigned long PeakWorkingSetSize;
64 unsigned long WorkingSetSize;
65 unsigned long QuotaPeakPagedPoolUsage;
66 unsigned long QuotaPagedPoolUsage;
67 unsigned long QuotaPeakNonPagedPoolUsage;
68 unsigned long QuotaNonPagedPoolUsage;
69 unsigned long PagefileUsage;
70 unsigned long PeakPagefileUsage;
71 };
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 class ProcessHandle {
111 void* m_handle;
112 bool m_needRelease;
113 public:
114 ProcessHandle(long pid);
115 virtual ~ProcessHandle();
116 long item() {
117 return m_needRelease ? 1 : 0;
118 }
119 void* handle() {
120 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 }
142 #endif //GAUDIKERNEL_PROCESS_H
System::VM_COUNTERS::QuotaPeakPagedPoolUsage
unsigned long QuotaPeakPagedPoolUsage
Definition: ProcessDescriptor.h:65
System::VM_COUNTERS::PagefileUsage
unsigned long PagefileUsage
Definition: ProcessDescriptor.h:69
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:52
System::IO_COUNTERS::ReadTransferCount
longlong ReadTransferCount
Definition: ProcessDescriptor.h:51
System::QUOTA_LIMITS::MaximumWorkingSetSize
unsigned long MaximumWorkingSetSize
Definition: ProcessDescriptor.h:36
System
Note: OS specific details for environment resolution.
Definition: Debugger.h:19
System::QUOTA_LIMITS::TimeLimit
longlong TimeLimit
Definition: ProcessDescriptor.h:38
System::VM_COUNTERS::PeakPagefileUsage
unsigned long PeakPagefileUsage
Definition: ProcessDescriptor.h:70
System::KERNEL_USER_TIMES::ExitTime
longlong ExitTime
Definition: ProcessDescriptor.h:95
System::IO_COUNTERS
Process I/O Counters NtQueryInformationProcess using ProcessIoCounters.
Definition: ProcessDescriptor.h:44
System::POOLED_USAGE_AND_LIMITS::PagefileUsage
unsigned long PagefileUsage
Definition: ProcessDescriptor.h:85
System::QUOTA_LIMITS::PagefileLimit
unsigned long PagefileLimit
Definition: ProcessDescriptor.h:37
System::VM_COUNTERS::WorkingSetSize
unsigned long WorkingSetSize
Definition: ProcessDescriptor.h:64
System::QUOTA_LIMITS::NonPagedPoolLimit
unsigned long NonPagedPoolLimit
Definition: ProcessDescriptor.h:34
System::POOLED_USAGE_AND_LIMITS::PeakPagedPoolUsage
unsigned long PeakPagedPoolUsage
Definition: ProcessDescriptor.h:78
System::IO_COUNTERS::OtherTransferCount
longlong OtherTransferCount
Definition: ProcessDescriptor.h:53
System::VM_COUNTERS::PeakWorkingSetSize
unsigned long PeakWorkingSetSize
Definition: ProcessDescriptor.h:63
System::VM_COUNTERS::VirtualSize
unsigned long VirtualSize
Definition: ProcessDescriptor.h:61
System::IO_COUNTERS::OtherOperationCount
unsigned long OtherOperationCount
Definition: ProcessDescriptor.h:47
System::POOLED_USAGE_AND_LIMITS::PagedPoolLimit
unsigned long PagedPoolLimit
Definition: ProcessDescriptor.h:80
System::ProcessDescriptor::ProcessHandle::item
long item()
Definition: ProcessDescriptor.h:116
System::PROCESS_BASIC_INFORMATION
Definition: ProcessDescriptor.h:18
System::VM_COUNTERS::PageFaultCount
unsigned long PageFaultCount
Definition: ProcessDescriptor.h:62
System::PROCESS_BASIC_INFORMATION::AffinityMask
unsigned long AffinityMask
Definition: ProcessDescriptor.h:21
__longlong
Definition: Kernel.h:56
System::VM_COUNTERS::QuotaNonPagedPoolUsage
unsigned long QuotaNonPagedPoolUsage
Definition: ProcessDescriptor.h:68
System::POOLED_USAGE_AND_LIMITS::PagefileLimit
unsigned long PagefileLimit
Definition: ProcessDescriptor.h:86
System::IO_COUNTERS::ReadOperationCount
unsigned long ReadOperationCount
Definition: ProcessDescriptor.h:45
System::POOLED_USAGE_AND_LIMITS::NonPagedPoolLimit
unsigned long NonPagedPoolLimit
Definition: ProcessDescriptor.h:83
System::PROCESS_BASIC_INFORMATION::PebBaseAddress
PPEB PebBaseAddress
Definition: ProcessDescriptor.h:20
System::ProcessDescriptor::ProcessHandle
Definition: ProcessDescriptor.h:110
System::VM_COUNTERS::PeakVirtualSize
unsigned long PeakVirtualSize
Definition: ProcessDescriptor.h:60
System::POOLED_USAGE_AND_LIMITS::PeakNonPagedPoolUsage
unsigned long PeakNonPagedPoolUsage
Definition: ProcessDescriptor.h:81
System::PROCESS_BASIC_INFORMATION::BasePriority
long BasePriority
Definition: ProcessDescriptor.h:22
System::PROCESS_BASIC_INFORMATION::InheritedFromUniqueProcessId
unsigned long InheritedFromUniqueProcessId
Definition: ProcessDescriptor.h:24
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:32
System::PPEB
struct _PEB * PPEB
Basic Process Information NtQueryInformationProcess using ProcessBasicInfo.
Definition: ProcessDescriptor.h:17
System::ProcessDescriptor::ProcessHandle::m_needRelease
bool m_needRelease
Definition: ProcessDescriptor.h:112
System::ProcessDescriptor
Provides access to process information.
Definition: ProcessDescriptor.h:109
System::PROCESS_BASIC_INFORMATION::UniqueProcessId
unsigned long UniqueProcessId
Definition: ProcessDescriptor.h:23
System::VM_COUNTERS
Process Virtual Memory Counters NtQueryInformationProcess using ProcessVmCounters.
Definition: ProcessDescriptor.h:59
System::QUOTA_LIMITS::PagedPoolLimit
unsigned long PagedPoolLimit
Definition: ProcessDescriptor.h:33
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:111
System::QUOTA_LIMITS::MinimumWorkingSetSize
unsigned long MinimumWorkingSetSize
Definition: ProcessDescriptor.h:35
SystemBase.h
System::IO_COUNTERS::WriteOperationCount
unsigned long WriteOperationCount
Definition: ProcessDescriptor.h:46
System::VM_COUNTERS::QuotaPeakNonPagedPoolUsage
unsigned long QuotaPeakNonPagedPoolUsage
Definition: ProcessDescriptor.h:67
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:18
System::ProcessDescriptor::ProcessHandle::handle
void * handle()
Definition: ProcessDescriptor.h:119
System::ProcessHandle
void * ProcessHandle
Definition of the process handle.
Definition: ModuleInfo.h:32
System::PROCESS_BASIC_INFORMATION::ExitStatus
long ExitStatus
Definition: ProcessDescriptor.h:19
System::VM_COUNTERS::QuotaPagedPoolUsage
unsigned long QuotaPagedPoolUsage
Definition: ProcessDescriptor.h:66