The Gaudi Framework  master (82fdf313)
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>
16
17namespace System {
18 // Forward declarations
22
26 typedef struct _PEB* PPEB;
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;
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;
75 unsigned long QuotaPagedPoolUsage;
78 unsigned long PagefileUsage;
79 unsigned long PeakPagefileUsage;
80 };
81
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
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
119 void* m_handle;
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
142 static ProcessDescriptor p;
143 return &p;
144 }
145} // namespace System
Provides access to process information.
long query(long pid, InfoType fetch, PROCESS_BASIC_INFORMATION *info)
virtual ~ProcessDescriptor()=default
Note: OS specific details for environment resolution.
Definition Environment.h:25
InfoType
Enumeration for fetching information.
Definition SystemBase.h:15
struct _PEB * PPEB
Basic Process Information NtQueryInformationProcess using ProcessBasicInfo.
void * ProcessHandle
Definition of the process handle.
Definition ModuleInfo.h:27
ProcessDescriptor * getProcess()
Retrieve Process structure.
Process I/O Counters NtQueryInformationProcess using ProcessIoCounters.
unsigned long WriteOperationCount
unsigned long OtherOperationCount
unsigned long ReadOperationCount
Process/Thread System and User Time NtQueryInformationProcess using ProcessTimes NtQueryInformationTh...
Process Pooled Quota Usage and Limits NtQueryInformationProcess using ProcessPooledUsageAndLimits.
Process Quotas NtQueryInformationProcess using ProcessQuotaLimits NtQueryInformationProcess using Pro...
unsigned long PagedPoolLimit
unsigned long MaximumWorkingSetSize
unsigned long MinimumWorkingSetSize
unsigned long NonPagedPoolLimit
unsigned long PagefileLimit
Process Virtual Memory Counters NtQueryInformationProcess using ProcessVmCounters.
unsigned long PeakPagefileUsage
unsigned long QuotaPeakNonPagedPoolUsage
unsigned long QuotaNonPagedPoolUsage
unsigned long PeakWorkingSetSize
unsigned long QuotaPagedPoolUsage
unsigned long VirtualSize
unsigned long PagefileUsage
unsigned long WorkingSetSize
unsigned long PageFaultCount
unsigned long PeakVirtualSize
unsigned long QuotaPeakPagedPoolUsage