The Gaudi Framework
master (1a7a3838)
Toggle main menu visibility
Loading...
Searching...
No Matches
ProcessDescriptor.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
// Framework include files
14
#include <
GaudiKernel/Kernel.h
>
15
#include <
GaudiKernel/SystemBase.h
>
16
17
namespace
System
{
18
// Forward declarations
19
class
ProcessDescriptor
;
21
ProcessDescriptor
*
getProcess
();
22
26
typedef
struct
_PEB*
PPEB
;
27
struct
PROCESS_BASIC_INFORMATION
{
28
long
ExitStatus
;
29
PPEB
PebBaseAddress
;
30
unsigned
long
AffinityMask
;
31
long
BasePriority
;
32
unsigned
long
UniqueProcessId
;
33
unsigned
long
InheritedFromUniqueProcessId
;
34
};
35
41
struct
QUOTA_LIMITS
{
42
unsigned
long
PagedPoolLimit
;
43
unsigned
long
NonPagedPoolLimit
;
44
unsigned
long
MinimumWorkingSetSize
;
45
unsigned
long
MaximumWorkingSetSize
;
46
unsigned
long
PagefileLimit
;
47
long
long
TimeLimit
;
48
};
49
53
struct
IO_COUNTERS
{
54
unsigned
long
ReadOperationCount
;
55
unsigned
long
WriteOperationCount
;
56
unsigned
long
OtherOperationCount
;
57
// long long ReadOperationCount;
58
// long long WriteOperationCount;
59
// long long OtherOperationCount;
60
long
long
ReadTransferCount
;
61
long
long
WriteTransferCount
;
62
long
long
OtherTransferCount
;
63
};
64
68
struct
VM_COUNTERS
{
69
unsigned
long
PeakVirtualSize
;
70
unsigned
long
VirtualSize
;
71
unsigned
long
PageFaultCount
;
72
unsigned
long
PeakWorkingSetSize
;
73
unsigned
long
WorkingSetSize
;
74
unsigned
long
QuotaPeakPagedPoolUsage
;
75
unsigned
long
QuotaPagedPoolUsage
;
76
unsigned
long
QuotaPeakNonPagedPoolUsage
;
77
unsigned
long
QuotaNonPagedPoolUsage
;
78
unsigned
long
PagefileUsage
;
79
unsigned
long
PeakPagefileUsage
;
80
};
81
85
struct
POOLED_USAGE_AND_LIMITS
{
86
unsigned
long
PeakPagedPoolUsage
;
87
unsigned
long
PagedPoolUsage
;
88
unsigned
long
PagedPoolLimit
;
89
unsigned
long
PeakNonPagedPoolUsage
;
90
unsigned
long
NonPagedPoolUsage
;
91
unsigned
long
NonPagedPoolLimit
;
92
unsigned
long
PeakPagefileUsage
;
93
unsigned
long
PagefileUsage
;
94
unsigned
long
PagefileLimit
;
95
};
96
101
struct
KERNEL_USER_TIMES
{
102
long
long
CreateTime
;
103
long
long
ExitTime
;
104
long
long
KernelTime
;
105
long
long
UserTime
;
106
// long long EllapsedTime; // Added by M.Frank
107
};
108
117
class
ProcessDescriptor
{
118
class
ProcessHandle
{
119
void
*
m_handle
;
120
bool
m_needRelease
;
121
122
public
:
123
ProcessHandle
(
long
pid );
124
virtual
~ProcessHandle
();
125
long
item
() {
return
m_needRelease
? 1 : 0; }
126
void
*
handle
() {
return
m_handle
; }
127
};
128
129
public
:
130
ProcessDescriptor
() =
default
;
131
virtual
~ProcessDescriptor
() =
default
;
132
long
query
(
long
pid,
InfoType
fetch,
PROCESS_BASIC_INFORMATION
* info );
133
long
query
(
long
pid,
InfoType
fetch,
POOLED_USAGE_AND_LIMITS
* info );
134
long
query
(
long
pid,
InfoType
fetch,
KERNEL_USER_TIMES
* info );
135
long
query
(
long
pid,
InfoType
fetch,
QUOTA_LIMITS
* info );
136
long
query
(
long
pid,
InfoType
fetch,
VM_COUNTERS
* info );
137
long
query
(
long
pid,
InfoType
fetch,
IO_COUNTERS
* info );
138
long
query
(
long
pid,
InfoType
fetch,
long
* info );
139
};
140
141
inline
ProcessDescriptor
*
getProcess
() {
142
static
ProcessDescriptor
p;
143
return
&p;
144
}
145
}
// namespace System
Kernel.h
SystemBase.h
System::ProcessDescriptor::ProcessHandle::~ProcessHandle
virtual ~ProcessHandle()
Definition
ProcessDescriptor.cpp:344
System::ProcessDescriptor::ProcessHandle::handle
void * handle()
Definition
ProcessDescriptor.h:126
System::ProcessDescriptor::ProcessHandle::m_needRelease
bool m_needRelease
Definition
ProcessDescriptor.h:120
System::ProcessDescriptor::ProcessHandle::m_handle
void * m_handle
Definition
ProcessDescriptor.h:119
System::ProcessDescriptor::ProcessHandle::ProcessHandle
ProcessHandle(long pid)
Definition
ProcessDescriptor.cpp:331
System::ProcessDescriptor::ProcessHandle::item
long item()
Definition
ProcessDescriptor.h:125
System::ProcessDescriptor
Provides access to process information.
Definition
ProcessDescriptor.h:117
System::ProcessDescriptor::ProcessDescriptor
ProcessDescriptor()=default
System::ProcessDescriptor::query
long query(long pid, InfoType fetch, PROCESS_BASIC_INFORMATION *info)
Definition
ProcessDescriptor.cpp:548
System::ProcessDescriptor::~ProcessDescriptor
virtual ~ProcessDescriptor()=default
System
Note: OS specific details for environment resolution.
Definition
Environment.h:25
System::InfoType
InfoType
Enumeration for fetching information.
Definition
SystemBase.h:15
System::PPEB
struct _PEB * PPEB
Basic Process Information NtQueryInformationProcess using ProcessBasicInfo.
Definition
ProcessDescriptor.h:26
System::ProcessHandle
void * ProcessHandle
Definition of the process handle.
Definition
ModuleInfo.h:27
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition
ProcessDescriptor.h:141
System::IO_COUNTERS
Process I/O Counters NtQueryInformationProcess using ProcessIoCounters.
Definition
ProcessDescriptor.h:53
System::IO_COUNTERS::WriteOperationCount
unsigned long WriteOperationCount
Definition
ProcessDescriptor.h:55
System::IO_COUNTERS::OtherOperationCount
unsigned long OtherOperationCount
Definition
ProcessDescriptor.h:56
System::IO_COUNTERS::WriteTransferCount
long long WriteTransferCount
Definition
ProcessDescriptor.h:61
System::IO_COUNTERS::OtherTransferCount
long long OtherTransferCount
Definition
ProcessDescriptor.h:62
System::IO_COUNTERS::ReadOperationCount
unsigned long ReadOperationCount
Definition
ProcessDescriptor.h:54
System::IO_COUNTERS::ReadTransferCount
long long ReadTransferCount
Definition
ProcessDescriptor.h:60
System::KERNEL_USER_TIMES
Process/Thread System and User Time NtQueryInformationProcess using ProcessTimes NtQueryInformationTh...
Definition
ProcessDescriptor.h:101
System::KERNEL_USER_TIMES::UserTime
long long UserTime
Definition
ProcessDescriptor.h:105
System::KERNEL_USER_TIMES::ExitTime
long long ExitTime
Definition
ProcessDescriptor.h:103
System::KERNEL_USER_TIMES::CreateTime
long long CreateTime
Definition
ProcessDescriptor.h:102
System::KERNEL_USER_TIMES::KernelTime
long long KernelTime
Definition
ProcessDescriptor.h:104
System::POOLED_USAGE_AND_LIMITS
Process Pooled Quota Usage and Limits NtQueryInformationProcess using ProcessPooledUsageAndLimits.
Definition
ProcessDescriptor.h:85
System::POOLED_USAGE_AND_LIMITS::PagefileUsage
unsigned long PagefileUsage
Definition
ProcessDescriptor.h:93
System::POOLED_USAGE_AND_LIMITS::PeakNonPagedPoolUsage
unsigned long PeakNonPagedPoolUsage
Definition
ProcessDescriptor.h:89
System::POOLED_USAGE_AND_LIMITS::NonPagedPoolLimit
unsigned long NonPagedPoolLimit
Definition
ProcessDescriptor.h:91
System::POOLED_USAGE_AND_LIMITS::PagedPoolUsage
unsigned long PagedPoolUsage
Definition
ProcessDescriptor.h:87
System::POOLED_USAGE_AND_LIMITS::PeakPagefileUsage
unsigned long PeakPagefileUsage
Definition
ProcessDescriptor.h:92
System::POOLED_USAGE_AND_LIMITS::PagefileLimit
unsigned long PagefileLimit
Definition
ProcessDescriptor.h:94
System::POOLED_USAGE_AND_LIMITS::PeakPagedPoolUsage
unsigned long PeakPagedPoolUsage
Definition
ProcessDescriptor.h:86
System::POOLED_USAGE_AND_LIMITS::NonPagedPoolUsage
unsigned long NonPagedPoolUsage
Definition
ProcessDescriptor.h:90
System::POOLED_USAGE_AND_LIMITS::PagedPoolLimit
unsigned long PagedPoolLimit
Definition
ProcessDescriptor.h:88
System::PROCESS_BASIC_INFORMATION
Definition
ProcessDescriptor.h:27
System::PROCESS_BASIC_INFORMATION::AffinityMask
unsigned long AffinityMask
Definition
ProcessDescriptor.h:30
System::PROCESS_BASIC_INFORMATION::PebBaseAddress
PPEB PebBaseAddress
Definition
ProcessDescriptor.h:29
System::PROCESS_BASIC_INFORMATION::ExitStatus
long ExitStatus
Definition
ProcessDescriptor.h:28
System::PROCESS_BASIC_INFORMATION::InheritedFromUniqueProcessId
unsigned long InheritedFromUniqueProcessId
Definition
ProcessDescriptor.h:33
System::PROCESS_BASIC_INFORMATION::BasePriority
long BasePriority
Definition
ProcessDescriptor.h:31
System::PROCESS_BASIC_INFORMATION::UniqueProcessId
unsigned long UniqueProcessId
Definition
ProcessDescriptor.h:32
System::QUOTA_LIMITS
Process Quotas NtQueryInformationProcess using ProcessQuotaLimits NtQueryInformationProcess using Pro...
Definition
ProcessDescriptor.h:41
System::QUOTA_LIMITS::PagedPoolLimit
unsigned long PagedPoolLimit
Definition
ProcessDescriptor.h:42
System::QUOTA_LIMITS::MaximumWorkingSetSize
unsigned long MaximumWorkingSetSize
Definition
ProcessDescriptor.h:45
System::QUOTA_LIMITS::MinimumWorkingSetSize
unsigned long MinimumWorkingSetSize
Definition
ProcessDescriptor.h:44
System::QUOTA_LIMITS::NonPagedPoolLimit
unsigned long NonPagedPoolLimit
Definition
ProcessDescriptor.h:43
System::QUOTA_LIMITS::PagefileLimit
unsigned long PagefileLimit
Definition
ProcessDescriptor.h:46
System::QUOTA_LIMITS::TimeLimit
long long TimeLimit
Definition
ProcessDescriptor.h:47
System::VM_COUNTERS
Process Virtual Memory Counters NtQueryInformationProcess using ProcessVmCounters.
Definition
ProcessDescriptor.h:68
System::VM_COUNTERS::PeakPagefileUsage
unsigned long PeakPagefileUsage
Definition
ProcessDescriptor.h:79
System::VM_COUNTERS::QuotaPeakNonPagedPoolUsage
unsigned long QuotaPeakNonPagedPoolUsage
Definition
ProcessDescriptor.h:76
System::VM_COUNTERS::QuotaNonPagedPoolUsage
unsigned long QuotaNonPagedPoolUsage
Definition
ProcessDescriptor.h:77
System::VM_COUNTERS::PeakWorkingSetSize
unsigned long PeakWorkingSetSize
Definition
ProcessDescriptor.h:72
System::VM_COUNTERS::QuotaPagedPoolUsage
unsigned long QuotaPagedPoolUsage
Definition
ProcessDescriptor.h:75
System::VM_COUNTERS::VirtualSize
unsigned long VirtualSize
Definition
ProcessDescriptor.h:70
System::VM_COUNTERS::PagefileUsage
unsigned long PagefileUsage
Definition
ProcessDescriptor.h:78
System::VM_COUNTERS::WorkingSetSize
unsigned long WorkingSetSize
Definition
ProcessDescriptor.h:73
System::VM_COUNTERS::PageFaultCount
unsigned long PageFaultCount
Definition
ProcessDescriptor.h:71
System::VM_COUNTERS::PeakVirtualSize
unsigned long PeakVirtualSize
Definition
ProcessDescriptor.h:69
System::VM_COUNTERS::QuotaPeakPagedPoolUsage
unsigned long QuotaPeakPagedPoolUsage
Definition
ProcessDescriptor.h:74
GaudiKernel
src
Lib
ProcessDescriptor.h
Generated on
for The Gaudi Framework by
1.17.0