| The Gaudi Framework v32r1 (f65d50dc)

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 long long TimeLimit;
39 };
40
44 struct IO_COUNTERS {
45 unsigned long ReadOperationCount;
46 unsigned long WriteOperationCount;
47 unsigned long OtherOperationCount;
48 // long long ReadOperationCount;
49 // long long WriteOperationCount;
50 // long long OtherOperationCount;
51 long long ReadTransferCount;
52 long long WriteTransferCount;
53 long long 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
76 struct POOLED_USAGE_AND_LIMITS {
77 unsigned long PeakPagedPoolUsage;
78 unsigned long PagedPoolUsage;
79 unsigned long PagedPoolLimit;
80 unsigned long PeakNonPagedPoolUsage;
81 unsigned long NonPagedPoolUsage;
82 unsigned long NonPagedPoolLimit;
83 unsigned long PeakPagefileUsage;
84 unsigned long PagefileUsage;
85 unsigned long PagefileLimit;
86 };
87
92 struct KERNEL_USER_TIMES {
93 long long CreateTime;
94 long long ExitTime;
95 long long KernelTime;
96 long long UserTime;
97 // long long EllapsedTime; // Added by M.Frank
98 };
99
108 class ProcessDescriptor {
109 class ProcessHandle {
110 void* m_handle;
111 bool m_needRelease;
112
113 public:
114 ProcessHandle( long pid );
115 virtual ~ProcessHandle();
116 long item() { return m_needRelease ? 1 : 0; }
117 void* handle() { return m_handle; }
118 };
119
120 public:
121 ProcessDescriptor();
122 virtual ~ProcessDescriptor();
123 long query( long pid, InfoType info, PROCESS_BASIC_INFORMATION* buffer );
124 long query( long pid, InfoType info, POOLED_USAGE_AND_LIMITS* buffer );
125 long query( long pid, InfoType info, KERNEL_USER_TIMES* buffer );
126 long query( long pid, InfoType info, QUOTA_LIMITS* buffer );
127 long query( long pid, InfoType info, VM_COUNTERS* buffer );
128 long query( long pid, InfoType info, IO_COUNTERS* buffer );
129 long query( long pid, InfoType info, long* buffer );
130 };
131
132 inline ProcessDescriptor* getProcess() {
133 static ProcessDescriptor p;
134 return &p;
135 }
136 } // namespace System
137 #endif // GAUDIKERNEL_PROCESS_H
System::KERNEL_USER_TIMES::KernelTime
long long KernelTime
Definition: ProcessDescriptor.h:95
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:92
Kernel.h
System::QUOTA_LIMITS::MaximumWorkingSetSize
unsigned long MaximumWorkingSetSize
Definition: ProcessDescriptor.h:36
System
Note: OS specific details for environment resolution.
Definition: Debugger.h:19
System::VM_COUNTERS::PeakPagefileUsage
unsigned long PeakPagefileUsage
Definition: ProcessDescriptor.h:70
System::ProcessDescriptor::ProcessHandle::ProcessHandle
ProcessHandle(long pid)
Definition: ProcessDescriptor.cpp:353
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:84
System::QUOTA_LIMITS::PagefileLimit
unsigned long PagefileLimit
Definition: ProcessDescriptor.h:37
System::KERNEL_USER_TIMES::UserTime
long long UserTime
Definition: ProcessDescriptor.h:96
System::ProcessDescriptor::ProcessDescriptor
ProcessDescriptor()
Definition: ProcessDescriptor.cpp:380
System::VM_COUNTERS::WorkingSetSize
unsigned long WorkingSetSize
Definition: ProcessDescriptor.h:64
System::QUOTA_LIMITS::NonPagedPoolLimit
unsigned long NonPagedPoolLimit
Definition: ProcessDescriptor.h:34
System::ProcessDescriptor::ProcessHandle::~ProcessHandle
virtual ~ProcessHandle()
Definition: ProcessDescriptor.cpp:370
System::POOLED_USAGE_AND_LIMITS::PeakPagedPoolUsage
unsigned long PeakPagedPoolUsage
Definition: ProcessDescriptor.h:77
System::IO_COUNTERS::OtherTransferCount
long long 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:79
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
System::VM_COUNTERS::QuotaNonPagedPoolUsage
unsigned long QuotaNonPagedPoolUsage
Definition: ProcessDescriptor.h:68
System::POOLED_USAGE_AND_LIMITS::PagefileLimit
unsigned long PagefileLimit
Definition: ProcessDescriptor.h:85
System::IO_COUNTERS::ReadOperationCount
unsigned long ReadOperationCount
Definition: ProcessDescriptor.h:45
System::KERNEL_USER_TIMES::ExitTime
long long ExitTime
Definition: ProcessDescriptor.h:94
System::POOLED_USAGE_AND_LIMITS::NonPagedPoolLimit
unsigned long NonPagedPoolLimit
Definition: ProcessDescriptor.h:82
System::PROCESS_BASIC_INFORMATION::PebBaseAddress
PPEB PebBaseAddress
Definition: ProcessDescriptor.h:20
System::ProcessDescriptor::ProcessHandle
Definition: ProcessDescriptor.h:109
System::KERNEL_USER_TIMES::CreateTime
long long CreateTime
Definition: ProcessDescriptor.h:93
System::QUOTA_LIMITS::TimeLimit
long long TimeLimit
Definition: ProcessDescriptor.h:38
System::IO_COUNTERS::WriteTransferCount
long long WriteTransferCount
Definition: ProcessDescriptor.h:52
System::VM_COUNTERS::PeakVirtualSize
unsigned long PeakVirtualSize
Definition: ProcessDescriptor.h:60
System::POOLED_USAGE_AND_LIMITS::PeakNonPagedPoolUsage
unsigned long PeakNonPagedPoolUsage
Definition: ProcessDescriptor.h:80
System::PROCESS_BASIC_INFORMATION::BasePriority
long BasePriority
Definition: ProcessDescriptor.h:22
System::PROCESS_BASIC_INFORMATION::InheritedFromUniqueProcessId
unsigned long InheritedFromUniqueProcessId
Definition: ProcessDescriptor.h:24
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:132
System::POOLED_USAGE_AND_LIMITS::PagedPoolUsage
unsigned long PagedPoolUsage
Definition: ProcessDescriptor.h:78
System::QUOTA_LIMITS
Process Quotas NtQueryInformationProcess using ProcessQuotaLimits NtQueryInformationProcess using Pro...
Definition: ProcessDescriptor.h:32
System::ProcessDescriptor::query
long query(long pid, InfoType info, PROCESS_BASIC_INFORMATION *buffer)
Definition: ProcessDescriptor.cpp:584
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:111
System::ProcessDescriptor
Provides access to process information.
Definition: ProcessDescriptor.h:108
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:76
System::POOLED_USAGE_AND_LIMITS::PeakPagefileUsage
unsigned long PeakPagefileUsage
Definition: ProcessDescriptor.h:83
System::ProcessDescriptor::ProcessHandle::m_handle
void * m_handle
Definition: ProcessDescriptor.h:110
System::QUOTA_LIMITS::MinimumWorkingSetSize
unsigned long MinimumWorkingSetSize
Definition: ProcessDescriptor.h:35
System::ProcessDescriptor::~ProcessDescriptor
virtual ~ProcessDescriptor()
Definition: ProcessDescriptor.cpp:394
SystemBase.h
System::IO_COUNTERS::WriteOperationCount
unsigned long WriteOperationCount
Definition: ProcessDescriptor.h:46
System::IO_COUNTERS::ReadTransferCount
long long ReadTransferCount
Definition: ProcessDescriptor.h:51
System::VM_COUNTERS::QuotaPeakNonPagedPoolUsage
unsigned long QuotaPeakNonPagedPoolUsage
Definition: ProcessDescriptor.h:67
System::POOLED_USAGE_AND_LIMITS::NonPagedPoolUsage
unsigned long NonPagedPoolUsage
Definition: ProcessDescriptor.h:81
System::InfoType
InfoType
Enumeration for fetching information.
Definition: SystemBase.h:18
System::ProcessDescriptor::ProcessHandle::handle
void * handle()
Definition: ProcessDescriptor.h:117
System::PROCESS_BASIC_INFORMATION::ExitStatus
long ExitStatus
Definition: ProcessDescriptor.h:19
System::VM_COUNTERS::QuotaPagedPoolUsage
unsigned long QuotaPagedPoolUsage
Definition: ProcessDescriptor.h:66