| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Namespaces | Classes | Typedefs | Enumerations | Functions
System Namespace Reference

Note: OS specific details for environment resolution. More...

## Namespaces
| Linux
| Namespace holding Linux specific functions.
| MacOS
| Namespace holding MacOS specific functions.
| Win32
| Namespace holding Windows specific functions.

## Classes
struct | IO_COUNTERS
| Process I/O Counters NtQueryInformationProcess using ProcessIoCounters. More...
struct | KERNEL_USER_TIMES
| Process/Thread System and User Time NtQueryInformationProcess using ProcessTimes NtQueryInformationThread using ThreadTimes. More...
class | PathResolver
struct | POOLED_USAGE_AND_LIMITS
| Process Pooled Quota Usage and Limits NtQueryInformationProcess using ProcessPooledUsageAndLimits. More...
struct | PROCESS_BASIC_INFORMATION
class | ProcessDescriptor
| Provides access to process information. More...
class | ProcessTime
| Simple class to hold the time information of a process. More...
struct | QUOTA_LIMITS
| Process Quotas NtQueryInformationProcess using ProcessQuotaLimits NtQueryInformationProcess using ProcessPooledQuotaLimits NtSetInformationProcess using ProcessQuotaLimits. More...
struct | VM_COUNTERS
| Process Virtual Memory Counters NtQueryInformationProcess using ProcessVmCounters. More...

## Typedefs
typedef void * | ImageHandle
| Definition of an image handle. More...
typedef void * | ProcessHandle
| Definition of the process handle. More...
typedef unsigned long(* | EntryPoint) (const unsigned long iid, void **ppvObject)
| Definition of the "generic" DLL entry point function. More...
typedef void *(* | Creator) ()
| Definition of the "generic" DLL entry point function. More...
typedef void * | ThreadHandle
| A Thread handle. More...
typedef struct _PEB * | PPEB
| Basic Process Information NtQueryInformationProcess using ProcessBasicInfo. More...

## Enumerations
enum | MemoryUnit { Byte, kByte, MByte, GByte, TByte, PByte, EByte }
| Unit of memory. More...
enum | ModuleType { UNKNOWN, SHAREDLIB, EXECUTABLE }
enum | InfoType { NoFetch, RemainTime, Times, ProcessBasics, PriorityBoost, Memory, Quota, System, Modules, IO }
| Enumeration for fetching information. More...
enum | TimeType { Year, Month, Day, Hour, Min, Sec, milliSec, microSec, nanoSec, Native }
| Time type for conversion. More...
enum | PR_file_type { PR_regular_file, PR_directory }
enum | PR_search_type { PR_local, PR_recursive }
enum | ProcessInfoCommand { ProcessBasicInformation, ProcessQuotaLimits, ProcessIoCounters, ProcessVmCounters, ProcessTimes, ProcessBasePriority, ProcessRaisePriority, ProcessDebugPort, ProcessExceptionPort, ProcessAccessToken, ProcessLdtInformation, ProcessLdtSize, ProcessDefaultHardErrorMode, ProcessIoPortHandlers, ProcessPooledUsageAndLimits, ProcessWorkingSetWatch, ProcessUserModeIOPL, ProcessEnableAlignmentFaultFixup, ProcessPriorityClass, ProcessWx86Information, ProcessHandleCount, ProcessAffinityMask, ProcessPriorityBoost, MaxProcessInfoClass, ProcessEllapsedTime }

## Functions
GAUDI_API long | breakExecution ()
| Break the execution of the application and invoke the debugger. More...
GAUDI_API long | breakExecution (long pid)
| Break the execution of the application and invoke the debugger in a remote process. More...
GAUDI_API std::string | homeDirectory ()
GAUDI_API std::string | tempDirectory ()
GAUDI_API StatusCode | resolveEnv (const std::string &var, std::string &res, int recusions=124)
GAUDI_API long | adjustMemory (MemoryUnit typ, long value)
| Convert time from kByte to requested representation (Experts only) More...
GAUDI_API long | procID ()
| Basic Process Information: Process ID. More...
GAUDI_API long | parentID (InfoType fetch=ProcessBasics, long pid=-1)
| Basic Process Information: Parent's process ID. More...
GAUDI_API long | affinityMask (InfoType fetch=ProcessBasics, long pid=-1)
| Basic Process Information: Affinity mask. More...
GAUDI_API long | exitStatus (InfoType fetch=ProcessBasics, long pid=-1)
| Basic Process Information: Exit status (does not really make sense for the running process, but for others!) More...
GAUDI_API long | basePriority (InfoType fetch=ProcessBasics, long pid=-1)
| Basic Process Information: Base priority. More...
GAUDI_API long | priorityBoost (InfoType fetch=PriorityBoost, long pid=-1)
| Basic Process Information: priority boost. More...
GAUDI_API long | numPageFault (InfoType fetch=Memory, long pid=-1)
| Basic Process Information: Number of page faults. More...
GAUDI_API long | pagefileUsage (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: Current page file usage. More...
GAUDI_API long | pagefileUsagePeak (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: Peak usage of page file. More...
GAUDI_API long | pagefileUsageLimit (MemoryUnit unit=kByte, InfoType fetch=Quota, long pid=-1)
| Basic Process Information: Peak usage of page file. More...
GAUDI_API long | nonPagedMemory (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: Current usage of non paged memory. More...
GAUDI_API long | nonPagedMemoryPeak (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: Peak usage of non paged memory. More...
GAUDI_API long | nonPagedMemoryLimit (MemoryUnit unit=kByte, InfoType fetch=Quota, long pid=-1)
| System Process Limits: Maximum amount of non-paged memory this process is allowed to use. More...
GAUDI_API long | pagedMemory (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: Amount of paged memory currently occupied by the process 'pid'. More...
GAUDI_API long | pagedMemoryPeak (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: Maximum of paged memory occupied by the process 'pid'. More...
GAUDI_API long | pagedMemoryLimit (MemoryUnit unit=kByte, InfoType fetch=Quota, long pid=-1)
| Basic Process Information: Amount of paged memory that can be occupied by the process 'pid'. More...
GAUDI_API long | minMemoryLimit (MemoryUnit unit=kByte, InfoType fetch=Quota, long pid=-1)
| System Process Limits: Minimum amount of virtual memory this process may use. More...
GAUDI_API long | maxMemoryLimit (MemoryUnit unit=kByte, InfoType fetch=Quota, long pid=-1)
| System Process Limits: Maximum amount of virtual memory this process is allowed to use. More...
GAUDI_API long | mappedMemory (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: priority boost. More...
GAUDI_API long | mappedMemoryPeak (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: priority boost. More...
GAUDI_API long | virtualMemory (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: priority boost. More...
GAUDI_API long | virtualMemoryPeak (MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
| Basic Process Information: priority boost. More...
GAUDI_API long | virtualMemoryLimit (MemoryUnit unit=kByte, InfoType fetch=Quota, long pid=-1)
| System Process Limits: Maximum amount of the page file this process is allowed to use. More...
GAUDI_API const std::string & | moduleName ()
| Get the name of the (executable/DLL) file without file-type. More...
GAUDI_API const std::string & | moduleNameFull ()
| Get the full name of the (executable/DLL) file. More...
GAUDI_API ModuleType | moduleType ()
| Get type of the module. More...
GAUDI_API ProcessHandle | processHandle ()
| Handle to running process. More...
GAUDI_API ImageHandle | moduleHandle ()
| Handle to currently executed module. More...
GAUDI_API ImageHandle | exeHandle ()
| Handle to the executable file running. More...
GAUDI_API const std::string & | exeName ()
| Name of the executable file running. More...
GAUDI_API const std::vector< std::string > | linkedModules ()
| Vector of names of linked modules. More...
GAUDI_API void | setModuleHandle (ImageHandle handle)
| Attach module handle. More...
GAUDI_API std::string | PathResolverFindXMLFile (const std::string &logical_file_name)
GAUDI_API std::string | PathResolverFindDataFile (const std::string &logical_file_name)
GAUDI_API unsigned long | loadDynamicLib (const std::string &name, ImageHandle *handle)
| Load dynamic link library. More...
GAUDI_API unsigned long | unloadDynamicLib (ImageHandle handle)
| unload dynamic link library More...
GAUDI_API unsigned long | getProcedureByName (ImageHandle handle, const std::string &name, EntryPoint *pFunction)
| Get a specific function defined in the DLL. More...
GAUDI_API unsigned long | getProcedureByName (ImageHandle handle, const std::string &name, Creator *pFunction)
| Get a specific function defined in the DLL. More...
GAUDI_API unsigned long | getLastError ()
| Get last system known error. More...
GAUDI_API const std::string | getLastErrorString ()
| Get last system error as string. More...
GAUDI_API const std::string | getErrorString (unsigned long error)
| Retrieve error code as string for a given error. More...
GAUDI_API const std::string | typeinfoName (const std::type_info &)
| Get platform independent information about the class type. More...
GAUDI_API const std::string | typeinfoName (const char *)
| Get the human readable type name from a typeinfo name. More...
GAUDI_API const std::string & | hostName ()
| Host name. More...
GAUDI_API const std::string & | osName ()
| OS name. More...
GAUDI_API const std::string & | osVersion ()
| OS version. More...
GAUDI_API const std::string & | machineType ()
| Machine type. More...
GAUDI_API int | instructionsetLevel ()
| Instruction Set "Level". More...
GAUDI_API const std::string & | accountName ()
| User login name. More...
GAUDI_API long | numCmdLineArgs ()
| Number of arguments passed to the commandline. More...
GAUDI_API long | argc ()
| Number of arguments passed to the commandline (==numCmdLineArgs()); just to match argv call... More...
GAUDI_API const std::vector< std::string > | cmdLineArgs ()
| Command line arguments including executable name as arg[0] as vector of strings. More...
GAUDI_API char ** | argv ()
| char** command line arguments including executable name as arg[0]; You may not modify them! More...
GAUDI_API std::string | getEnv (const char *var)
| get a particular environment variable (returning "UNKNOWN" if not set) More...
GAUDI_API bool | getEnv (const char *var, std::string &value)
| get a particular environment variable, storing the value in the passed string if the variable is set. More...
bool | getEnv (const std::string &var, std::string &value)
GAUDI_API std::vector< std::string > | getEnv ()
| get all environment variables More...
GAUDI_API int | setEnv (const std::string &name, const std::string &value, int overwrite=1)
| Set an environment variables. More...
GAUDI_API bool | isEnvSet (const char *var)
| Check if an environment variable is set or not. More...
ThreadHandle | threadSelf ()
| thread handle "accessor" More...
GAUDI_API int | backTrace (void **addresses, const int depth)
GAUDI_API bool | backTrace (std::string &btrace, const int depth, const int offset=0)
GAUDI_API bool | getStackLevel (void *addresses, void *&addr, std::string &fnc, std::string &lib)
GAUDI_API longlong | adjustTime (TimeType typ, longlong timevalue)
| Convert time from OS native time to requested representation (Experts only) More...
template<TimeType T>
long long | adjustTime (long long timevalue)
| Convert the time from OS native time to requested representation (Experts only) More...
GAUDI_API longlong | ellapsedTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
| Elapsed time since start of process in milliseconds. More...
GAUDI_API longlong | kernelTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
| CPU kernel mode time of process in milliseconds. More...
GAUDI_API longlong | userTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
| CPU user mode time of process in milliseconds. More...
GAUDI_API longlong | cpuTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
| Consumed CPU time of process in milliseconds. More...
GAUDI_API longlong | remainingTime (TimeType typ=milliSec, InfoType fetch=Quota, long pid=-1)
| Maximum processing time left for this process. More...
GAUDI_API longlong | creationTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
| Process Creation time. More...
GAUDI_API longlong | systemStart (TimeType typ=Sec)
| Maximum processing time left for this process. More...
GAUDI_API longlong | upTime (TimeType typ=Hour)
| Maximum processing time left for this process. More...
template<TimeType T>
GAUDI_API longlong | currentTime ()
| Retrieve absolute system time. More...
GAUDI_API longlong | currentTime (TimeType typ=milliSec)
| Get current time in specificed units. More...
GAUDI_API longlong | tickCount ()
| Retrieve the number of ticks since system startup. More...
GAUDI_API ProcessTime | getProcessTime (long pid=-1)
| Retrieve the process time data for a process. More...
template<>
long long | adjustTime< Year > (long long t)
template<>
long long | adjustTime< Day > (long long t)
template<>
long long | adjustTime< Hour > (long long t)
template<>
long long | adjustTime< Min > (long long t)
template<>
long long | adjustTime< Sec > (long long t)
template<>
long long | adjustTime< milliSec > (long long t)
template<>
long long | adjustTime< microSec > (long long t)
template<>
long long | adjustTime< nanoSec > (long long t)
template<>
long long | adjustTime< Month > (long long t)
template<>
long long | adjustTime< Native > (long long t)
template<TimeType T>
longlong | currentTime ()
| Retrieve absolute system time. More...
template longlong | currentTime< Year > ()
template longlong | currentTime< Month > ()
template longlong | currentTime< Day > ()
template longlong | currentTime< Hour > ()
template longlong | currentTime< Min > ()
template longlong | currentTime< Sec > ()
template longlong | currentTime< milliSec > ()
template longlong | currentTime< microSec > ()
template longlong | currentTime< nanoSec > ()
template longlong | currentTime< Native > ()
ProcessDescriptor * | getProcess ()
| Retrieve Process structure. More...

## Detailed Description

Note: OS specific details for environment resolution.

Note: OS specific details for process timing.

Note: OS specific details as well as Gaudi details may not occur in this definition file, because this header is the used by both, the OS specific implementations and the gaudi specific implementation.

ModuleInfo: OS specific details to access at run-time the module configuration of the process.

Note: OS specific details for memory usage.

Entrypoints:

Author
  : M.Frank

Version
  : 1.0

Entrypoints:

- basePriority Base priority
- procID Process ID
- parentID Parent's process ID
- affinityMask Affinity mask
- exitStatus Exit status
- priorityBoost Priority boost
- numPageFault Number of page faults
- pagefileUsage Current page file usage
- pagefileUsagePeak Peak usage of page file
- nonPagedMemory Current usage of non paged memory
- nonPagedMemoryPeak Peak usage of non paged memory
- nonPagedMemoryLimit Maximum amount of non-paged memory this process is allowed to use
- pagedMemory Amount of paged memory currently occupied
- pagedMemoryPeak Maximum of paged memory occupied by the process
- pagedMemoryLimit paged memory that can be occupied by the process
- memorySize Size of currently occupied memory
- memorySizePeak Maximum memory occupied by the process
- memoryLimit Amount of memory that can be occupied by the process
- virtualMemorySize Virtual memory size currenly occupied
- peakVirtualMemorySize Maximum amount of virtual memory occupied
- virtualMemoryLimit Amount of virtual memory that can be occupied by the process
- minMemoryLimit Minimum amount of virtual memory this process may use
- maxMemoryLimit Maximum amount of virtual memory this process is allowed to use
- mappedMemorySize Currenly mapped virtual memory size
- mappedMemorySizePeak Peak mapped virtual memory size

Author
  : M.Frank

Version
  : 1.0

M.Frank

Since e.g. IID is defined in both, this would lead automatically to complete comilation failures.....

Author
  M.Frank

Entrypoints:

- remainingTime returns the time the process could still execute
- ellapsedTime: returns elapsed time since program start
- kernelTime: returns the amount of time the process has spent in kernel mode
- userTime: returns the amount of time the process has spent in user mode
- cpuTime: returns kernel+user time

On Windows NT Time is expressed as the amount of time that has elapsed since midnight on January 1, 1601 at Greenwich, England.

On Unix time is expressed as the amount of time that has elapsed since midnight on January 1, 1970 at Greenwich, England.

History :

    +---------+----------------------------------------------+--------+
    |    Date |                 Comment                      | Who    |
    +---------+----------------------------------------------+--------+
    | 11/11/00| Initial version.                             | MF     |
    +---------+----------------------------------------------+--------+

Author
  : M.Frank

Version
  : 1.0

## Typedef Documentation

typedef void*( * System::Creator) ()

Definition of the "generic" DLL entry point function.

Definition at line 38 of file System.h.

typedef unsigned long( * System::EntryPoint) (const unsigned long iid, void **ppvObject)

Definition of the "generic" DLL entry point function.

Definition at line 36 of file System.h.

typedef void * System::ImageHandle

Definition of an image handle.

Definition at line 31 of file ModuleInfo.h.

typedef struct _PEB* System::PPEB

Basic Process Information NtQueryInformationProcess using ProcessBasicInfo.

Definition at line 18 of file ProcessDescriptor.h.

typedef void * System::ProcessHandle

Definition of the process handle.

Definition at line 33 of file ModuleInfo.h.

typedef void* System::ThreadHandle

A Thread handle.

Definition at line 109 of file System.h.

## Enumeration Type Documentation

enum System::InfoType

Enumeration for fetching information.

Enumerator
NoFetch |
RemainTime |
Times |
ProcessBasics |
PriorityBoost |
Memory |
Quota |
System |
Modules |
IO |

Definition at line 19 of file SystemBase.h.

19 { NoFetch, RemainTime, Times, ProcessBasics, PriorityBoost, Memory, Quota, System, Modules, IO };
System::RemainTime
Definition: SystemBase.h:19
System::Memory
Definition: SystemBase.h:19
System::Times
Definition: SystemBase.h:19
System::Quota
Definition: SystemBase.h:19
System::Modules
Definition: SystemBase.h:19
System::NoFetch
Definition: SystemBase.h:19
System::IO
Definition: SystemBase.h:19
System::System
Definition: SystemBase.h:19
System::ProcessBasics
Definition: SystemBase.h:19
System::PriorityBoost
Definition: SystemBase.h:19

enum System::MemoryUnit

Unit of memory.

Enumerator
Byte |
kByte |
MByte |
GByte |
TByte |
PByte |
EByte |

Definition at line 56 of file Memory.h.

56 { Byte, kByte, MByte, GByte, TByte, PByte, EByte };
System::TByte
Definition: Memory.h:56
System::PByte
Definition: Memory.h:56
System::MByte
Definition: Memory.h:56
System::GByte
Definition: Memory.h:56
System::kByte
Definition: Memory.h:56
System::Byte
Definition: Memory.h:56
System::EByte
Definition: Memory.h:56

enum System::ModuleType

Enumerator
UNKNOWN |
SHAREDLIB |
EXECUTABLE |

Definition at line 29 of file ModuleInfo.h.

29 { UNKNOWN, SHAREDLIB, EXECUTABLE };
System::SHAREDLIB
Definition: ModuleInfo.h:29
System::UNKNOWN
Definition: ModuleInfo.h:29
System::EXECUTABLE
Definition: ModuleInfo.h:29

enum System::PR_file_type

Enumerator
PR_regular_file |
PR_directory |

Definition at line 36 of file PathResolver.cpp.

36 { PR_regular_file, PR_directory } PR_file_type;
System::PR_directory
Definition: PathResolver.cpp:36
System::PR_file_type
PR_file_type
Definition: PathResolver.cpp:36
System::PR_regular_file
Definition: PathResolver.cpp:36

enum System::PR_search_type

Enumerator
PR_local |
PR_recursive |

Definition at line 38 of file PathResolver.cpp.

38 { PR_local, PR_recursive } PR_search_type;
System::PR_local
Definition: PathResolver.cpp:38
System::PR_recursive
Definition: PathResolver.cpp:38
System::PR_search_type
PR_search_type
Definition: PathResolver.cpp:38

enum System::ProcessInfoCommand

Enumerator
ProcessBasicInformation |
ProcessQuotaLimits |
ProcessIoCounters |
ProcessVmCounters |
ProcessTimes |
ProcessBasePriority |
ProcessRaisePriority |
ProcessDebugPort |
ProcessExceptionPort |
ProcessAccessToken |
ProcessLdtInformation |
ProcessLdtSize |
ProcessDefaultHardErrorMode |
ProcessIoPortHandlers |
ProcessPooledUsageAndLimits |
ProcessWorkingSetWatch |
ProcessUserModeIOPL |
ProcessEnableAlignmentFaultFixup |
ProcessPriorityClass |
ProcessWx86Information |
ProcessHandleCount |
ProcessAffinityMask |
ProcessPriorityBoost |
MaxProcessInfoClass |
ProcessEllapsedTime |

Definition at line 23 of file ProcessDescriptor.cpp.

23 {
24 ProcessBasicInformation,
25 ProcessQuotaLimits,
26 ProcessIoCounters,
27 ProcessVmCounters,
28 ProcessTimes,
29 ProcessBasePriority,
30 ProcessRaisePriority,
31 ProcessDebugPort,
32 ProcessExceptionPort,
33 ProcessAccessToken,
34 ProcessLdtInformation,
35 ProcessLdtSize,
36 ProcessDefaultHardErrorMode,
37 ProcessIoPortHandlers, // Note: this is kernel mode only
38 ProcessPooledUsageAndLimits,
39 ProcessWorkingSetWatch,
40 ProcessUserModeIOPL,
41 ProcessEnableAlignmentFaultFixup,
42 ProcessPriorityClass,
43 ProcessWx86Information,
44 ProcessHandleCount,
45 ProcessAffinityMask,
46 ProcessPriorityBoost,
47 MaxProcessInfoClass, //
48 ProcessEllapsedTime
49 };
System::ProcessDebugPort
Definition: ProcessDescriptor.cpp:31
System::ProcessIoPortHandlers
Definition: ProcessDescriptor.cpp:37
System::ProcessWx86Information
Definition: ProcessDescriptor.cpp:43
System::ProcessUserModeIOPL
Definition: ProcessDescriptor.cpp:40
System::ProcessBasicInformation
Definition: ProcessDescriptor.cpp:24
System::ProcessEllapsedTime
Definition: ProcessDescriptor.cpp:48
System::ProcessAccessToken
Definition: ProcessDescriptor.cpp:33
System::ProcessPriorityClass
Definition: ProcessDescriptor.cpp:42
System::ProcessHandleCount
Definition: ProcessDescriptor.cpp:44
System::ProcessLdtSize
Definition: ProcessDescriptor.cpp:35
System::ProcessBasePriority
Definition: ProcessDescriptor.cpp:29
System::ProcessLdtInformation
Definition: ProcessDescriptor.cpp:34
System::ProcessIoCounters
Definition: ProcessDescriptor.cpp:26
System::MaxProcessInfoClass
Definition: ProcessDescriptor.cpp:47
System::ProcessQuotaLimits
Definition: ProcessDescriptor.cpp:25
System::ProcessPriorityBoost
Definition: ProcessDescriptor.cpp:46
System::ProcessExceptionPort
Definition: ProcessDescriptor.cpp:32
System::ProcessWorkingSetWatch
Definition: ProcessDescriptor.cpp:39
System::ProcessAffinityMask
Definition: ProcessDescriptor.cpp:45
System::ProcessEnableAlignmentFaultFixup
Definition: ProcessDescriptor.cpp:41
System::ProcessRaisePriority
Definition: ProcessDescriptor.cpp:30
System::ProcessDefaultHardErrorMode
Definition: ProcessDescriptor.cpp:36
System::ProcessTimes
Definition: ProcessDescriptor.cpp:28
System::ProcessPooledUsageAndLimits
Definition: ProcessDescriptor.cpp:38
System::ProcessVmCounters
Definition: ProcessDescriptor.cpp:27

enum System::TimeType

Time type for conversion.

Enumerator
Year |
Month |
Day |
Hour |
Min |
Sec |
milliSec |
microSec |
nanoSec |
Native |

Definition at line 58 of file Timing.h.

58 { Year, Month, Day, Hour, Min, Sec, milliSec, microSec, nanoSec, Native };
System::Min
Definition: Timing.h:58
System::Hour
Definition: Timing.h:58
System::milliSec
Definition: Timing.h:58
System::Sec
Definition: Timing.h:58
System::microSec
Definition: Timing.h:58
System::Native
Definition: Timing.h:58
System::Month
Definition: Timing.h:58
System::nanoSec
Definition: Timing.h:58
System::Year
Definition: Timing.h:58
System::Day
Definition: Timing.h:58

## Function Documentation

const std::string & System::accountName | ( |  | ) |

User login name.

User login name.

Definition at line 375 of file System.cpp.

376 {
377 static const std::string account = Platform::accountName();
378 return account;
379 }
System::accountName
GAUDI_API const std::string & accountName()
User login name.
Definition: System.cpp:375
std::string
STL class.

long System::adjustMemory | ( | MemoryUnit | typ,
|  | long | value
| ) |  |

Convert time from kByte to requested representation (Experts only)

Convert requested memory value from kByte to requested value.

Definition at line 34 of file Memory.cpp.

35 {
36 if ( value != -1 ) {
37 switch ( unit ) {
38 case Byte:
39 break;
40 case kByte:
41 value = value / 1024;
42 break;
43 case MByte:
44 value = ( value / 1024 ) / 1024;
45 break;
46 case GByte:
47 value = ( ( value / 1024 ) / 1024 ) / 1024;
48 break;
49 case TByte:
50 value = ( ( ( value / 1024 ) / 1024 ) / 1024 ) / 1024;
51 break;
52 case PByte:
53 value = ( ( ( ( value / 1024 ) / 1024 ) / 1024 ) / 1024 ) / 1024;
54 break;
55 case EByte:
56 value = ( ( ( ( ( value / 1024 ) / 1024 ) / 1024 ) / 1024 ) / 1024 ) / 1024;
57 break;
58 default:
59 value = -1;
60 break;
61 }
62 }
63 return value;
64 }
System::TByte
Definition: Memory.h:56
System::PByte
Definition: Memory.h:56
System::MByte
Definition: Memory.h:56
System::GByte
Definition: Memory.h:56
System::kByte
Definition: Memory.h:56
System::Byte
Definition: Memory.h:56
System::EByte
Definition: Memory.h:56

longlong System::adjustTime | ( | TimeType | typ,
|  | longlong | timevalue
| ) |  |

Convert time from OS native time to requested representation (Experts only)

unfortunately "-ansi" flag turn off the correct definition of CLK_TCK and forces it to be equal CLOCKS_PER_SEC, it is wrong!

t /= CLOCKS_PER_SEC; // needs division by clock tick unit

Definition at line 37 of file Timing.cpp.

38 {
39 if ( t != -1 ) {
40 #ifndef _WIN32
41 // t /= CLK_TCK ; // needs division by clock tick unit
46
48 #endif
49 switch ( typ ) {
50 case Year:
51 return adjustTime<Year>( t );
52 case Month:
53 return adjustTime<Month>( t );
54 case Day:
55 return adjustTime<Day>( t );
56 case Hour:
57 return adjustTime<Hour>( t );
58 case Min:
59 return adjustTime<Min>( t );
60 case Sec:
61 return adjustTime<Sec>( t );
62 case milliSec:
63 return adjustTime<milliSec>( t );
64 case microSec:
65 return adjustTime<microSec>( t );
66 case nanoSec:
67 return adjustTime<nanoSec>( t );
68 case Native:
69 return adjustTime<Native>( t );
70 }
71 }
72 return t;
73 }
System::Min
Definition: Timing.h:58
System::adjustTime< Native >
long long adjustTime< Native >(long long t)
Definition: Timing.h:262
System::Hour
Definition: Timing.h:58
System::adjustTime< Month >
long long adjustTime< Month >(long long t)
Definition: Timing.h:257
System::milliSec
Definition: Timing.h:58
System::Sec
Definition: Timing.h:58
System::adjustTime< nanoSec >
long long adjustTime< nanoSec >(long long t)
Definition: Timing.h:252
System::microSec
Definition: Timing.h:58
System::adjustTime< Day >
long long adjustTime< Day >(long long t)
Definition: Timing.h:222
System::Native
Definition: Timing.h:58
System::adjustTime< milliSec >
long long adjustTime< milliSec >(long long t)
Definition: Timing.h:242
System::adjustTime< Year >
long long adjustTime< Year >(long long t)
Definition: Timing.h:217
System::adjustTime< microSec >
long long adjustTime< microSec >(long long t)
Definition: Timing.h:247
System::adjustTime< Min >
long long adjustTime< Min >(long long t)
Definition: Timing.h:232
System::Month
Definition: Timing.h:58
System::nanoSec
Definition: Timing.h:58
System::adjustTime< Hour >
long long adjustTime< Hour >(long long t)
Definition: Timing.h:227
System::Year
Definition: Timing.h:58
System::adjustTime< Sec >
long long adjustTime< Sec >(long long t)
Definition: Timing.h:237
System::Day
Definition: Timing.h:58
template<TimeType T>

long long System::adjustTime | ( | long long | timevalue | ) |
| inline

Convert the time from OS native time to requested representation (Experts only)

template<>

long long System::adjustTime< Day > | ( | long long | t | ) |
| inline

Definition at line 222 of file Timing.h.

223 {
224 return ( t == -1 ) ? t : t /= ( 1LL * 24 * 60 * 60 * 1000 * 1000 * 10 );
225 }
template<>

long long System::adjustTime< Hour > | ( | long long | t | ) |
| inline

Definition at line 227 of file Timing.h.

228 {
229 return ( t == -1 ) ? t : t /= ( 1LL * 60 * 60 * 1000 * 1000 * 10 );
230 }
template<>

long long System::adjustTime< microSec > | ( | long long | t | ) |
| inline

Definition at line 247 of file Timing.h.

248 {
249 return ( t == -1 ) ? t : t /= ( 10LL );
250 }
template<>

long long System::adjustTime< milliSec > | ( | long long | t | ) |
| inline

Definition at line 242 of file Timing.h.

243 {
244 return ( t == -1 ) ? t : t /= ( 1000 * 10 );
245 }
template<>

long long System::adjustTime< Min > | ( | long long | t | ) |
| inline

Definition at line 232 of file Timing.h.

233 {
234 return ( t == -1 ) ? t : t /= ( 60 * 1000 * 1000 * 10 );
235 }
template<>

long long System::adjustTime< Month > | ( | long long | t | ) |
| inline

Definition at line 257 of file Timing.h.

258 {
259 return ( t == -1 ) ? t : t /= ( 1LL * 30 * 24 * 60 * 60 * 1000 * 1000 * 10 );
260 }
template<>

long long System::adjustTime< nanoSec > | ( | long long | t | ) |
| inline

Definition at line 252 of file Timing.h.

253 {
254 return ( t == -1 ) ? t : t *= 100LL;
255 }
template<>

long long System::adjustTime< Native > | ( | long long | t | ) |
| inline

Definition at line 262 of file Timing.h.

263 {
264 return t;
265 }
template<>

long long System::adjustTime< Sec > | ( | long long | t | ) |
| inline

Definition at line 237 of file Timing.h.

238 {
239 return ( t == -1 ) ? t : t /= ( 1000 * 1000 * 10 );
240 }
template<>

long long System::adjustTime< Year > | ( | long long | t | ) |
| inline

Definition at line 217 of file Timing.h.

218 {
219 return ( t == -1 ) ? t : t /= ( 1LL * 365 * 24 * 60 * 60 * 1000 * 1000 * 10 );
220 }

long System::affinityMask | ( | InfoType | fetch = `ProcessBasics`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Affinity mask.

Definition at line 90 of file Memory.cpp.

91 {
92 PROCESS_BASIC_INFORMATION info;
93 if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.AffinityMask;
94 return 0;
95 }
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135
System::ProcessBasics
Definition: SystemBase.h:19

long System::argc | ( |  | ) |

Number of arguments passed to the commandline (==numCmdLineArgs()); just to match argv call...

Number of arguments passed to the commandline.

Definition at line 385 of file System.cpp.

385 { return cmdLineArgs().size(); }
std::vector::size
T size(T...args)
System::cmdLineArgs
GAUDI_API const std::vector< std::string > cmdLineArgs()
Command line arguments including executable name as arg[0] as vector of strings.
Definition: System.cpp:388

char ** System::argv | ( |  | ) |

char** command line arguments including executable name as arg[0]; You may not modify them!

Const char** command line arguments including executable name as arg[0].

Definition at line 395 of file System.cpp.

396 {
397 auto helperFunc = []( const std::vector<std::string>& args ) -> std::vector<const char*> {
398 std::vector<const char*> result;
399 std::transform( args.begin(), args.end(), std::back_inserter( result ),
400 []( const std::string& s ) { return s.c_str(); } );
401 return result;
402 };
403 static const std::vector<const char*> args = helperFunc( cmdLineArgs() );
404 // We rely here on the fact that a vector's allocation table is contiguous
405 return (char**)&( args[0] );
406 }
gaudirun.args
args
Definition: gaudirun.py:244
std::string
STL class.
std::vector< std::string >
std::back_inserter
T back_inserter(T...args)
gaudirun.s
string s
Definition: gaudirun.py:253
System::cmdLineArgs
GAUDI_API const std::vector< std::string > cmdLineArgs()
Command line arguments including executable name as arg[0] as vector of strings.
Definition: System.cpp:388
std::transform
T transform(T...args)

GAUDI_API int System::backTrace | ( | void ** | addresses,
|  | const int | depth
| ) |  |

bool System::backTrace | ( | std::string & | btrace,
|  | const int | depth,
|  | const int | offset = `0`
| ) |  |

Definition at line 478 of file System.cpp.

479 {
480 try {
481 // Always hide the first two levels of the stack trace (that's us)
482 const int totalOffset = offset + 2;
483 const int totalDepth = depth + totalOffset;
484
485 std::string fnc, lib;
486
487 std::vector<void*> addresses( totalDepth, nullptr );
488 int count = System::backTrace( addresses.data(), totalDepth );
489 for ( int i = totalOffset; i < count; ++i ) {
490 void* addr = nullptr;
491
492 if ( System::getStackLevel( addresses[i], addr, fnc, lib ) ) {
493 std::ostringstream ost;
494 ost << "#" << std::setw( 3 ) << std::setiosflags( std::ios::left ) << i - totalOffset + 1;
495 ost << std::hex << addr << std::dec << " " << fnc << " [" << lib << "]" << std::endl;
496 btrace += ost.str();
497 }
498 }
499 return true;
500 } catch ( const std::bad_alloc& e ) {
501 return false;
502 }
503 }
System::getStackLevel
GAUDI_API bool getStackLevel(void *addresses, void *&addr, std::string &fnc, std::string &lib)
std::endl
T endl(T...args)
std::setiosflags
T setiosflags(T...args)
System::backTrace
GAUDI_API int backTrace(void **addresses, const int depth)
std::setw
T setw(T...args)
std::string
STL class.
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
std::count
T count(T...args)
std::vector< void * >
std::bad_alloc
STL class.
std::hex
T hex(T...args)

long System::basePriority | ( | InfoType | fetch = `ProcessBasics`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Base priority.

Definition at line 67 of file Memory.cpp.

68 {
69 PROCESS_BASIC_INFORMATION info;
70 if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.BasePriority;
71 return 0;
72 }
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135
System::ProcessBasics
Definition: SystemBase.h:19

long System::breakExecution | ( |  | ) |

Break the execution of the application and invoke the debugger.

Definition at line 48 of file Debugger.cpp.

49 {
50 #ifdef _WIN32
51 _asm int 3 return 1;
52 #else
53 // I have no clue how to do this in linux
54 return 0;
55 #endif
56 }

long System::breakExecution | ( | long | pid | ) |

Break the execution of the application and invoke the debugger in a remote process.

Break the execution of the application and invoke the debugger on a possibly remote process.

Definition at line 59 of file Debugger.cpp.

60 {
61 #ifdef _WIN32
62 long result = 0;
63 if ( pid == Win::_getpid() ) {
64 _asm int 3 return 1;
65 } else {
66 Win::LPTHREAD_START_ROUTINE fun;
67 Win::HANDLE th, ph;
68 Win::HINSTANCE mh;
69 Win::DWORD id;
70 mh = Win::LoadLibrary( "Kernel32" );
71 if ( 0 != mh ) {
72 fun = (Win::LPTHREAD_START_ROUTINE)Win::GetProcAddress( mh, "DebugBreak" );
73 if ( 0 != fun ) {
74 ph = Win::OpenProcess( PROCESS_ALL_ACCESS, TRUE, pid );
75 if ( 0 != ph ) {
76 th = Win::CreateRemoteThread( ph, NULL, 0, fun, 0, 0, &id );
77 if ( 0 != th ) {
78 Win::CloseHandle( th );
79 result = 1;
80 }
81 Win::CloseHandle( ph );
82 }
83 }
84 Win::FreeLibrary( mh );
85 }
86 }
87 if ( result != 1 ) result = Win::GetLastError();
88 return result;
89 #else
90 // I have no clue how to do this in linux
91 return pid;
92 #endif
93 }
GaudiKernel.Constants.TRUE
bool TRUE
Definition: Constants.py:20
fun
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26

const std::vector< std::string > System::cmdLineArgs | ( |  | ) |

Command line arguments including executable name as arg[0] as vector of strings.

Const char** command line arguments including executable name as arg[0].

Command line arguments including executable name as arg[0] as vector of strings.

Definition at line 388 of file System.cpp.

389 {
390 static const std::vector<std::string> args = Platform::cmdLineArgs();
391 return args;
392 }
gaudirun.args
args
Definition: gaudirun.py:244
std::vector< std::string >
System::cmdLineArgs
GAUDI_API const std::vector< std::string > cmdLineArgs()
Command line arguments including executable name as arg[0] as vector of strings.
Definition: System.cpp:388

longlong System::cpuTime | ( | TimeType | typ = `milliSec`,
|  | InfoType | fetch = `Times`,
|  | long | pid = `-1`
| ) |  |

Consumed CPU time of process in milliseconds.

CPU kernel time of process in milliseconds.

Parameters

  typ | Indicator or the unit the time will be returned.
  fetch | Indicator of the information to be fetched. If Fetch_None, the information will not be updated.
  pid | Process ID of which the information will be returned

Returns
  Requested value in the indicated units.

Definition at line 196 of file Timing.cpp.

197 {
198 longlong cputime = 0;
199 KERNEL_USER_TIMES info;
200 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) {
201 cputime = adjustTime( typ, info.KernelTime + info.UserTime );
202 }
203 return cputime;
204 }
__longlong
Definition: Kernel.h:56
System::NoFetch
Definition: SystemBase.h:19
System::adjustTime
GAUDI_API longlong adjustTime(TimeType typ, longlong timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition: Timing.cpp:37
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

longlong System::creationTime | ( | TimeType | typ = `milliSec`,
|  | InfoType | fetch = `Times`,
|  | long | pid = `-1`
| ) |  |

Process Creation time.

Units of time between process creation and begin of epoche.

Parameters

  typ | Indicator or the unit the time will be returned.
  fetch | Indicator of the information to be fetched. If Fetch_None, the information will not be updated.
  pid | Process ID of which the information will be returned

Returns
  Requested value in the indicated units.

Definition at line 138 of file Timing.cpp.

139 {
140 longlong created = 0;
141 KERNEL_USER_TIMES info;
142 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) {
143 created = adjustTime( typ, info.CreateTime - UNIX_BASE_TIME );
144 }
145 return created;
146 }
__longlong
Definition: Kernel.h:56
System::NoFetch
Definition: SystemBase.h:19
System::adjustTime
GAUDI_API longlong adjustTime(TimeType typ, longlong timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition: Timing.cpp:37
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135
template<TimeType T>

GAUDI_API longlong System::currentTime | ( |  | ) |
| inline

Retrieve absolute system time.

Parameters

  typ | Indicator or the unit the time will be returned.

Returns
  Requested value in the indicated units.Get current time in specificed units via template parameter (inlined)

Definition at line 269 of file Timing.h.

270 {
271 #ifdef _WIN32
272 longlong current = 0;
273 ::GetSystemTimeAsFileTime( (FILETIME*)&current );
274 return adjustTime<T>( current - UNIX_BASE_TIME );
275 #else
276 struct timeval tv;
277 ::gettimeofday( &tv, 0 );
278 return adjustTime<T>( ( tv.tv_sec * 1000000 + tv.tv_usec ) * 10 );
279 #endif
280 }
__longlong
Definition: Kernel.h:56

longlong System::currentTime | ( | TimeType | typ = `milliSec` | ) |

Get current time in specificed units.

Retrieve current system time.

Definition at line 91 of file Timing.cpp.

92 {
93 switch ( typ ) {
94 case Year:
95 return currentTime<Year>();
96 case Month:
97 return currentTime<Month>();
98 case Day:
99 return currentTime<Day>();
100 case Hour:
101 return currentTime<Hour>();
102 case Min:
103 return currentTime<Min>();
104 case Sec:
105 return currentTime<Sec>();
106 case milliSec:
107 return currentTime<milliSec>();
108 case microSec:
109 return currentTime<microSec>();
110 case nanoSec:
111 return currentTime<nanoSec>();
112 case Native:
113 return currentTime<Native>();
114 }
115 return currentTime<Native>();
116 }
System::currentTime< milliSec >
template longlong currentTime< milliSec >()
System::currentTime< microSec >
template longlong currentTime< microSec >()
System::currentTime< Min >
template longlong currentTime< Min >()
System::currentTime< Month >
template longlong currentTime< Month >()
System::Min
Definition: Timing.h:58
System::Hour
Definition: Timing.h:58
System::milliSec
Definition: Timing.h:58
System::Sec
Definition: Timing.h:58
System::microSec
Definition: Timing.h:58
System::currentTime< Hour >
template longlong currentTime< Hour >()
System::currentTime< Day >
template longlong currentTime< Day >()
System::currentTime< Native >
template longlong currentTime< Native >()
System::Native
Definition: Timing.h:58
System::currentTime< nanoSec >
template longlong currentTime< nanoSec >()
System::Month
Definition: Timing.h:58
System::currentTime< Sec >
template longlong currentTime< Sec >()
System::nanoSec
Definition: Timing.h:58
System::Year
Definition: Timing.h:58
System::currentTime< Year >
template longlong currentTime< Year >()
System::Day
Definition: Timing.h:58
template<TimeType T>

longlong System::currentTime | ( |  | ) |
| inline

Retrieve absolute system time.

Parameters

  typ | Indicator or the unit the time will be returned.

Returns
  Requested value in the indicated units.Get current time in specificed units via template parameter (inlined)

Definition at line 269 of file Timing.h.

270 {
271 #ifdef _WIN32
272 longlong current = 0;
273 ::GetSystemTimeAsFileTime( (FILETIME*)&current );
274 return adjustTime<T>( current - UNIX_BASE_TIME );
275 #else
276 struct timeval tv;
277 ::gettimeofday( &tv, 0 );
278 return adjustTime<T>( ( tv.tv_sec * 1000000 + tv.tv_usec ) * 10 );
279 #endif
280 }
__longlong
Definition: Kernel.h:56

template longlong System::currentTime< Day > | ( |  | ) |

template longlong System::currentTime< Hour > | ( |  | ) |

template longlong System::currentTime< microSec > | ( |  | ) |

template longlong System::currentTime< milliSec > | ( |  | ) |

template longlong System::currentTime< Min > | ( |  | ) |

template longlong System::currentTime< Month > | ( |  | ) |

template longlong System::currentTime< nanoSec > | ( |  | ) |

template longlong System::currentTime< Native > | ( |  | ) |

template longlong System::currentTime< Sec > | ( |  | ) |

template longlong System::currentTime< Year > | ( |  | ) |

longlong System::ellapsedTime | ( | TimeType | typ = `milliSec`,
|  | InfoType | fetch = `Times`,
|  | long | pid = `-1`
| ) |  |

Elapsed time since start of process in milliseconds.

Ellapsed time since start of process in milliseconds.

Parameters

  typ | Indicator or the unit the time will be returned.
  timevalue | Time value to be converted.

Returns
  Requested value in the indicated units.

Definition at line 164 of file Timing.cpp.

165 {
166 KERNEL_USER_TIMES info;
167 longlong ellapsed = currentTime( microSec ) * 10;
168 getProcess()->query( pid, fetch, &info );
169 ellapsed = adjustTime( typ, ellapsed + UNIX_BASE_TIME - info.CreateTime );
170 return ellapsed;
171 }
System::microSec
Definition: Timing.h:58
__longlong
Definition: Kernel.h:56
System::currentTime
GAUDI_API longlong currentTime()
Retrieve absolute system time.
Definition: Timing.h:269
System::adjustTime
GAUDI_API longlong adjustTime(TimeType typ, longlong timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition: Timing.cpp:37
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135
System::ProcessDescriptor::query
long query(long pid, InfoType info, PROCESS_BASIC_INFORMATION *buffer)
Definition: ProcessDescriptor.cpp:587

System::ImageHandle System::exeHandle | ( |  | ) |

Handle to the executable file running.

Definition at line 173 of file ModuleInfo.cpp.

174 {
175 #ifdef _WIN32
176 if ( processHandle() ) {
177 static HINSTANCE handle = 0;
178 DWORD cbNeeded;
179 if ( 0 == handle && _psApi ) {
180 if ( _psApi.EnumProcessModules( processHandle(), &handle, sizeof( ModuleHandle ), &cbNeeded ) ) {
181 }
182 }
183 return handle;
184 }
185 return 0;
186 #elif defined( __linux ) || defined( __APPLE__ )
187 // This does NOT work!
188 static Dl_info infoBuf, *info = &infoBuf;
189 if ( !info ) {
190 void* handle = ::dlopen( nullptr, RTLD_LAZY );
191 // printf("Exe handle:%X\n", handle);
192 if ( handle ) {
193 void* func = ::dlsym( handle, "main" );
194 // printf("Exe:Func handle:%X\n", func);
195 if ( func ) {
196 if ( 0 != ::dladdr( func, &infoBuf ) ) {
197 // std::cout << "All OK" << std::endl;
198 info = &infoBuf;
199 }
200 }
201 }
202 }
203 return info;
204 #elif __hpux
205 // Don't know how to solve this .....
206 return 0;
207 #endif
208 }
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:128
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:229

const std::string & System::exeName | ( |  | ) |

Name of the executable file running.

Definition at line 210 of file ModuleInfo.cpp.

211 {
212 static std::string module( "" );
213 if ( module.length() == 0 ) {
214 char name[PATH_MAX] = {"Unknown.module"};
215 name[0] = 0;
216 #ifdef _WIN32
217 if ( _psApi && processHandle() ) {
218 _psApi.GetModuleFileNameExA( processHandle(), (HINSTANCE)exeHandle(), name, sizeof( name ) );
219 module = name;
220 }
221 #elif defined( __linux ) || defined( __APPLE__ )
222 char cmd[512];
223 ::sprintf( cmd, "/proc/%d/exe", ::getpid() );
224 module = "Unknown";
225 if (::readlink( cmd, name, sizeof( name ) ) >= 0 ) module = name;
226 #elif __hpux
227 if (::realpath( ( (HMODULE*)exeHandle() )->dsc.filename, name ) ) module = name;
228 #endif
229 }
230 return module;
231 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:128
std::string
STL class.
System::exeHandle
GAUDI_API ImageHandle exeHandle()
Handle to the executable file running.
Definition: ModuleInfo.cpp:173

long System::exitStatus | ( | InfoType | fetch = `ProcessBasics`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Exit status (does not really make sense for the running process, but for others!)

Definition at line 98 of file Memory.cpp.

99 {
100 PROCESS_BASIC_INFORMATION info;
101 if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.ExitStatus;
102 return -2;
103 }
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135
System::ProcessBasics
Definition: SystemBase.h:19

std::string System::getEnv | ( | const char * | var | ) |

get a particular environment variable (returning "UNKNOWN" if not set)

get a particular env var, return "UNKNOWN" if not defined

Definition at line 415 of file System.cpp.

416 {
417 char* env;
418 if ( ( env = getenv( var ) ) != nullptr ) {
419 return env;
420 } else {
421 return "UNKNOWN";
422 }
423 }
std::getenv
T getenv(T...args)

bool System::getEnv | ( | const char * | var,
|  | std::string & | value
| ) |  |

get a particular environment variable, storing the value in the passed string if the variable is set.

get a particular env var, storing the value in the passed string (if set)

Returns true if the variable is set, false otherwise.

Definition at line 426 of file System.cpp.

427 {
428 char* env;
429 if ( ( env = getenv( var ) ) != nullptr ) {
430 value = env;
431 return true;
432 } else {
433 return false;
434 }
435 }
std::getenv
T getenv(T...args)

bool System::getEnv | ( | const std::string & | var,
|  | std::string & | value
| ) |  |
| inline

Definition at line 91 of file System.h.

91 { return getEnv( var.c_str(), value ); }
System::getEnv
GAUDI_API std::vector< std::string > getEnv()
get all environment variables
Definition: System.cpp:444
std::string::c_str
T c_str(T...args)

std::vector< std::string > System::getEnv | ( |  | ) |

get all environment variables

get all defined environment vars

Definition at line 444 of file System.cpp.

445 {
446 #if defined( _WIN32 )
447 #define environ _environ
448 #elif defined( __APPLE__ )
449 static char** environ = *_NSGetEnviron();
450 #endif
451 std::vector<std::string> vars;
452 for ( int i = 0; environ[i] != nullptr; ++i ) {
453 vars.push_back( environ[i] );
454 }
455 return vars;
456 }
std::vector::push_back
T push_back(T...args)
std::vector< std::string >

const std::string System::getErrorString | ( | unsigned long | error | ) |

Retrieve error code as string for a given error.

Definition at line 305 of file System.cpp.

306 {
307 std::string errString = "";
308 #ifdef _WIN32
309 LPVOID lpMessageBuffer;
310 ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error,
311 MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // The user default language
312 (LPTSTR)&lpMessageBuffer, 0, NULL );
313 errString = (const char*)lpMessageBuffer;
314 // Free the buffer allocated by the system
315 ::LocalFree( lpMessageBuffer );
316 #else
317 char* cerrString( nullptr );
318 // Remember: for linux dl* routines must be handled differently!
319 if ( error == 0xAFFEDEAD ) {
320 cerrString = (char*)::dlerror();
321 if ( !cerrString ) cerrString = ::strerror( error );
322 if ( !cerrString ) {
323 cerrString = (char*)"Unknown error. No information found in strerror()!";
324 } else {
325 errString = std::string( cerrString );
326 }
327 errno = 0;
328 } else {
329 cerrString = ::strerror( error );
330 errString = std::string( cerrString );
331 }
332 #endif
333 return errString;
334 }
std::string
STL class.

unsigned long System::getLastError | ( |  | ) |

Get last system known error.

Retrieve last error code.

Definition at line 287 of file System.cpp.

288 {
289 #ifdef _WIN32
290 return ::GetLastError();
291 #else
292 // convert errno (int) to unsigned long
293 return static_cast<unsigned long>( static_cast<unsigned int>( errno ) );
294 #endif
295 }

const std::string System::getLastErrorString | ( |  | ) |

Get last system error as string.

Retrieve last error code as string.

Definition at line 298 of file System.cpp.

299 {
300 const std::string errString = getErrorString( getLastError() );
301 return errString;
302 }
System::getErrorString
GAUDI_API const std::string getErrorString(unsigned long error)
Retrieve error code as string for a given error.
Definition: System.cpp:305
System::getLastError
GAUDI_API unsigned long getLastError()
Get last system known error.
Definition: System.cpp:287
std::string
STL class.

unsigned long System::getProcedureByName | ( | ImageHandle | handle,
|  | const std::string & | name,
|  | EntryPoint * | pFunction
| ) |  |

Get a specific function defined in the DLL.

Definition at line 230 of file System.cpp.

231 {
232 #ifdef _WIN32
233 *pFunction = ( EntryPoint )::GetProcAddress( (HINSTANCE)handle, name.data() );
234 if ( 0 == *pFunction ) {
235 return System::getLastError();
236 }
237 return 1;
238 #elif defined( __linux )
239 #if __GNUC__ < 4
240 *pFunction = ( EntryPoint )::dlsym( handle, name.c_str() );
241 #else
242 *pFunction = FuncPtrCast<EntryPoint>(::dlsym( handle, name.c_str() ) );
243 #endif
244 if ( !*pFunction ) {
245 errno = 0xAFFEDEAD;
246 // std::cout << "System::getProcedureByName>" << getLastErrorString() << std::endl;
247 return 0;
248 }
249 return 1;
250 #elif defined( __APPLE__ )
251 *pFunction = ( EntryPoint )::dlsym( handle, name.c_str() );
252 if ( !( *pFunction ) ) {
253 // Try with an underscore :
254 std::string sname = "_" + name;
255 *pFunction = ( EntryPoint )::dlsym( handle, sname.c_str() );
256 }
257 if ( 0 == *pFunction ) {
258 errno = 0xAFFEDEAD;
259 std::cout << "System::getProcedureByName>" << getLastErrorString() << std::endl;
260 // std::cout << "System::getProcedureByName> failure" << std::endl;
261 return 0;
262 }
263 return 1;
264 #elif __hpux
265 HMODULE* mod = (HMODULE*)handle;
266 if ( 0 != mod ) {
267 long ll1 = name.length();
268 for ( int i = 0; i < mod->numSym; i++ ) {
269 long ll2 = strlen( mod->sym[i].name );
270 if ( 0 != ::strncmp( mod->sym[i].name, name.c_str(), ( ll1 > ll2 ) ? ll1 : ll2 ) == 0 ) {
271 *pFunction = (EntryPoint)mod->sym[i].value;
272 return 1;
273 }
274 }
275 }
276 return 0;
277 #endif
278 }
System::getLastError
GAUDI_API unsigned long getLastError()
Get last system known error.
Definition: System.cpp:287
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
Gaudi.CommonGaudiConfigurables.mod
mod
Definition: CommonGaudiConfigurables.py:22
std::endl
T endl(T...args)
std::string
STL class.
std::string::data
T data(T...args)
std::strlen
T strlen(T...args)
compareOutputFiles.sname
sname
Definition: compareOutputFiles.py:443
std::string::length
T length(T...args)
std::strncmp
T strncmp(T...args)
std::string::c_str
T c_str(T...args)
System::getLastErrorString
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
Definition: System.cpp:298
std::cout
System::EntryPoint
unsigned long(* EntryPoint)(const unsigned long iid, void **ppvObject)
Definition of the "generic" DLL entry point function.
Definition: System.h:36

unsigned long System::getProcedureByName | ( | ImageHandle | handle,
|  | const std::string & | name,
|  | Creator * | pFunction
| ) |  |

Get a specific function defined in the DLL.

Definition at line 281 of file System.cpp.

282 {
283 return getProcedureByName( handle, name, (EntryPoint*)pFunction );
284 }
System::getProcedureByName
GAUDI_API unsigned long getProcedureByName(ImageHandle handle, const std::string &name, EntryPoint *pFunction)
Get a specific function defined in the DLL.
Definition: System.cpp:230
System::EntryPoint
unsigned long(* EntryPoint)(const unsigned long iid, void **ppvObject)
Definition of the "generic" DLL entry point function.
Definition: System.h:36

ProcessDescriptor * System::getProcess | ( |  | ) |
| inline

Retrieve Process structure.

Definition at line 135 of file ProcessDescriptor.h.

136 {
137 static ProcessDescriptor p;
138 return &p;
139 }

ProcessTime System::getProcessTime | ( | long | pid = `-1` | ) |

Retrieve the process time data for a process.

Get the process time data for a process (by default the current) as a `ProcessTime` object.

Definition at line 208 of file Timing.cpp.

209 {
210 KERNEL_USER_TIMES info;
211 if ( getProcess()->query( pid, Times, &info ) ) {
212 return ProcessTime( info.KernelTime, info.UserTime, currentTime<Native>() - info.CreateTime );
213 }
214 return ProcessTime(); // return 0s in case of problems
215 }
System::Times
Definition: SystemBase.h:19
System::currentTime< Native >
template longlong currentTime< Native >()
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

GAUDI_API bool System::getStackLevel | ( | void * | addresses,
|  | void *& | addr,
|  | std::string & | fnc,
|  | std::string & | lib
| ) |  |

std::string System::homeDirectory | ( |  | ) |

Definition at line 61 of file Environment.cpp.

62 {
63 // Return the user's home directory.
64 std::string home_dir = "./";
65 // Try to replace the current value with the content of several
66 // environment variables
67 if ( !( System::getEnv( "home", home_dir ) || System::getEnv( "HOME", home_dir ) ) ) {
68 // for Windows NT HOME might be defined as either $(HOMESHARE)/$(HOMEPATH)
69 // or $(HOMEDRIVE)/$(HOMEPATH)
70 if ( System::getEnv( "HOMESHARE", home_dir ) || System::getEnv( "HOMEDRIVE", home_dir ) ) {
71 std::string path;
72 if ( System::getEnv( "HOMEPATH", path ) ) home_dir += path;
73 }
74 }
75 return home_dir;
76 }
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:415
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
std::string
STL class.

const std::string & System::hostName | ( |  | ) |

Host name.

Host name.

Definition at line 341 of file System.cpp.

342 {
343 static const std::string host = Platform::hostName();
344 return host;
345 }
std::string
STL class.
System::hostName
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:341

int System::instructionsetLevel | ( |  | ) |

Instruction Set "Level".

Definition at line 368 of file System.cpp.

369 {
370 using namespace Gaudi;
371 return instrset_detect();
372 }
instrset_detect
int instrset_detect(void)
Definition: instrset_detect.cpp:101
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1

bool System::isEnvSet | ( | const char * | var | ) |

Check if an environment variable is set or not.

Definition at line 437 of file System.cpp.

437 { return getenv( var ) != nullptr; }
std::getenv
T getenv(T...args)

longlong System::kernelTime | ( | TimeType | typ = `milliSec`,
|  | InfoType | fetch = `Times`,
|  | long | pid = `-1`
| ) |  |

CPU kernel mode time of process in milliseconds.

CPU kernel time of process in milliseconds.

Parameters

  typ | Indicator or the unit the time will be returned.
  fetch | Indicator of the information to be fetched. If Fetch_None, the information will not be updated.
  pid | Process ID of which the information will be returned

Returns
  Requested value in the indicated units.

Definition at line 174 of file Timing.cpp.

175 {
176 KERNEL_USER_TIMES info;
177 longlong kerneltime = 0;
178 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) {
179 kerneltime = adjustTime( typ, info.KernelTime );
180 }
181 return kerneltime;
182 }
__longlong
Definition: Kernel.h:56
System::NoFetch
Definition: SystemBase.h:19
System::adjustTime
GAUDI_API longlong adjustTime(TimeType typ, longlong timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition: Timing.cpp:37
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

const std::vector< std::string > System::linkedModules | ( |  | ) |

Vector of names of linked modules.

Definition at line 233 of file ModuleInfo.cpp.

234 {
235 if ( s_linkedModules.size() == 0 ) {
236 #ifdef _WIN32
237 char name[255]; // Maximum file name length on NT 4.0
238 DWORD cbNeeded;
239 HINSTANCE handle[1024];
240 if ( _psApi ) {
241 if ( _psApi.EnumProcessModules( processHandle(), handle, sizeof( handle ), &cbNeeded ) ) {
242 for ( size_t i = 0; i < cbNeeded / sizeof( HANDLE ); i++ ) {
243 if ( 0 < _psApi.GetModuleFileNameExA( processHandle(), handle[i], name, sizeof( name ) ) ) {
244 s_linkedModules.push_back( name );
245 }
246 }
247 }
248 }
249 #elif defined( __linux ) || defined( __APPLE__ )
250 char ff[512], cmd[1024], fname[1024], buf1[64], buf2[64], buf3[64], buf4[64];
251 ::sprintf( ff, "/proc/%d/maps", ::getpid() );
252 FILE* maps = ::fopen( ff, "r" );
253 while (::fgets( cmd, sizeof( cmd ), maps ) ) {
254 int len;
255 sscanf( cmd, "%s %s %s %s %d %s", buf1, buf2, buf3, buf4, &len, fname );
256 if ( len > 0 && strncmp( buf2, "r-xp", strlen( "r-xp" ) ) == 0 ) {
257 s_linkedModules.push_back( fname );
258 }
259 }
260 ::fclose( maps );
261 #endif
262 }
263 return s_linkedModules;
264 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
std::sscanf
T sscanf(T...args)
std::fgets
T fgets(T...args)
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:128
std::vector::push_back
T push_back(T...args)
std::strlen
T strlen(T...args)
root_map_dump.maps
maps
Definition: root_map_dump.py:57
std::vector::size
T size(T...args)
std::strncmp
T strncmp(T...args)

unsigned long System::loadDynamicLib | ( | const std::string & | name,
|  | ImageHandle * | handle
| ) |  |

Load dynamic link library.

Definition at line 154 of file System.cpp.

155 {
156 unsigned long res = 0;
157 // if name is empty, just load it
158 if ( name.length() == 0 ) {
159 res = loadWithoutEnvironment( name, handle );
160 } else {
161 // If the name is a logical name (environment variable), the try
162 // to load the corresponding library from there.
163 std::string imgName;
164 if ( getEnv( name, imgName ) ) {
165 res = loadWithoutEnvironment( imgName, handle );
166 } else {
167 // build the dll name
168 std::string dllName = name;
169 // Add a possible "lib" prefix to the name on unix platforms. But only if
170 // it's not an absolute path name.
171 #if defined( __linux ) || defined( __APPLE__ )
172 if ( ( dllName.find( '/' ) == std::string::npos ) && ( dllName.compare( 0, 3, "lib" ) != 0 ) ) {
173 dllName = "lib" + dllName;
174 }
175 #endif // unix
176 // Now try loading the library with all possible suffixes supported by the
177 // platform.
178 for ( const char* suffix : SHLIB_SUFFIXES ) {
179 // Add the suffix if necessary.
180 std::string libName = dllName;
181 const size_t len = strlen( suffix );
182 if ( dllName.compare( dllName.length() - len, len, suffix ) != 0 ) {
183 libName += suffix;
184 }
185 // Try to load the library.
186 res = loadWithoutEnvironment( libName, handle );
187 // If the load succeeded, stop here.
188 if ( res == 1 ) {
189 break;
190 }
191 }
192 }
193 if ( res != 1 ) {
194 #if defined( __linux ) || defined( __APPLE__ )
195 errno = 0xAFFEDEAD;
196 #endif
197 // std::cout << "System::loadDynamicLib>" << getLastErrorString() << std::endl;
198 }
199 }
200 return res;
201 }
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:415
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
std::string
STL class.
std::strlen
T strlen(T...args)
std::string::find
T find(T...args)
std::string::length
T length(T...args)
std::string::compare
T compare(T...args)

const std::string & System::machineType | ( |  | ) |

Machine type.

Machine type.

Definition at line 362 of file System.cpp.

363 {
364 static const std::string mach = Platform::machineType();
365 return mach;
366 }
std::string
STL class.
System::machineType
GAUDI_API const std::string & machineType()
Machine type.
Definition: System.cpp:362

long System::mappedMemory | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: priority boost.

Definition at line 204 of file Memory.cpp.

205 {
206 VM_COUNTERS info;
207 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.WorkingSetSize );
208 return -2;
209 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::mappedMemoryPeak | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: priority boost.

Definition at line 212 of file Memory.cpp.

213 {
214 VM_COUNTERS info;
215 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
216 return adjustMemory( unit, info.PeakWorkingSetSize );
217 return -2;
218 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::maxMemoryLimit | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Quota`,
|  | long | pid = `-1`
| ) |  |

System Process Limits: Maximum amount of virtual memory this process is allowed to use.

Definition at line 230 of file Memory.cpp.

231 {
232 QUOTA_LIMITS quota;
233 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
234 return adjustMemory( unit, quota.MaximumWorkingSetSize );
235 return 0;
236 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::minMemoryLimit | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Quota`,
|  | long | pid = `-1`
| ) |  |

System Process Limits: Minimum amount of virtual memory this process may use.

Definition at line 221 of file Memory.cpp.

222 {
223 QUOTA_LIMITS quota;
224 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
225 return adjustMemory( unit, quota.MinimumWorkingSetSize );
226 return 0;
227 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

System::ImageHandle System::moduleHandle | ( |  | ) |

Handle to currently executed module.

Definition at line 141 of file ModuleInfo.cpp.

142 {
143 if ( !ModuleHandle ) {
144 if ( processHandle() ) {
145 #ifdef _WIN32
146 static HINSTANCE handle = 0;
147 DWORD cbNeeded;
148 if ( 0 == handle && _psApi ) {
149 if ( _psApi.EnumProcessModules( processHandle(), &handle, sizeof( ModuleHandle ), &cbNeeded ) ) {
150 }
151 }
152 return handle;
153 #elif defined( __linux ) || defined( __APPLE__ )
154 static Dl_info info;
155 if ( 0 != ::dladdr(
156 #if __GNUC__ < 4
157 (void*)System::moduleHandle
158 #else
159 FuncPtrCast<void*>( System::moduleHandle )
160 #endif
161 ,
162 &info ) ) {
163 return &info;
164 }
165 #elif __hpux
166 return 0; // Don't know how to solve this .....
167 #endif
168 }
169 }
170 return ModuleHandle;
171 }
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:128
System::moduleHandle
GAUDI_API ImageHandle moduleHandle()
Handle to currently executed module.
Definition: ModuleInfo.cpp:141

const std::string & System::moduleName | ( |  | ) |

Get the name of the (executable/DLL) file without file-type.

Retrieve base name of module.

Definition at line 54 of file ModuleInfo.cpp.

55 {
56 static std::string module( "" );
57 if ( module == "" ) {
58 if ( processHandle() && moduleHandle() ) {
59 #ifdef _WIN32
60 char moduleName[256] = {"Unknown.module"};
61 moduleName[0] = 0;
62 if ( _psApi ) {
63 _psApi.GetModuleBaseNameA( processHandle(), (HINSTANCE)moduleHandle(), moduleName, sizeof( moduleName ) );
64 }
65 std::string mod = moduleName;
66 #elif defined( __linux ) || defined( __APPLE__ )
67 std::string mod = ::basename( (char*)( (Dl_info*)moduleHandle() )->dli_fname );
68 #elif __hpux
69 std::string mod = ::basename( ( (HMODULE*)moduleHandle() )->dsc.filename );
70 #endif
71 module = mod.substr( 0, mod.rfind( '.' ) );
72 }
73 }
74 return module;
75 }
std::string::rfind
T rfind(T...args)
Gaudi.CommonGaudiConfigurables.mod
mod
Definition: CommonGaudiConfigurables.py:22
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:128
std::string
STL class.
System::moduleHandle
GAUDI_API ImageHandle moduleHandle()
Handle to currently executed module.
Definition: ModuleInfo.cpp:141
System::moduleName
GAUDI_API const std::string & moduleName()
Get the name of the (executable/DLL) file without file-type.
Definition: ModuleInfo.cpp:54
std::string::substr
T substr(T...args)
svn_tag_release.basename
def basename(url)
Definition: svn_tag_release.py:28

const std::string & System::moduleNameFull | ( |  | ) |

Get the full name of the (executable/DLL) file.

Retrieve full name of module.

Definition at line 78 of file ModuleInfo.cpp.

79 {
80 static std::string module( "" );
81 if ( module == "" ) {
82 if ( processHandle() && moduleHandle() ) {
83 char name[PATH_MAX] = {"Unknown.module"};
84 name[0] = 0;
85 #ifdef _WIN32
86 if ( _psApi ) {
87 _psApi.GetModuleFileNameExA( processHandle(), (HINSTANCE)moduleHandle(), name, sizeof( name ) );
88 module = name;
89 }
90 #else
91 const char* path =
92 #if defined( __linux ) || defined( __APPLE__ )
93 ( (Dl_info*)moduleHandle() )->dli_fname;
94 #elif __hpux
95 ( (HMODULE*)moduleHandle() )->dsc.filename;
96 #endif
97 if (::realpath( path, name ) ) module = name;
98 #endif
99 }
100 }
101 return module;
102 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:128
std::string
STL class.
System::moduleHandle
GAUDI_API ImageHandle moduleHandle()
Handle to currently executed module.
Definition: ModuleInfo.cpp:141

System::ModuleType System::moduleType | ( |  | ) |

Get type of the module.

Definition at line 105 of file ModuleInfo.cpp.

106 {
107 static ModuleType type = UNKNOWN;
108 if ( type == UNKNOWN ) {
109 const std::string& module = moduleNameFull();
110 int loc = module.rfind( '.' ) + 1;
111 if ( loc == 0 )
112 type = EXECUTABLE;
113 else if ( module[loc] == 'e' || module[loc] == 'E' )
114 type = EXECUTABLE;
115 #ifdef _WIN32
116 else if ( module[loc] == 'd' || module[loc] == 'D' )
117 #else
118 else if ( module[loc] == 's' && module[loc + 1] == 'o' )
119 #endif
120 type = SHAREDLIB;
121 else
122 type = UNKNOWN;
123 }
124 return type;
125 }
System::SHAREDLIB
Definition: ModuleInfo.h:29
System::moduleNameFull
GAUDI_API const std::string & moduleNameFull()
Get the full name of the (executable/DLL) file.
Definition: ModuleInfo.cpp:78
std::string::rfind
T rfind(T...args)
std::string
STL class.
gaudirun.type
type
Definition: gaudirun.py:133
System::ModuleType
ModuleType
Definition: ModuleInfo.h:29
System::EXECUTABLE
Definition: ModuleInfo.h:29
Io::UNKNOWN
Definition: IFileMgr.h:157

long System::nonPagedMemory | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Current usage of non paged memory.

Basic Process Information: priority boost.

Definition at line 123 of file Memory.cpp.

124 {
125 VM_COUNTERS info;
126 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
127 return adjustMemory( unit, info.QuotaNonPagedPoolUsage );
128 return -2;
129 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::nonPagedMemoryLimit | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Quota`,
|  | long | pid = `-1`
| ) |  |

System Process Limits: Maximum amount of non-paged memory this process is allowed to use.

Definition at line 132 of file Memory.cpp.

133 {
134 POOLED_USAGE_AND_LIMITS quota;
135 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
136 return adjustMemory( unit, quota.NonPagedPoolLimit );
137 return 0;
138 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::nonPagedMemoryPeak | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Peak usage of non paged memory.

Basic Process Information: priority boost.

Definition at line 114 of file Memory.cpp.

115 {
116 VM_COUNTERS info;
117 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
118 return adjustMemory( unit, info.QuotaPeakNonPagedPoolUsage );
119 return -2;
120 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::numCmdLineArgs | ( |  | ) |

Number of arguments passed to the commandline.

Definition at line 382 of file System.cpp.

382 { return cmdLineArgs().size(); }
std::vector::size
T size(T...args)
System::cmdLineArgs
GAUDI_API const std::vector< std::string > cmdLineArgs()
Command line arguments including executable name as arg[0] as vector of strings.
Definition: System.cpp:388

long System::numPageFault | ( | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Number of page faults.

Basic Process Information: priority boost.

Definition at line 168 of file Memory.cpp.

169 {
170 VM_COUNTERS info;
171 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return info.PageFaultCount;
172 return -2;
173 }
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

const std::string & System::osName | ( |  | ) |

OS name.

OS name.

Definition at line 348 of file System.cpp.

349 {
350 static const std::string osname = Platform::osName();
351 return osname;
352 }
std::string
STL class.
System::osName
GAUDI_API const std::string & osName()
OS name.
Definition: System.cpp:348

const std::string & System::osVersion | ( |  | ) |

OS version.

OS version.

Definition at line 355 of file System.cpp.

356 {
357 static const std::string osver = Platform::osVersion();
358 return osver;
359 }
std::string
STL class.
System::osVersion
GAUDI_API const std::string & osVersion()
OS version.
Definition: System.cpp:355

long System::pagedMemory | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Amount of paged memory currently occupied by the process 'pid'.

Definition at line 141 of file Memory.cpp.

142 {
143 VM_COUNTERS info;
144 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
145 return adjustMemory( unit, info.QuotaPagedPoolUsage );
146 return -2;
147 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::pagedMemoryLimit | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Quota`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Amount of paged memory that can be occupied by the process 'pid'.

Definition at line 159 of file Memory.cpp.

160 {
161 POOLED_USAGE_AND_LIMITS quota;
162 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
163 return adjustMemory( unit, quota.PagedPoolLimit );
164 return 0;
165 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::pagedMemoryPeak | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Maximum of paged memory occupied by the process 'pid'.

Definition at line 150 of file Memory.cpp.

151 {
152 VM_COUNTERS info;
153 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
154 return adjustMemory( unit, info.QuotaPeakPagedPoolUsage );
155 return -2;
156 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::pagefileUsage | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Current page file usage.

Basic Process Information: priority boost.

Definition at line 176 of file Memory.cpp.

177 {
178 VM_COUNTERS info;
179 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.PagefileUsage );
180 return -2;
181 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::pagefileUsageLimit | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Quota`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Peak usage of page file.

Basic Process Information: priority boost.

Definition at line 193 of file Memory.cpp.

194 {
195 POOLED_USAGE_AND_LIMITS quota;
196 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) ) {
197 if ( long( quota.PagefileLimit ) < 0 ) return -1; // LONG_MAX;
198 return adjustMemory( unit, quota.PagefileLimit );
199 }
200 return -2;
201 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::pagefileUsagePeak | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Peak usage of page file.

Basic Process Information: priority boost.

Definition at line 184 of file Memory.cpp.

185 {
186 VM_COUNTERS info;
187 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
188 return adjustMemory( unit, info.PeakPagefileUsage );
189 return -2;
190 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::parentID | ( | InfoType | fetch = `ProcessBasics`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: Parent's process ID.

Definition at line 82 of file Memory.cpp.

83 {
84 PROCESS_BASIC_INFORMATION info;
85 if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.InheritedFromUniqueProcessId;
86 return 0;
87 }
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135
System::ProcessBasics
Definition: SystemBase.h:19

std::string System::PathResolverFindDataFile | ( | const std::string & | logical_file_name | ) |

Definition at line 207 of file PathResolver.cpp.

208 {
209 return PathResolver::find_file( logical_file_name, "DATAPATH" );
210 }

std::string System::PathResolverFindXMLFile | ( | const std::string & | logical_file_name | ) |

Definition at line 202 of file PathResolver.cpp.

203 {
204 return PathResolver::find_file( logical_file_name, "XMLPATH" );
205 }

long System::priorityBoost | ( | InfoType | fetch = `PriorityBoost`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: priority boost.

Definition at line 106 of file Memory.cpp.

107 {
108 long info;
109 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return info;
110 return -2;
111 }
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

void * System::processHandle | ( |  | ) |

Handle to running process.

Retrieve processhandle.

Definition at line 128 of file ModuleInfo.cpp.

129 {
130 static long pid = ::getpid();
131 #ifdef _WIN32
132 static HANDLE hP = ::OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid );
133 #else
134 static void* hP = (void*)pid;
135 #endif
136 return hP;
137 }
GaudiKernel.Constants.FALSE
bool FALSE
Definition: Constants.py:21

long System::procID | ( |  | ) |

Basic Process Information: Process ID.

Definition at line 75 of file Memory.cpp.

76 {
77 static const long s_pid = ::getpid();
78 return s_pid;
79 }

longlong System::remainingTime | ( | TimeType | typ = `milliSec`,
|  | InfoType | fetch = `Quota`,
|  | long | pid = `-1`
| ) |  |

Maximum processing time left for this process.

System Process Limits: Maximum processing time left for this process.

Parameters

  typ | Indicator or the unit the time will be returned.
  fetch | Indicator of the information to be fetched. If Fetch_None, the information will not be updated.
  pid | Process ID of which the information will be returned

Returns
  Requested value in the indicated units.

Definition at line 149 of file Timing.cpp.

150 {
151 longlong left = 0;
152 QUOTA_LIMITS quota;
153 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) ) {
154 if ( left == -1 ) {
155 // left = _I64_MAX;
156 } else {
157 left = adjustTime( typ, quota.TimeLimit );
158 }
159 }
160 return left;
161 }
std::left
T left(T...args)
__longlong
Definition: Kernel.h:56
System::NoFetch
Definition: SystemBase.h:19
System::adjustTime
GAUDI_API longlong adjustTime(TimeType typ, longlong timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition: Timing.cpp:37
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

StatusCode System::resolveEnv | ( | const std::string & | var,
|  | std::string & | res,
|  | int | recusions = `124`
| ) |  |

Definition at line 51 of file Environment.cpp.

52 {
53 std::string source = var;
54 res = i_resolve( source, recursions );
55 if ( res.find( "${" ) == std::string::npos ) {
56 return StatusCode::SUCCESS;
57 }
58 return StatusCode::FAILURE;
59 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
std::string
STL class.
std::string::find
T find(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:29

int System::setEnv | ( | const std::string & | name,
|  | const std::string & | value,
|  | int | overwrite = `1`
| ) |  |

Set an environment variables.

set an environment variables.

If value is empty, the variable is removed from the environment. When overwrite is 0, the variable is not set if already present. Returns 0 on success, -1 on failure. See man 3 setenv.

Returns
  0 if successful, -1 if not

Definition at line 538 of file System.cpp.

539 {
540 #ifndef WIN32
541 // UNIX version
542 return value.empty() ?
543 // remove if set to nothing (and return success)
544 ::unsetenv( name.c_str() ),
545 0 :
546 // set the value
547 ::setenv( name.c_str(), value.c_str(), overwrite );
548 #else
549 // Windows version
550 if ( value.empty() ) {
551 // equivalent to unsetenv
552 return ::_putenv( ( name + "=" ).c_str() );
553 } else {
554 if ( !getenv( name.c_str() ) || overwrite ) {
555 // set if not yet present or overwrite is set (force)
556 return ::_putenv( ( name + "=" + value ).c_str() );
557 }
558 }
559 return 0; // if we get here, we are trying to set a variable already set, but
560 // not to overwrite.
561 // It is considered a success on Linux (man P setenv)
562 #endif
563 }
std::string::empty
T empty(T...args)
std::getenv
T getenv(T...args)
std::string::c_str
T c_str(T...args)

void System::setModuleHandle | ( | System::ImageHandle | handle | ) |

Attach module handle.

Definition at line 139 of file ModuleInfo.cpp.

139 { ModuleHandle = handle; }

longlong System::systemStart | ( | TimeType | typ = `Sec` | ) |

Maximum processing time left for this process.

Units of time since system startup and begin of epoche.

Parameters

  typ | Indicator or the unit the time will be returned.

Returns
  Requested value in the indicated units.

Definition at line 119 of file Timing.cpp.

120 {
121 static longlong sys_start = 0;
122 if ( 0 == sys_start ) {
123 longlong c = currentTime( microSec );
124 longlong t = tickCount();
125 sys_start = 10 * c - t;
126 }
127 return adjustTime( typ, sys_start );
128 }
gaudirun.c
c
Definition: gaudirun.py:407
System::tickCount
GAUDI_API longlong tickCount()
Retrieve the number of ticks since system startup.
Definition: Timing.cpp:76
System::microSec
Definition: Timing.h:58
__longlong
Definition: Kernel.h:56
System::currentTime
GAUDI_API longlong currentTime()
Retrieve absolute system time.
Definition: Timing.h:269
System::adjustTime
GAUDI_API longlong adjustTime(TimeType typ, longlong timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition: Timing.cpp:37

std::string System::tempDirectory | ( |  | ) |

Definition at line 78 of file Environment.cpp.

79 {
80 // Return a user configured or systemwide directory to create
81 // temporary files in.
82 std::string dir;
83 if ( System::getEnv( "TEMP", dir ) || System::getEnv( "TEMPDIR", dir ) || System::getEnv( "TEMP_DIR", dir ) ||
84 System::getEnv( "TMP", dir ) || System::getEnv( "TMPDIR", dir ) || System::getEnv( "TMP_DIR", dir ) )
85 return dir;
86 else
87 return homeDirectory();
88 }
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:415
System::homeDirectory
GAUDI_API std::string homeDirectory()
Definition: Environment.cpp:61
std::string
STL class.

ThreadHandle System::threadSelf | ( |  | ) |
| inline

thread handle "accessor"

Definition at line 111 of file System.h.

111 { return (void*)0; }

longlong System::tickCount | ( |  | ) |

Retrieve the number of ticks since system startup.

Returns
  Requested value in the indicated units.

Definition at line 76 of file Timing.cpp.

77 {
78 longlong count = 10000;
79 #ifdef _WIN32
80 count *= ::GetTickCount(); // Number of milliSec since system startup
81 #else
82 struct tms buf;
83 count *= 10 * times( &buf );
84 #endif
85 return count;
86 }
__longlong
Definition: Kernel.h:56
std::count
T count(T...args)

const std::string System::typeinfoName | ( | const std::type_info & | tinfo | ) |

Get platform independent information about the class type.

Definition at line 336 of file System.cpp.

336 { return typeinfoName( tinfo.name() ); }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:336
std::type_info::name
T name(T...args)

const std::string System::typeinfoName | ( | const char * | class_name | ) |

Get the human readable type name from a typeinfo name.

Definition at line 338 of file System.cpp.

338 { return Platform::typeinfoName( class_name ); }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:336

unsigned long System::unloadDynamicLib | ( | ImageHandle | handle | ) |

unload dynamic link library

Definition at line 204 of file System.cpp.

205 {
206 #ifdef _WIN32
207 if ( !::FreeLibrary( (HINSTANCE)handle ) ) {
208 #elif defined( __linux ) || defined( __APPLE__ )
209 ::dlclose( handle );
210 if ( 0 ) {
211 #elif __hpux
212 // On HP we have to run finalization ourselves.....
213 Creator pFinalize = 0;
214 if ( getProcedureByName( handle, "_fini", &pFinalize ) ) {
215 pFinalize();
216 }
217 HMODULE* mod = (HMODULE*)handle;
218 if ( 0 == ::shl_unload( mod->dsc.handle ) ) {
219 delete mod;
220 } else {
221 #else
222 if ( false ) {
223 #endif
224 return getLastError();
225 }
226 return 1;
227 }
System::getLastError
GAUDI_API unsigned long getLastError()
Get last system known error.
Definition: System.cpp:287
System::getProcedureByName
GAUDI_API unsigned long getProcedureByName(ImageHandle handle, const std::string &name, EntryPoint *pFunction)
Get a specific function defined in the DLL.
Definition: System.cpp:230
Gaudi.CommonGaudiConfigurables.mod
mod
Definition: CommonGaudiConfigurables.py:22
System::Creator
void *(* Creator)()
Definition of the "generic" DLL entry point function.
Definition: System.h:38

longlong System::upTime | ( | TimeType | typ = `Hour` | ) |

Maximum processing time left for this process.

Units of time since system startup in requested units.

Parameters

  typ | Indicator or the unit the time will be returned.

Returns
  Requested value in the indicated units.

Definition at line 131 of file Timing.cpp.

132 {
133 static longlong sys_start = 10 * systemStart( microSec );
134 return adjustTime( typ, 10 * currentTime( microSec ) - sys_start );
135 }
System::systemStart
GAUDI_API longlong systemStart(TimeType typ=Sec)
Maximum processing time left for this process.
Definition: Timing.cpp:119
System::microSec
Definition: Timing.h:58
__longlong
Definition: Kernel.h:56
System::currentTime
GAUDI_API longlong currentTime()
Retrieve absolute system time.
Definition: Timing.h:269
System::adjustTime
GAUDI_API longlong adjustTime(TimeType typ, longlong timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition: Timing.cpp:37

longlong System::userTime | ( | TimeType | typ = `milliSec`,
|  | InfoType | fetch = `Times`,
|  | long | pid = `-1`
| ) |  |

CPU user mode time of process in milliseconds.

CPU kernel time of process in milliseconds.

Parameters

  typ | Indicator or the unit the time will be returned.
  fetch | Indicator of the information to be fetched. If Fetch_None, the information will not be updated.
  pid | Process ID of which the information will be returned

Returns
  Requested value in the indicated units.

Definition at line 185 of file Timing.cpp.

186 {
187 longlong usertime = 0;
188 KERNEL_USER_TIMES info;
189 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) {
190 usertime = adjustTime( typ, info.UserTime );
191 }
192 return usertime;
193 }
__longlong
Definition: Kernel.h:56
System::NoFetch
Definition: SystemBase.h:19
System::adjustTime
GAUDI_API longlong adjustTime(TimeType typ, longlong timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition: Timing.cpp:37
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::virtualMemory | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: priority boost.

Definition at line 239 of file Memory.cpp.

240 {
241 VM_COUNTERS info;
242 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.VirtualSize );
243 return -2;
244 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::virtualMemoryLimit | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Quota`,
|  | long | pid = `-1`
| ) |  |

System Process Limits: Maximum amount of the page file this process is allowed to use.

Definition at line 255 of file Memory.cpp.

256 {
257 QUOTA_LIMITS quota;
258 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) ) {
259 if ( long( quota.PagefileLimit ) == -1 ) return -1; // LONG_MAX;
260 return adjustMemory( unit, quota.PagefileLimit );
261 }
262 return 0;
263 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135

long System::virtualMemoryPeak | ( | MemoryUnit | unit = `kByte`,
|  | InfoType | fetch = `Memory`,
|  | long | pid = `-1`
| ) |  |

Basic Process Information: priority boost.

Definition at line 247 of file Memory.cpp.

248 {
249 VM_COUNTERS info;
250 if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.PeakVirtualSize );
251 return -2;
252 }
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:34
System::NoFetch
Definition: SystemBase.h:19
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:135