The Gaudi Framework  v33r1 (b1225454)
ProcessDescriptor.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 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 #ifndef GAUDIKERNEL_PROCESS_H
12 #define GAUDIKERNEL_PROCESS_H
13 
14 // Framework include files
15 #include "GaudiKernel/Kernel.h"
16 #include "GaudiKernel/SystemBase.h"
17 
18 namespace System {
19  // Forward declarations
20  class ProcessDescriptor;
22  ProcessDescriptor* getProcess();
23 
27  typedef struct _PEB* PPEB;
29  long ExitStatus;
31  unsigned long AffinityMask;
33  unsigned long UniqueProcessId;
35  };
36 
42  struct QUOTA_LIMITS {
43  unsigned long PagedPoolLimit;
44  unsigned long NonPagedPoolLimit;
45  unsigned long MinimumWorkingSetSize;
46  unsigned long MaximumWorkingSetSize;
47  unsigned long PagefileLimit;
48  long long TimeLimit;
49  };
50 
54  struct IO_COUNTERS {
55  unsigned long ReadOperationCount;
56  unsigned long WriteOperationCount;
57  unsigned long OtherOperationCount;
58  // long long ReadOperationCount;
59  // long long WriteOperationCount;
60  // long long OtherOperationCount;
61  long long ReadTransferCount;
62  long long WriteTransferCount;
63  long long OtherTransferCount;
64  };
65 
69  struct VM_COUNTERS {
70  unsigned long PeakVirtualSize;
71  unsigned long VirtualSize;
72  unsigned long PageFaultCount;
73  unsigned long PeakWorkingSetSize;
74  unsigned long WorkingSetSize;
75  unsigned long QuotaPeakPagedPoolUsage;
76  unsigned long QuotaPagedPoolUsage;
78  unsigned long QuotaNonPagedPoolUsage;
79  unsigned long PagefileUsage;
80  unsigned long PeakPagefileUsage;
81  };
82 
87  unsigned long PeakPagedPoolUsage;
88  unsigned long PagedPoolUsage;
89  unsigned long PagedPoolLimit;
90  unsigned long PeakNonPagedPoolUsage;
91  unsigned long NonPagedPoolUsage;
92  unsigned long NonPagedPoolLimit;
93  unsigned long PeakPagefileUsage;
94  unsigned long PagefileUsage;
95  unsigned long PagefileLimit;
96  };
97 
103  long long CreateTime;
104  long long ExitTime;
105  long long KernelTime;
106  long long UserTime;
107  // long long EllapsedTime; // Added by M.Frank
108  };
109 
120  void* m_handle;
122 
123  public:
124  ProcessHandle( long pid );
125  virtual ~ProcessHandle();
126  long item() { return m_needRelease ? 1 : 0; }
127  void* handle() { return m_handle; }
128  };
129 
130  public:
132  virtual ~ProcessDescriptor();
133  long query( long pid, InfoType info, PROCESS_BASIC_INFORMATION* buffer );
134  long query( long pid, InfoType info, POOLED_USAGE_AND_LIMITS* buffer );
135  long query( long pid, InfoType info, KERNEL_USER_TIMES* buffer );
136  long query( long pid, InfoType info, QUOTA_LIMITS* buffer );
137  long query( long pid, InfoType info, VM_COUNTERS* buffer );
138  long query( long pid, InfoType info, IO_COUNTERS* buffer );
139  long query( long pid, InfoType info, long* buffer );
140  };
141 
143  static ProcessDescriptor p;
144  return &p;
145  }
146 } // namespace System
147 #endif // GAUDIKERNEL_PROCESS_H
unsigned long QuotaPeakPagedPoolUsage
unsigned long PagefileUsage
Process/Thread System and User Time NtQueryInformationProcess using ProcessTimes NtQueryInformationTh...
unsigned long MaximumWorkingSetSize
Note: OS specific details for environment resolution.
Definition: Debugger.h:29
unsigned long PeakPagefileUsage
Process I/O Counters NtQueryInformationProcess using ProcessIoCounters.
unsigned long PagefileLimit
unsigned long WorkingSetSize
unsigned long NonPagedPoolLimit
unsigned long PeakWorkingSetSize
unsigned long VirtualSize
unsigned long OtherOperationCount
unsigned long PageFaultCount
unsigned long QuotaNonPagedPoolUsage
unsigned long ReadOperationCount
unsigned long PeakVirtualSize
ProcessDescriptor * getProcess()
Retrieve Process structure.
Process Quotas NtQueryInformationProcess using ProcessQuotaLimits NtQueryInformationProcess using Pro...
long query(long pid, InfoType info, PROCESS_BASIC_INFORMATION *buffer)
struct _PEB * PPEB
Basic Process Information NtQueryInformationProcess using ProcessBasicInfo.
Provides access to process information.
Process Virtual Memory Counters NtQueryInformationProcess using ProcessVmCounters.
unsigned long PagedPoolLimit
Process Pooled Quota Usage and Limits NtQueryInformationProcess using ProcessPooledUsageAndLimits.
unsigned long MinimumWorkingSetSize
unsigned long WriteOperationCount
unsigned long QuotaPeakNonPagedPoolUsage
InfoType
Enumeration for fetching information.
Definition: SystemBase.h:28
unsigned long QuotaPagedPoolUsage