The Gaudi Framework  master (69a68366)
Loading...
Searching...
No Matches
ProcessDescriptor.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2026 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 __APPLE__
12static const long TICK_TO_100NSEC = 100000;
13#endif // not __APPLE__
14
15namespace System {
43}
44
45#include <cstdio>
46#include <errno.h>
47#include <fcntl.h>
48#include <iostream>
49#include <libgen.h>
50#include <sstream>
51#include <string>
52#include <sys/signal.h>
53#include <sys/syscall.h>
54#include <sys/times.h>
55#include <sys/types.h>
56#include <unistd.h>
57#ifndef __APPLE__
58# include <sys/procfs.h>
59#else
60# include <mach/mach.h>
61# include <mach/task_info.h>
62# include <sys/resource.h>
63# include <sys/time.h>
64#endif
65#include <cstdio>
66#include <sys/resource.h>
67#include <sys/time.h>
68
69/* Format of the Linux proc/stat (man 5 proc, kernel 2.6.35):
70 pid %d The process ID.
71
72 comm %s The filename of the executable, in parentheses. This is visible
73 whether or not the executable is swapped out.
74
75 state %c One character from the string "RSDZTW" where R is running, S is
76 sleeping in an interruptible wait, D is waiting in uninterruptible
77 disk sleep, Z is zombie, T is traced or stopped (on a signal), and
78 W is paging.
79
80 ppid %d The PID of the parent.
81
82 pgrp %d The process group ID of the process.
83
84 session %d The session ID of the process.
85
86 tty_nr %d The controlling terminal of the process. (The minor device number
87 is contained in the combination of bits 31 to 20 and 7 to 0; the
88 major device number is in bits 15 t0 8.)
89
90 tpgid %d The ID of the foreground process group of the controlling terminal
91 of the process.
92
93 flags %u (%lu before Linux 2.6.22)
94 The kernel flags word of the process. For bit meanings, see the
95 PF_* defines in <linux/sched.h>. Details depend on the kernel
96 version.
97
98 minflt %lu The number of minor faults the process has made which have not
99 required loading a memory page from disk.
100
101 cminflt %lu The number of minor faults that the process's waited-for children
102 have made.
103
104 majflt %lu The number of major faults the process has made which have
105 required loading a memory page from disk.
106
107 cmajflt %lu The number of major faults that the process's waited-for children
108 have made.
109
110 utime %lu Amount of time that this process has been scheduled in user mode,
111 measured in clock ticks (divide by sysconf(_SC_CLK_TCK). This
112 includes guest time, guest_time (time spent running a virtual CPU,
113 see below), so that applications that are not aware of the guest
114 time field do not lose that time from their calculations.
115
116 stime %lu Amount of time that this process has been scheduled in kernel
117 mode, measured in clock ticks (divide by sysconf(_SC_CLK_TCK).
118
119 cutime %ld Amount of time that this process's waited-for children have been
120 scheduled in user mode, measured in clock ticks (divide by
121 sysconf(_SC_CLK_TCK). (See also times(2).) This includes guest
122 time, cguest_time (time spent running a virtual CPU, see below).
123
124 cstime %ld Amount of time that this process's waited-for children have been
125 scheduled in kernel mode, measured in clock ticks (divide by
126 sysconf(_SC_CLK_TCK).
127
128 priority %ld
129 (Explanation for Linux 2.6) For processes running a real-time
130 scheduling policy (policy below; see sched_setscheduler(2)), this
131 is the negated scheduling priority, minus one; that is, a number
132 in the range -2 to -100, corresponding to real-time priorities 1
133 to 99. For processes running under a non-real-time scheduling
134 policy, this is the raw nice value (setpriority(2)) as represented
135 in the kernel. The kernel stores nice values as numbers in the
136 range 0 (high) to 39 (low), corresponding to the user-visible nice
137 range of -20 to 19.
138
139 Before Linux 2.6, this was a scaled value based on the scheduler
140 weighting given to this process.
141
142 nice %ld The nice value (see setpriority(2)), a value in the range 19 (low
143 priority) to -20 (high priority).
144
145 num_threads %ld
146 Number of threads in this process (since Linux 2.6). Before ker‐
147 nel 2.6, this field was hard coded to 0 as a placeholder for an
148 earlier removed field.
149
150 itrealvalue %ld
151 The time in jiffies before the next SIGALRM is sent to the process
152 due to an interval timer. Since kernel 2.6.17, this field is no
153 longer maintained, and is hard coded as 0.
154
155 starttime %llu (was %lu before Linux 2.6)
156 The time in jiffies the process started after system boot.
157
158 vsize %lu Virtual memory size in bytes.
159
160 rss %ld Resident Set Size: number of pages the process has in real memory.
161 This is just the pages which count towards text, data, or stack
162 space. This does not include pages which have not been demand-
163 loaded in, or which are swapped out.
164
165 rsslim %lu Current soft limit in bytes on the rss of the process; see the
166 description of RLIMIT_RSS in getpriority(2).
167
168 startcode %lu
169 The address above which program text can run.
170
171 endcode %lu The address below which program text can run.
172
173 startstack %lu
174 The address of the start (i.e., bottom) of the stack.
175
176 kstkesp %lu The current value of ESP (stack pointer), as found in the kernel
177 stack page for the process.
178
179 kstkeip %lu The current EIP (instruction pointer).
180
181 signal %lu The bitmap of pending signals, displayed as a decimal number.
182 Obsolete, because it does not provide information on real-time
183 signals; use /proc/[pid]/status instead.
184
185 blocked %lu The bitmap of blocked signals, displayed as a decimal number.
186 Obsolete, because it does not provide information on real-time
187 signals; use /proc/[pid]/status instead.
188
189 sigignore %lu
190 The bitmap of ignored signals, displayed as a decimal number.
191 Obsolete, because it does not provide information on real-time
192 signals; use /proc/[pid]/status instead.
193
194 sigcatch %lu
195 The bitmap of caught signals, displayed as a decimal number.
196 Obsolete, because it does not provide information on real-time
197 signals; use /proc/[pid]/status instead.
198
199 wchan %lu This is the "channel" in which the process is waiting. It is the
200 address of a system call, and can be looked up in a namelist if
201 you need a textual name. (If you have an up-to-date
202 /etc/psdatabase, then try ps -l to see the WCHAN field in action.)
203
204 nswap %lu Number of pages swapped (not maintained).
205
206 cnswap %lu Cumulative nswap for child processes (not maintained).
207
208 exit_signal %d (since Linux 2.1.22)
209 Signal to be sent to parent when we die.
210
211 processor %d (since Linux 2.2.8)
212 CPU number last executed on.
213
214 rt_priority %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
215 Real-time scheduling priority, a number in the range 1 to 99 for
216 processes scheduled under a real-time policy, or 0, for non-real-
217 time processes (see sched_setscheduler(2)).
218
219 policy %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
220 Scheduling policy (see sched_setscheduler(2)). Decode using the
221 SCHED_* constants in linux/sched.h.
222
223 delayacct_blkio_ticks %llu (since Linux 2.6.18)
224 Aggregated block I/O delays, measured in clock ticks (centisec‐
225 onds).
226
227 guest_time %lu (since Linux 2.6.24)
228 Guest time of the process (time spent running a virtual CPU for a
229 guest operating system), measured in clock ticks (divide by
230 sysconf(_SC_CLK_TCK).
231
232 cguest_time %ld (since Linux 2.6.24)
233 Guest time of the process's children, measured in clock ticks
234 (divide by sysconf(_SC_CLK_TCK).
235*/
237 int pid;
238 char comm[400];
239 char state;
240 int ppid;
241 int pgrp;
243 int tty;
244 int tpgid;
245 unsigned long flags;
246 unsigned long minflt;
247 unsigned long cminflt;
248 unsigned long majflt;
249 unsigned long cmajflt;
250 unsigned long utime;
251 unsigned long stime;
252 long cutime;
253 long cstime;
255 long nice;
258 unsigned long long starttime;
259 unsigned long vsize;
260 long rss;
261 unsigned long rlim;
262 unsigned long startcode;
263 unsigned long endcode;
264 unsigned long startstack;
265 unsigned long kstkesp;
266 unsigned long kstkeip;
267 unsigned long signal;
268 unsigned long blocked;
269 unsigned long sigignore;
270 unsigned long sigcatch;
271 unsigned long wchan;
272};
273
274#ifdef __APPLE__
275// static long pg_size = 0;
276#else
277static long pg_size = sysconf( _SC_PAGESIZE ); // getpagesize();
278#endif
279void readProcStat( long pid, linux_proc& pinfo ) {
280
281 ssize_t cnt;
282 int fd;
283 char buf[512];
284
285 std::ostringstream ost;
286
287 ost << "/proc/" << pid << "/stat";
288 std::string fname = ost.str();
289 if ( ( fd = open( fname.c_str(), O_RDONLY ) ) < 0 ) {
290 std::cerr << "Failed to open " << ost.str() << std::endl;
291 return;
292 }
293
294 lseek( fd, 0, SEEK_SET );
295 if ( ( cnt = read( fd, buf, sizeof( buf ) - 1 ) ) < 0 ) {
296 std::cout << "LINUX Read of Proc file failed:" << std::endl;
297 close( fd );
298 return;
299 }
300
301 // Format
302 if ( cnt > 0 ) {
303 buf[cnt] = '\0';
304 sscanf(
305 buf,
306 // 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 20 1 2 3 4 5 6 7 8 9
307 // 30 1 2 3 4 5
308 "%d %400s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %llu %lu %ld %lu %lu %lu %lu "
309 "%lu %lu %lu %lu %lu %lu %lu",
310 &pinfo.pid, pinfo.comm, &pinfo.state, &pinfo.ppid, &pinfo.pgrp, &pinfo.session, &pinfo.tty, &pinfo.tpgid,
311 &pinfo.flags, &pinfo.minflt, &pinfo.cminflt, &pinfo.majflt, &pinfo.cmajflt, &pinfo.utime, &pinfo.stime,
312 &pinfo.cutime, &pinfo.cstime, &pinfo.priority, &pinfo.nice, &pinfo.num_threads, &pinfo.itrealvalue,
313 &pinfo.starttime, &pinfo.vsize, &pinfo.rss, &pinfo.rlim, &pinfo.startcode, &pinfo.endcode, &pinfo.startstack,
314 &pinfo.kstkesp, &pinfo.kstkeip, &pinfo.signal, &pinfo.blocked, &pinfo.sigignore, &pinfo.sigcatch,
315 &pinfo.wchan );
316 }
317 close( fd );
318}
319
320// static long s_myPid = ::getpid();
321// In order to properly support e.g. fork() calls, we cannot keep a copy of the pid!
322
323#ifndef __APPLE__
324static inline long processID( long pid ) { return ( pid > 0 ) ? pid : ( ::getpid() ); }
325#endif // not __APPLE__
326
327#include "ProcessDescriptor.h"
329#include <GaudiKernel/System.h>
330
332 if ( pid > 0 ) {
333 if ( pid != ::getpid() ) {
334 // Note: the return type of getpid is pid_t, which is int on 64bit machines too
335 m_handle = reinterpret_cast<void*>( static_cast<long>( ::getpid() ) );
336 m_needRelease = true;
337 return;
338 }
339 }
341 m_needRelease = false;
342}
343
347
349 if ( info == 0 ) return 0;
350 long status = 1;
351
352 if ( fetch == IO ) {
353#if defined( __linux )
354 linux_proc prc;
355 readProcStat( processID( pid ), prc );
356 rusage usage;
357 getrusage( RUSAGE_SELF, &usage );
358 info->ReadOperationCount = usage.ru_inblock;
359 info->WriteOperationCount = usage.ru_oublock;
360 info->OtherOperationCount = 0;
361 info->ReadTransferCount = usage.ru_inblock;
362 info->WriteTransferCount = usage.ru_oublock;
363 info->OtherTransferCount = 0;
364#else // All Other
365 if ( pid ) {}
366#endif // End ALL OS
367 }
368 return status;
369}
370
372 if ( info == 0 ) return 0;
373 long status = 1;
374
375 if ( fetch == Quota ) {
376#if defined( __linux ) // Linux
377 // rusage usage;
378 // getrusage(RUSAGE_SELF, &usage);
379 rlimit lim;
380
381 getrlimit( RLIMIT_DATA, &lim );
382 if ( lim.rlim_max == RLIM_INFINITY ) lim.rlim_max = 0xFFFFFFFF;
383 info->PeakPagedPoolUsage = lim.rlim_cur;
384 info->PagedPoolUsage = lim.rlim_cur;
385 info->PagedPoolLimit = lim.rlim_max;
386
387 getrlimit( RLIMIT_STACK, &lim );
388 if ( lim.rlim_max == RLIM_INFINITY ) lim.rlim_max = 0xFFFFFFFF;
389 info->PeakNonPagedPoolUsage = lim.rlim_cur;
390 info->NonPagedPoolUsage = lim.rlim_cur;
391 info->NonPagedPoolLimit = lim.rlim_max;
392
393 linux_proc prc;
394 readProcStat( processID( pid ), prc );
395 info->PeakPagefileUsage = prc.rss * pg_size;
396 info->PagefileUsage = prc.rss * pg_size;
397 info->PagefileLimit = 0xFFFFFFFF;
398#elif defined( __APPLE__ )
399 if ( pid ) {}
400#else // All Other
401 if ( pid ) {}
402#endif // End ALL OS
403 }
404
405 return status;
406}
407
408long System::ProcessDescriptor::query( [[maybe_unused]] long pid, InfoType fetch, long* info ) {
409
410 if ( info == 0 ) return 0;
411 long status = 1;
412
413 switch ( fetch ) {
414 case PriorityBoost:
415 // Not applicable
416 status = 0;
417 *info = 0;
418 status = ( status == 0 ) ? 1 : 0;
419 break;
420 default:
421 status = -1;
422 *info = -1;
423 break;
424 }
425 return status;
426}
427
429 if ( info == 0 ) return 0;
430 long status = 1;
431
432 if ( fetch == Memory ) {
433#if defined( __linux ) // Linux
434 const ssize_t bufsize = 1024;
435 char buf[bufsize];
436 pid = processID( pid );
437 snprintf( buf, sizeof( buf ), "/proc/%ld/statm", pid );
438 long size, resident, share, trs, lrs, drs, dt;
439 int fd = open( buf, O_RDONLY );
440 ssize_t nread = read( fd, buf, bufsize );
441 close( fd );
442 if ( nread < bufsize && nread >= 0 ) buf[nread] = '\0';
443 fd = sscanf( buf, "%ld %ld %ld %ld %ld %ld %ld", &size, &resident, &share, &trs, &drs, &lrs, &dt );
444 linux_proc prc;
445 readProcStat( pid, prc );
446 info->PeakVirtualSize = prc.vsize;
447 info->VirtualSize = prc.vsize;
448 info->PeakWorkingSetSize = resident * pg_size;
449 info->WorkingSetSize = resident * pg_size;
450 info->QuotaPeakPagedPoolUsage = share * pg_size;
451 info->QuotaPagedPoolUsage = share * pg_size;
452 info->QuotaNonPagedPoolUsage = ( trs + drs ) * pg_size; // drs = data/stack size
453 info->QuotaPeakNonPagedPoolUsage = ( trs + drs ) * pg_size; // trs = VmExe size
454 info->PageFaultCount = prc.majflt + prc.minflt;
455 info->PagefileUsage = prc.vsize - resident * pg_size;
456 info->PeakPagefileUsage = prc.vsize - resident * pg_size;
457#elif defined( __APPLE__ )
458 // Use Mach API to get memory information on macOS
459 // Note: We can only query our own task reliably without special entitlements
460 mach_task_basic_info_data_t taskInfo;
461 mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
462
463 kern_return_t kr = task_info( mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&taskInfo, &infoCount );
464 if ( kr == KERN_SUCCESS ) {
465 info->VirtualSize = taskInfo.virtual_size;
466 info->PeakVirtualSize = taskInfo.virtual_size; // macOS doesn't track peak, use current
467 info->WorkingSetSize = taskInfo.resident_size;
468 info->PeakWorkingSetSize = taskInfo.resident_size_max;
469 info->QuotaPagedPoolUsage = 0;
470 info->QuotaPeakPagedPoolUsage = 0;
471 info->QuotaNonPagedPoolUsage = 0;
473 info->PagefileUsage = taskInfo.virtual_size - taskInfo.resident_size;
474 info->PeakPagefileUsage = taskInfo.virtual_size - taskInfo.resident_size;
475
476 // Get page fault count from getrusage (not available in task_info)
477 struct rusage usage;
478 if ( getrusage( RUSAGE_SELF, &usage ) == 0 ) {
479 info->PageFaultCount = static_cast<unsigned long>( usage.ru_majflt + usage.ru_minflt );
480 } else {
481 info->PageFaultCount = 0;
482 }
483 status = 1;
484 } else {
485 // Zero out the struct on failure so we don't return garbage
486 info->VirtualSize = 0;
487 info->PeakVirtualSize = 0;
488 info->WorkingSetSize = 0;
489 info->PeakWorkingSetSize = 0;
490 info->PageFaultCount = 0;
491 info->QuotaPagedPoolUsage = 0;
492 info->QuotaPeakPagedPoolUsage = 0;
493 info->QuotaNonPagedPoolUsage = 0;
495 info->PagefileUsage = 0;
496 info->PeakPagefileUsage = 0;
497 status = 0;
498 }
499 (void)pid; // suppress unused parameter warning
500#else // All Other
501 if ( pid ) {}
502#endif // End ALL OS
503 }
504 return status;
505}
506
508 if ( info == 0 ) return 0;
509 long status = 1;
510
511 if ( fetch == Quota ) {
512#if defined( __linux ) // Linux
513 // On linux all this stuff typically is not set
514 // (ie. rlim_max=RLIM_INFINITY...)
515
516 if ( pid > 0 && pid != ::getpid() ) return 0; // only possible for myself
517
518 rlimit lim;
519 getrlimit( RLIMIT_DATA, &lim );
520 if ( lim.rlim_max == RLIM_INFINITY ) lim.rlim_max = 0xFFFFFFFF;
521 info->PagedPoolLimit = lim.rlim_max;
522
523 getrlimit( RLIMIT_STACK, &lim );
524 if ( lim.rlim_max == RLIM_INFINITY ) lim.rlim_max = 0xFFFFFFFF;
525 info->NonPagedPoolLimit = lim.rlim_max;
526 info->MinimumWorkingSetSize = 0;
527
528 getrlimit( RLIMIT_RSS, &lim );
529 if ( lim.rlim_max == RLIM_INFINITY ) lim.rlim_max = 0xFFFFFFFF;
530 info->MaximumWorkingSetSize = lim.rlim_max;
531
532 getrlimit( RLIMIT_AS, &lim );
533 if ( lim.rlim_max == RLIM_INFINITY ) lim.rlim_max = 0xFFFFFFFF;
534 info->PagefileLimit = lim.rlim_max;
535
536 getrlimit( RLIMIT_CPU, &lim );
537 if ( lim.rlim_max == RLIM_INFINITY ) lim.rlim_max = 0xFFFFFFFF;
538 info->TimeLimit = lim.rlim_max;
539#elif defined( __APPLE__ )
540 if ( pid ) {}
541#else // All Other
542 if ( pid ) {}
543#endif // End ALL OS
544 }
545 return status;
546}
547
549 if ( info == 0 ) return 0;
550 long status = 1;
551
552 if ( fetch == ProcessBasics ) {
553#if defined( __linux ) // Linux
554 linux_proc prc;
555 pid = processID( pid );
556 readProcStat( pid, prc );
557 info->ExitStatus = 0;
558 info->PebBaseAddress = (PPEB)prc.startcode;
559 info->BasePriority = 2 * 15 - prc.priority;
560 // std::cout << "Base Priority=" << info->BasePriority << "|"
561 // << prc.priority << std::endl;
562 info->AffinityMask = prc.flags;
563 // std::cout << "Flags =" << info->AffinityMask << "|"
564 // << prc.flags << std::endl;
565 info->UniqueProcessId = pid;
567#else // All Other
568 if ( pid ) {}
569#endif // End ALL OS
570 }
571 return status;
572}
573
575 if ( info == 0 ) return 0;
576 long status = 1;
577
578 if ( fetch == Times ) {
579#if defined( __linux ) // Linux
580 static long long prc_start = 0;
581 bool myself = pid <= 0 || pid == ::getpid(); // avoid unnecessary calls to getpid if pid<0
582 if ( myself && prc_start == 0 ) { // called only once to set prc_start
583 linux_proc prc;
584 readProcStat( processID( pid ), prc );
585 // prc.startup is in ticks since system start, need to offset for absolute time
586 tms tmsb;
587 static long long offset =
588 100 * static_cast<long long>( time( nullptr ) ) - static_cast<long long>( times( &tmsb ) );
589 prc_start = ( prc.starttime + offset ) * TICK_TO_100NSEC;
590 }
591
592 if ( myself ) { // myself
593 tms tmsb;
594 times( &tmsb );
595 info->UserTime = tmsb.tms_utime * TICK_TO_100NSEC;
596 info->KernelTime = tmsb.tms_stime * TICK_TO_100NSEC;
597 info->CreateTime = prc_start;
598 } else { // other process
599 linux_proc prc;
600 readProcStat( processID( pid ), prc );
601 tms tmsb;
602 static long long offset =
603 100 * static_cast<long long>( time( nullptr ) ) - static_cast<long long>( times( &tmsb ) );
604
605 tms t;
606 times( &t );
607 info->UserTime = t.tms_utime * TICK_TO_100NSEC;
608 info->KernelTime = t.tms_stime * TICK_TO_100NSEC;
609 info->CreateTime = ( prc.starttime + offset ) * TICK_TO_100NSEC;
610 }
611 info->ExitTime = 0;
612
613 status = 1;
614
615#elif defined( __APPLE__ )
616 // Use getrusage for user and kernel times on macOS
617 // Track process start time using a static variable initialized on first call
618 static long long prc_start = 0;
619 if ( prc_start == 0 ) {
620 struct timeval tv;
621 gettimeofday( &tv, nullptr );
622 // Convert to 100-nanosecond units: 1 sec = 10,000,000 units, 1 usec = 10 units
623 prc_start = static_cast<long long>( tv.tv_sec ) * 10000000LL + static_cast<long long>( tv.tv_usec ) * 10LL;
624 }
625
626 struct rusage usage;
627 if ( getrusage( RUSAGE_SELF, &usage ) == 0 ) {
628 // Convert timeval to 100-nanosecond units
629 info->UserTime = static_cast<long long>( usage.ru_utime.tv_sec ) * 10000000LL +
630 static_cast<long long>( usage.ru_utime.tv_usec ) * 10LL;
631 info->KernelTime = static_cast<long long>( usage.ru_stime.tv_sec ) * 10000000LL +
632 static_cast<long long>( usage.ru_stime.tv_usec ) * 10LL;
633 info->CreateTime = prc_start;
634 info->ExitTime = 0;
635 status = 1;
636 } else {
637 status = 0;
638 }
639 (void)pid; // suppress unused parameter warning
640#else // no /proc file system: assume sys_start for the first call
641 tms tmsb;
642 static clock_t sys_start = times( 0 );
643 static long long offset = 100 * long long( time( 0 ) ) - sys_start;
644 clock_t now = times( &tmsb );
645 info->CreateTime = offset + now;
646 info->UserTime = tmsb.tms_utime;
647 info->KernelTime = tmsb.tms_stime;
648 info->CreateTime *= TICK_TO_100NSEC;
649 info->UserTime *= TICK_TO_100NSEC;
650 info->KernelTime *= TICK_TO_100NSEC;
651 info->ExitTime = 0;
652 status = 1;
653#endif
654 }
655
656 return status;
657}
void readProcStat(long pid, linux_proc &pinfo)
long query(long pid, InfoType fetch, PROCESS_BASIC_INFORMATION *info)
void usage(const std::string &argv0)
Note: OS specific details for environment resolution.
Definition Environment.h:25
@ ProcessDefaultHardErrorMode
@ ProcessEnableAlignmentFaultFixup
@ ProcessPooledUsageAndLimits
GAUDI_API ProcessHandle processHandle()
Handle to running process.
InfoType
Enumeration for fetching information.
Definition SystemBase.h:15
@ PriorityBoost
Definition SystemBase.h:15
@ ProcessBasics
Definition SystemBase.h:15
struct _PEB * PPEB
Basic Process Information NtQueryInformationProcess using ProcessBasicInfo.
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
unsigned long utime
unsigned long flags
unsigned long rlim
unsigned long vsize
unsigned long endcode
unsigned long startcode
unsigned long blocked
unsigned long signal
unsigned long cmajflt
unsigned long startstack
unsigned long majflt
unsigned long minflt
unsigned long stime
unsigned long long starttime
unsigned long sigcatch
unsigned long sigignore
unsigned long kstkeip
unsigned long kstkesp
unsigned long wchan
unsigned long cminflt