The Gaudi Framework  v40r0 (475e45c1)
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
 
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 *)
 
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 long long adjustTime (TimeType typ, long long 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 long long ellapsedTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
 Elapsed time since start of process in milliseconds. More...
 
GAUDI_API long long kernelTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
 CPU kernel mode time of process in milliseconds. More...
 
GAUDI_API long long userTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
 CPU user mode time of process in milliseconds. More...
 
GAUDI_API long long cpuTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
 Consumed CPU time of process in milliseconds. More...
 
GAUDI_API long long remainingTime (TimeType typ=milliSec, InfoType fetch=Quota, long pid=-1)
 Maximum processing time left for this process. More...
 
GAUDI_API long long creationTime (TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
 Process Creation time. More...
 
GAUDI_API long long systemStart (TimeType typ=Sec)
 Maximum processing time left for this process. More...
 
GAUDI_API long long upTime (TimeType typ=Hour)
 Maximum processing time left for this process. More...
 
template<TimeType T>
GAUDI_API long long currentTime ()
 Retrieve absolute system time. More...
 
GAUDI_API long long currentTime (TimeType typ=milliSec)
 Get current time in specificed units. More...
 
GAUDI_API long long 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>
long long currentTime ()
 Retrieve absolute system time. More...
 
template long long currentTime< Year > ()
 
template long long currentTime< Month > ()
 
template long long currentTime< Day > ()
 
template long long currentTime< Hour > ()
 
template long long currentTime< Min > ()
 
template long long currentTime< Sec > ()
 
template long long currentTime< milliSec > ()
 
template long long currentTime< microSec > ()
 
template long long currentTime< nanoSec > ()
 
template long long currentTime< Native > ()
 
ProcessDescriptorgetProcess ()
 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

◆ Creator

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

Definition of the "generic" DLL entry point function.

Definition at line 43 of file System.h.

◆ EntryPoint

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

Definition of the "generic" DLL entry point function.

Definition at line 41 of file System.h.

◆ ImageHandle

typedef void * System::ImageHandle

Definition of an image handle.

Definition at line 25 of file ModuleInfo.h.

◆ PPEB

typedef struct _PEB* System::PPEB

Basic Process Information NtQueryInformationProcess using ProcessBasicInfo.

Definition at line 26 of file ProcessDescriptor.h.

◆ ProcessHandle

typedef void * System::ProcessHandle

Definition of the process handle.

Definition at line 27 of file ModuleInfo.h.

◆ ThreadHandle

typedef void* System::ThreadHandle

A Thread handle.

Definition at line 114 of file System.h.

Enumeration Type Documentation

◆ InfoType

Enumeration for fetching information.

Enumerator
NoFetch 
RemainTime 
Times 
ProcessBasics 
PriorityBoost 
Memory 
Quota 
System 
Modules 
IO 

Definition at line 15 of file SystemBase.h.

◆ MemoryUnit

Unit of memory.

Enumerator
Byte 
kByte 
MByte 
GByte 
TByte 
PByte 
EByte 

Definition at line 50 of file Memory.h.

◆ ModuleType

Enumerator
UNKNOWN 
SHAREDLIB 
EXECUTABLE 

Definition at line 23 of file ModuleInfo.h.

◆ PR_file_type

Enumerator
PR_regular_file 
PR_directory 

Definition at line 31 of file PathResolver.cpp.

◆ PR_search_type

Enumerator
PR_local 
PR_recursive 

Definition at line 33 of file PathResolver.cpp.

◆ 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 16 of file ProcessDescriptor.cpp.

◆ TimeType

Time type for conversion.

Enumerator
Year 
Month 
Day 
Hour 
Min 
Sec 
milliSec 
microSec 
nanoSec 
Native 

Definition at line 54 of file Timing.h.

Function Documentation

◆ accountName()

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

User login name.

Definition at line 339 of file System.cpp.

339  {
340  static const std::string account = Platform::accountName();
341  return account;
342 }

◆ adjustMemory()

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 25 of file Memory.cpp.

25  {
26  if ( value != -1 ) {
27  switch ( unit ) {
28  case Byte:
29  break;
30  case kByte:
31  value = value / 1024;
32  break;
33  case MByte:
34  value = ( value / 1024 ) / 1024;
35  break;
36  case GByte:
37  value = ( ( value / 1024 ) / 1024 ) / 1024;
38  break;
39  case TByte:
40  value = ( ( ( value / 1024 ) / 1024 ) / 1024 ) / 1024;
41  break;
42  case PByte:
43  value = ( ( ( ( value / 1024 ) / 1024 ) / 1024 ) / 1024 ) / 1024;
44  break;
45  case EByte:
46  value = ( ( ( ( ( value / 1024 ) / 1024 ) / 1024 ) / 1024 ) / 1024 ) / 1024;
47  break;
48  default:
49  value = -1;
50  break;
51  }
52  }
53  return value;
54 }

◆ adjustTime() [1/2]

template<TimeType T>
long long System::adjustTime ( long long  timevalue)
inline

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

◆ adjustTime() [2/2]

long long System::adjustTime ( TimeType  typ,
long long  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 47 of file Timing.cpp.

47  {
48  if ( t != -1 ) {
49 #ifndef _WIN32
50 // t /= CLK_TCK ; // needs division by clock tick unit
55 
57 #endif
58  switch ( typ ) {
59  case Year:
60  return adjustTime<Year>( t );
61  case Month:
62  return adjustTime<Month>( t );
63  case Day:
64  return adjustTime<Day>( t );
65  case Hour:
66  return adjustTime<Hour>( t );
67  case Min:
68  return adjustTime<Min>( t );
69  case Sec:
70  return adjustTime<Sec>( t );
71  case milliSec:
72  return adjustTime<milliSec>( t );
73  case microSec:
74  return adjustTime<microSec>( t );
75  case nanoSec:
76  return adjustTime<nanoSec>( t );
77  case Native:
78  return adjustTime<Native>( t );
79  default:
80  return t;
81  }
82  }
83  return t;
84 }

◆ adjustTime< Day >()

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

Definition at line 209 of file Timing.h.

209  {
210  return ( t == -1 ) ? t : t /= ( 1LL * 24 * 60 * 60 * 1000 * 1000 * 10 );
211  }

◆ adjustTime< Hour >()

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

Definition at line 213 of file Timing.h.

213  {
214  return ( t == -1 ) ? t : t /= ( 1LL * 60 * 60 * 1000 * 1000 * 10 );
215  }

◆ adjustTime< microSec >()

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

Definition at line 229 of file Timing.h.

229  {
230  return ( t == -1 ) ? t : t /= ( 10LL );
231  }

◆ adjustTime< milliSec >()

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

Definition at line 225 of file Timing.h.

225  {
226  return ( t == -1 ) ? t : t /= ( 1000 * 10 );
227  }

◆ adjustTime< Min >()

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

Definition at line 217 of file Timing.h.

217  {
218  return ( t == -1 ) ? t : t /= ( 60 * 1000 * 1000 * 10 );
219  }

◆ adjustTime< Month >()

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

Definition at line 237 of file Timing.h.

237  {
238  return ( t == -1 ) ? t : t /= ( 1LL * 30 * 24 * 60 * 60 * 1000 * 1000 * 10 );
239  }

◆ adjustTime< nanoSec >()

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

Definition at line 233 of file Timing.h.

233  {
234  return ( t == -1 ) ? t : t *= 100LL;
235  }

◆ adjustTime< Native >()

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

Definition at line 241 of file Timing.h.

241  {
242  return t;
243  }

◆ adjustTime< Sec >()

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

Definition at line 221 of file Timing.h.

221  {
222  return ( t == -1 ) ? t : t /= ( 1000 * 1000 * 10 );
223  }

◆ adjustTime< Year >()

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

Definition at line 205 of file Timing.h.

205  {
206  return ( t == -1 ) ? t : t /= ( 1LL * 365 * 24 * 60 * 60 * 1000 * 1000 * 10 );
207  }

◆ affinityMask()

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

Basic Process Information: Affinity mask.

Definition at line 77 of file Memory.cpp.

77  {
78  PROCESS_BASIC_INFORMATION info;
79  if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.AffinityMask;
80  return 0;
81 }

◆ argc()

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 348 of file System.cpp.

348 { return cmdLineArgs().size(); }

◆ argv()

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 357 of file System.cpp.

357  {
358  auto helperFunc = []( const std::vector<std::string>& args ) -> std::vector<const char*> {
359  std::vector<const char*> result;
360  std::transform( args.begin(), args.end(), std::back_inserter( result ),
361  []( const std::string& s ) { return s.c_str(); } );
362  return result;
363  };
364  static const std::vector<const char*> args = helperFunc( cmdLineArgs() );
365  // We rely here on the fact that a vector's allocation table is contiguous
366  return (char**)&( args[0] );
367 }

◆ backTrace() [1/2]

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

Definition at line 433 of file System.cpp.

433  {
434  try {
435  // Always hide the first two levels of the stack trace (that's us)
436  const size_t totalOffset = offset + 2;
437  const size_t totalDepth = depth + totalOffset;
438 
439  std::string fnc, lib;
440 
441  std::vector<void*> addresses( totalDepth, nullptr );
442  const size_t count = System::backTrace( addresses.data(), totalDepth );
443  for ( size_t i = totalOffset; i < count; ++i ) {
444  void* addr = nullptr;
445 
446  if ( System::getStackLevel( addresses[i], addr, fnc, lib ) ) {
447  std::ostringstream ost;
448  ost << "#" << std::setw( 3 ) << std::setiosflags( std::ios::left ) << i - totalOffset + 1;
449  ost << std::hex << addr << std::dec << " " << fnc << " [" << lib << "]" << std::endl;
450  btrace += ost.str();
451  }
452  }
453  return true;
454  } catch ( const std::bad_alloc& e ) { return false; }
455 }

◆ backTrace() [2/2]

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

◆ basePriority()

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

Basic Process Information: Base priority.

Definition at line 57 of file Memory.cpp.

57  {
58  PROCESS_BASIC_INFORMATION info;
59  if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.BasePriority;
60  return 0;
61 }

◆ breakExecution() [1/2]

long System::breakExecution ( )

Break the execution of the application and invoke the debugger.

Definition at line 43 of file Debugger.cpp.

43  {
44 #ifdef _WIN32
45  _asm int 3 return 1;
46 #else
47  // I have no clue how to do this in linux
48  return 0;
49 #endif
50 }

◆ breakExecution() [2/2]

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 53 of file Debugger.cpp.

53  {
54 #ifdef _WIN32
55  long result = 0;
56  if ( pid == Win::_getpid() ) {
57  _asm int 3 return 1;
58  } else {
59  Win::LPTHREAD_START_ROUTINE fun;
60  Win::HANDLE th, ph;
61  Win::HINSTANCE mh;
62  Win::DWORD id;
63  mh = Win::LoadLibrary( "Kernel32" );
64  if ( 0 != mh ) {
65  fun = (Win::LPTHREAD_START_ROUTINE)Win::GetProcAddress( mh, "DebugBreak" );
66  if ( 0 != fun ) {
67  ph = Win::OpenProcess( PROCESS_ALL_ACCESS, TRUE, pid );
68  if ( 0 != ph ) {
69  th = Win::CreateRemoteThread( ph, NULL, 0, fun, 0, 0, &id );
70  if ( 0 != th ) {
71  Win::CloseHandle( th );
72  result = 1;
73  }
74  Win::CloseHandle( ph );
75  }
76  }
77  Win::FreeLibrary( mh );
78  }
79  }
80  if ( result != 1 ) result = Win::GetLastError();
81  return result;
82 #else
83  // I have no clue how to do this in linux
84  return pid;
85 #endif
86 }

◆ cmdLineArgs()

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].

Definition at line 351 of file System.cpp.

351  {
352  static const std::vector<std::string> args = Platform::cmdLineArgs();
353  return args;
354 }

◆ cpuTime()

long long 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
typIndicator or the unit the time will be returned.
fetchIndicator of the information to be fetched. If Fetch_None, the information will not be updated.
pidProcess ID of which the information will be returned
Returns
Requested value in the indicated units.

Definition at line 197 of file Timing.cpp.

197  {
198  long long 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 }

◆ creationTime()

long long 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
typIndicator or the unit the time will be returned.
fetchIndicator of the information to be fetched. If Fetch_None, the information will not be updated.
pidProcess ID of which the information will be returned
Returns
Requested value in the indicated units.

Definition at line 145 of file Timing.cpp.

145  {
146  long long created = 0;
147  KERNEL_USER_TIMES info;
148  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) {
149  created = adjustTime( typ, info.CreateTime - UNIX_BASE_TIME );
150  }
151  return created;
152 }

◆ currentTime() [1/3]

template<TimeType T>
GAUDI_API long long System::currentTime ( )
inline

Retrieve absolute system time.

Parameters
typIndicator 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 247 of file Timing.h.

247  {
248 #ifdef _WIN32
249  long long current = 0;
250  ::GetSystemTimeAsFileTime( (FILETIME*)&current );
251  return adjustTime<T>( current - UNIX_BASE_TIME );
252 #else
253  struct timeval tv;
254  ::gettimeofday( &tv, 0 );
255  return adjustTime<T>( ( tv.tv_sec * 1000000 + tv.tv_usec ) * 10 );
256 #endif
257  }

◆ currentTime() [2/3]

template<TimeType T>
long long System::currentTime ( )
inline

Retrieve absolute system time.

Parameters
typIndicator 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 247 of file Timing.h.

247  {
248 #ifdef _WIN32
249  long long current = 0;
250  ::GetSystemTimeAsFileTime( (FILETIME*)&current );
251  return adjustTime<T>( current - UNIX_BASE_TIME );
252 #else
253  struct timeval tv;
254  ::gettimeofday( &tv, 0 );
255  return adjustTime<T>( ( tv.tv_sec * 1000000 + tv.tv_usec ) * 10 );
256 #endif
257  }

◆ currentTime() [3/3]

long long System::currentTime ( TimeType  typ = milliSec)

Get current time in specificed units.

Retrieve current system time.

Definition at line 101 of file Timing.cpp.

101  {
102  switch ( typ ) {
103  case Year:
104  return currentTime<Year>();
105  case Month:
106  return currentTime<Month>();
107  case Day:
108  return currentTime<Day>();
109  case Hour:
110  return currentTime<Hour>();
111  case Min:
112  return currentTime<Min>();
113  case Sec:
114  return currentTime<Sec>();
115  case milliSec:
116  return currentTime<milliSec>();
117  case microSec:
118  return currentTime<microSec>();
119  case nanoSec:
120  return currentTime<nanoSec>();
121  case Native:
122  return currentTime<Native>();
123  }
124  return currentTime<Native>();
125 }

◆ currentTime< Day >()

template long long System::currentTime< Day > ( )

◆ currentTime< Hour >()

template long long System::currentTime< Hour > ( )

◆ currentTime< microSec >()

template long long System::currentTime< microSec > ( )

◆ currentTime< milliSec >()

template long long System::currentTime< milliSec > ( )

◆ currentTime< Min >()

template long long System::currentTime< Min > ( )

◆ currentTime< Month >()

template long long System::currentTime< Month > ( )

◆ currentTime< nanoSec >()

template long long System::currentTime< nanoSec > ( )

◆ currentTime< Native >()

template long long System::currentTime< Native > ( )

◆ currentTime< Sec >()

template long long System::currentTime< Sec > ( )

◆ currentTime< Year >()

template long long System::currentTime< Year > ( )

◆ ellapsedTime()

long long 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
typIndicator or the unit the time will be returned.
timevalueTime value to be converted.
Returns
Requested value in the indicated units.

Definition at line 169 of file Timing.cpp.

169  {
170  KERNEL_USER_TIMES info;
171  long long ellapsed = currentTime( microSec ) * 10;
172  if ( getProcess()->query( pid, fetch, &info ) ) {
173  ellapsed = adjustTime( typ, ellapsed + UNIX_BASE_TIME - info.CreateTime );
174  }
175  return ellapsed;
176 }

◆ exeHandle()

System::ImageHandle System::exeHandle ( )

Handle to the executable file running.

Definition at line 149 of file ModuleInfo.cpp.

149  {
150 #ifdef _WIN32
151  if ( processHandle() ) {
152  static HINSTANCE handle = 0;
153  DWORD cbNeeded;
154  if ( 0 == handle && _psApi ) {
155  if ( _psApi.EnumProcessModules( processHandle(), &handle, sizeof( ModuleHandle ), &cbNeeded ) ) {}
156  }
157  return handle;
158  }
159  return 0;
160 #elif defined( __linux ) || defined( __APPLE__ )
161  // This does NOT work!
162  static Dl_info infoBuf, *info = &infoBuf;
163  if ( !info ) {
164  void* handle = ::dlopen( nullptr, RTLD_LAZY );
165  // printf("Exe handle:%X\n", handle);
166  if ( handle ) {
167  void* func = ::dlsym( handle, "main" );
168  // printf("Exe:Func handle:%X\n", func);
169  if ( func ) {
170  if ( 0 != ::dladdr( func, &infoBuf ) ) {
171  // std::cout << "All OK" << std::endl;
172  info = &infoBuf;
173  }
174  }
175  }
176  }
177  return info;
178 #elif __hpux
179  // Don't know how to solve this .....
180  return 0;
181 #endif
182  return 0;
183 }

◆ exeName()

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

Name of the executable file running.

Definition at line 185 of file ModuleInfo.cpp.

185  {
186  static std::string module( "" );
187  if ( module.length() == 0 ) {
188  char name[PATH_MAX] = { "Unknown.module" };
189  name[0] = 0;
190 #ifdef _WIN32
191  if ( _psApi && processHandle() ) {
192  _psApi.GetModuleFileNameExA( processHandle(), (HINSTANCE)exeHandle(), name, sizeof( name ) );
193  module = name;
194  }
195 #elif defined( __linux ) || defined( __APPLE__ )
196  char cmd[512];
197  ::sprintf( cmd, "/proc/%d/exe", ::getpid() );
198  module = "Unknown";
199  if ( ::readlink( cmd, name, sizeof( name ) ) >= 0 ) module = name;
200 #elif __hpux
201  if ( ::realpath( ( (HMODULE*)exeHandle() )->dsc.filename, name ) ) module = name;
202 #endif
203  }
204  return module;
205 }

◆ exitStatus()

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 84 of file Memory.cpp.

84  {
85  PROCESS_BASIC_INFORMATION info;
86  if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.ExitStatus;
87  return -2;
88 }

◆ getEnv() [1/4]

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

get all environment variables

get all defined environment vars

Definition at line 403 of file System.cpp.

403  {
404 #if defined( _WIN32 )
405 # define environ _environ
406 #elif defined( __APPLE__ )
407  static char** environ = *_NSGetEnviron();
408 #endif
409  std::vector<std::string> vars;
410  for ( int i = 0; environ[i] != nullptr; ++i ) { vars.push_back( environ[i] ); }
411  return vars;
412 }

◆ getEnv() [2/4]

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 376 of file System.cpp.

376  {
377  char* env;
378  if ( ( env = getenv( var ) ) != nullptr ) {
379  return env;
380  } else {
381  return "UNKNOWN";
382  }
383 }

◆ getEnv() [3/4]

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 386 of file System.cpp.

386  {
387  char* env;
388  if ( ( env = getenv( var ) ) != nullptr ) {
389  value = env;
390  return true;
391  } else {
392  return false;
393  }
394 }

◆ getEnv() [4/4]

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

Definition at line 96 of file System.h.

96 { return getEnv( var.c_str(), value ); }

◆ getErrorString()

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

Retrieve error code as string for a given error.

Definition at line 271 of file System.cpp.

271  {
272  std::string errString = "";
273 #ifdef _WIN32
274  LPVOID lpMessageBuffer;
275  ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error,
276  MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // The user default language
277  (LPTSTR)&lpMessageBuffer, 0, NULL );
278  errString = (const char*)lpMessageBuffer;
279  // Free the buffer allocated by the system
280  ::LocalFree( lpMessageBuffer );
281 #else
282  char* cerrString( nullptr );
283  // Remember: for linux dl* routines must be handled differently!
284  if ( error == 0xAFFEDEAD ) {
285  cerrString = ::dlerror();
286  if ( !cerrString ) cerrString = ::strerror( error );
287  if ( !cerrString ) {
288  cerrString = (char*)"Unknown error. No information found in strerror()!";
289  } else {
290  errString = std::string( cerrString );
291  }
292  errno = 0;
293  } else {
294  cerrString = ::strerror( error );
295  errString = std::string( cerrString );
296  }
297 #endif
298  return errString;
299 }

◆ getLastError()

unsigned long System::getLastError ( )

Get last system known error.

Retrieve last error code.

Definition at line 255 of file System.cpp.

255  {
256 #ifdef _WIN32
257  return ::GetLastError();
258 #else
259  // convert errno (int) to unsigned long
260  return static_cast<unsigned long>( static_cast<unsigned int>( errno ) );
261 #endif
262 }

◆ getLastErrorString()

const std::string System::getLastErrorString ( )

Get last system error as string.

Retrieve last error code as string.

Definition at line 265 of file System.cpp.

265  {
266  const std::string errString = getErrorString( getLastError() );
267  return errString;
268 }

◆ getProcedureByName() [1/2]

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

Get a specific function defined in the DLL.

Definition at line 250 of file System.cpp.

250  {
251  return getProcedureByName( handle, name, (EntryPoint*)pFunction );
252 }

◆ getProcedureByName() [2/2]

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

Get a specific function defined in the DLL.

Definition at line 204 of file System.cpp.

204  {
205 #ifdef _WIN32
206  *pFunction = ( EntryPoint )::GetProcAddress( (HINSTANCE)handle, name.data() );
207  if ( 0 == *pFunction ) { return System::getLastError(); }
208  return 1;
209 #elif defined( __linux )
210  *pFunction = reinterpret_cast<EntryPoint>( ::dlsym( handle, name.c_str() ) );
211  if ( !*pFunction ) {
212  errno = 0xAFFEDEAD;
213  // std::cout << "System::getProcedureByName>" << getLastErrorString() << std::endl;
214  return 0;
215  }
216  return 1;
217 #elif defined( __APPLE__ )
218  *pFunction = ( EntryPoint )::dlsym( handle, name.c_str() );
219  if ( !( *pFunction ) ) {
220  // Try with an underscore :
221  std::string sname = "_" + name;
222  *pFunction = ( EntryPoint )::dlsym( handle, sname.c_str() );
223  }
224  if ( 0 == *pFunction ) {
225  errno = 0xAFFEDEAD;
226  std::cout << "System::getProcedureByName>" << getLastErrorString() << std::endl;
227  // std::cout << "System::getProcedureByName> failure" << std::endl;
228  return 0;
229  }
230  return 1;
231 #elif __hpux
232  HMODULE* mod = (HMODULE*)handle;
233  if ( 0 != mod ) {
234  long ll1 = name.length();
235  for ( int i = 0; i < mod->numSym; i++ ) {
236  long ll2 = strlen( mod->sym[i].name );
237  if ( 0 != ::strncmp( mod->sym[i].name, name.c_str(), ( ll1 > ll2 ) ? ll1 : ll2 ) == 0 ) {
238  *pFunction = (EntryPoint)mod->sym[i].value;
239  return 1;
240  }
241  }
242  }
243  return 0;
244 #else
245  return 0;
246 #endif
247 }

◆ getProcess()

ProcessDescriptor * System::getProcess ( )
inline

Retrieve Process structure.

Definition at line 141 of file ProcessDescriptor.h.

141  {
142  static ProcessDescriptor p;
143  return &p;
144  }

◆ getProcessTime()

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 207 of file Timing.cpp.

207  {
208  KERNEL_USER_TIMES info;
209  if ( getProcess()->query( pid, Times, &info ) ) {
210  return ProcessTime( info.KernelTime, info.UserTime, currentTime<Native>() - info.CreateTime );
211  }
212  return ProcessTime(); // return 0s in case of problems
213  }

◆ getStackLevel()

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

◆ homeDirectory()

std::string System::homeDirectory ( )

Definition at line 64 of file Environment.cpp.

64  {
65  // Return the user's home directory.
66  std::string home_dir = "./";
67  // Try to replace the current value with the content of several
68  // environment variables
69  if ( !( System::getEnv( "home", home_dir ) || System::getEnv( "HOME", home_dir ) ) ) {
70  // for Windows NT HOME might be defined as either $(HOMESHARE)/$(HOMEPATH)
71  // or $(HOMEDRIVE)/$(HOMEPATH)
72  if ( System::getEnv( "HOMESHARE", home_dir ) || System::getEnv( "HOMEDRIVE", home_dir ) ) {
73  std::string path;
74  if ( System::getEnv( "HOMEPATH", path ) ) home_dir += path;
75  }
76  }
77  return home_dir;
78 }

◆ hostName()

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

Host name.

Definition at line 306 of file System.cpp.

306  {
307  static const std::string host = Platform::hostName();
308  return host;
309 }

◆ instructionsetLevel()

int System::instructionsetLevel ( )

Instruction Set "Level".

Definition at line 329 of file System.cpp.

329  {
330 #ifdef __x86_64
331  using namespace Gaudi;
332  return instrset_detect();
333 #else
334  return -1;
335 #endif
336 }

◆ isEnvSet()

bool System::isEnvSet ( const char *  var)

Check if an environment variable is set or not.

Definition at line 396 of file System.cpp.

396 { return getenv( var ) != nullptr; }

◆ kernelTime()

long long 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
typIndicator or the unit the time will be returned.
fetchIndicator of the information to be fetched. If Fetch_None, the information will not be updated.
pidProcess ID of which the information will be returned
Returns
Requested value in the indicated units.

Definition at line 179 of file Timing.cpp.

179  {
180  KERNEL_USER_TIMES info;
181  long long kerneltime = 0;
182  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) {
183  kerneltime = adjustTime( typ, info.KernelTime );
184  }
185  return kerneltime;
186 }

◆ linkedModules()

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

Vector of names of linked modules.

Definition at line 207 of file ModuleInfo.cpp.

207  {
208  if ( s_linkedModules.size() == 0 ) {
209 #ifdef _WIN32
210  char name[255]; // Maximum file name length on NT 4.0
211  DWORD cbNeeded;
212  HINSTANCE handle[1024];
213  if ( _psApi ) {
214  if ( _psApi.EnumProcessModules( processHandle(), handle, sizeof( handle ), &cbNeeded ) ) {
215  for ( size_t i = 0; i < cbNeeded / sizeof( HANDLE ); i++ ) {
216  if ( 0 < _psApi.GetModuleFileNameExA( processHandle(), handle[i], name, sizeof( name ) ) ) {
217  s_linkedModules.push_back( name );
218  }
219  }
220  }
221  }
222 #elif defined( __linux ) || defined( __APPLE__ )
223  char ff[512], cmd[1024], fname[1024], buf1[64], buf2[64], buf3[64], buf4[64];
224  ::sprintf( ff, "/proc/%d/maps", ::getpid() );
225  FILE* maps = ::fopen( ff, "r" );
226  while ( ::fgets( cmd, sizeof( cmd ), maps ) ) {
227  int len;
228  sscanf( cmd, "%s %s %s %s %d %s", buf1, buf2, buf3, buf4, &len, fname );
229  if ( len > 0 && strncmp( buf2, "r-xp", strlen( "r-xp" ) ) == 0 ) { s_linkedModules.push_back( fname ); }
230  }
231  ::fclose( maps );
232 #endif
233  }
234  return s_linkedModules;
235 }

◆ loadDynamicLib()

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

Load dynamic link library.

Definition at line 136 of file System.cpp.

136  {
137  unsigned long res = 0;
138  // if name is empty, just load it
139  if ( name.length() == 0 ) {
140  res = loadWithoutEnvironment( name, handle );
141  } else {
142  // If the name is a logical name (environment variable), the try
143  // to load the corresponding library from there.
144  std::string imgName;
145  if ( getEnv( name, imgName ) ) {
146  res = loadWithoutEnvironment( imgName, handle );
147  } else {
148  // build the dll name
149  std::string dllName = name;
150 // Add a possible "lib" prefix to the name on unix platforms. But only if
151 // it's not an absolute path name.
152 #if defined( __linux ) || defined( __APPLE__ )
153  if ( ( dllName.find( '/' ) == std::string::npos ) && ( dllName.compare( 0, 3, "lib" ) != 0 ) ) {
154  dllName = "lib" + dllName;
155  }
156 #endif // unix
157  // Now try loading the library with all possible suffixes supported by the
158  // platform.
159  for ( const char* suffix : SHLIB_SUFFIXES ) {
160  // Add the suffix if necessary.
161  std::string libName = dllName;
162  const size_t len = strlen( suffix );
163  if ( dllName.compare( dllName.length() - len, len, suffix ) != 0 ) { libName += suffix; }
164  // Try to load the library.
165  res = loadWithoutEnvironment( libName, handle );
166  // If the load succeeded, stop here.
167  if ( res == 1 ) { break; }
168  }
169  }
170  if ( res != 1 ) {
171 #if defined( __linux ) || defined( __APPLE__ )
172  errno = 0xAFFEDEAD;
173 #endif
174  // std::cout << "System::loadDynamicLib>" << getLastErrorString() << std::endl;
175  }
176  }
177  return res;
178 }

◆ machineType()

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

Machine type.

Definition at line 324 of file System.cpp.

324  {
325  static const std::string mach = Platform::machineType();
326  return mach;
327 }

◆ mappedMemory()

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

Basic Process Information: priority boost.

Definition at line 178 of file Memory.cpp.

178  {
179  VM_COUNTERS info;
180  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.WorkingSetSize );
181  return -2;
182 }

◆ mappedMemoryPeak()

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

Basic Process Information: priority boost.

Definition at line 185 of file Memory.cpp.

185  {
186  VM_COUNTERS info;
187  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
188  return adjustMemory( unit, info.PeakWorkingSetSize );
189  return -2;
190 }

◆ maxMemoryLimit()

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 201 of file Memory.cpp.

201  {
202  QUOTA_LIMITS quota;
203  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
204  return adjustMemory( unit, quota.MaximumWorkingSetSize );
205  return 0;
206 }

◆ minMemoryLimit()

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 193 of file Memory.cpp.

193  {
194  QUOTA_LIMITS quota;
195  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
196  return adjustMemory( unit, quota.MinimumWorkingSetSize );
197  return 0;
198 }

◆ moduleHandle()

System::ImageHandle System::moduleHandle ( )

Handle to currently executed module.

Definition at line 128 of file ModuleInfo.cpp.

128  {
129  if ( !ModuleHandle ) {
130  if ( processHandle() ) {
131 #ifdef _WIN32
132  static HINSTANCE handle = 0;
133  DWORD cbNeeded;
134  if ( 0 == handle && _psApi ) {
135  if ( _psApi.EnumProcessModules( processHandle(), &handle, sizeof( ModuleHandle ), &cbNeeded ) ) {}
136  }
137  return handle;
138 #elif defined( __linux ) || defined( __APPLE__ )
139  static Dl_info info;
140  if ( ::dladdr( reinterpret_cast<void*>( System::moduleHandle ), &info ) ) return &info;
141 #elif __hpux
142  return 0; // Don't know how to solve this .....
143 #endif
144  }
145  }
146  return ModuleHandle;
147 }

◆ moduleName()

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

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

Retrieve base name of module.

Definition at line 45 of file ModuleInfo.cpp.

45  {
46  static std::string module( "" );
47  if ( module == "" ) {
48  if ( processHandle() && moduleHandle() ) {
49 #ifdef _WIN32
50  char moduleName[256] = { "Unknown.module" };
51  moduleName[0] = 0;
52  if ( _psApi ) {
53  _psApi.GetModuleBaseNameA( processHandle(), (HINSTANCE)moduleHandle(), moduleName, sizeof( moduleName ) );
54  }
55  std::string mod = moduleName;
56 #elif defined( __linux ) || defined( __APPLE__ )
57  std::string mod = ::basename( (char*)( (Dl_info*)moduleHandle() )->dli_fname );
58 #elif __hpux
59  std::string mod = ::basename( ( (HMODULE*)moduleHandle() )->dsc.filename );
60 #endif
61  module = mod.substr( 0, mod.rfind( '.' ) );
62  }
63  }
64  return module;
65 }

◆ moduleNameFull()

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

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

Retrieve full name of module.

Definition at line 68 of file ModuleInfo.cpp.

68  {
69  static std::string module( "" );
70  if ( module == "" ) {
71  if ( processHandle() && moduleHandle() ) {
72  char name[PATH_MAX] = { "Unknown.module" };
73  name[0] = 0;
74 #ifdef _WIN32
75  if ( _psApi ) {
76  _psApi.GetModuleFileNameExA( processHandle(), (HINSTANCE)moduleHandle(), name, sizeof( name ) );
77  module = name;
78  }
79 #else
80 
81 # if defined( __linux ) || defined( __APPLE__ )
82  const char* path = ( (Dl_info*)moduleHandle() )->dli_fname;
83 # elif __hpux
84  const char* path = ( (HMODULE*)moduleHandle() )->dsc.filename;
85 # endif
86  if ( ::realpath( path, name ) ) module = name;
87 #endif
88  }
89  }
90  return module;
91 }

◆ moduleType()

System::ModuleType System::moduleType ( )

Get type of the module.

Definition at line 94 of file ModuleInfo.cpp.

94  {
95  static ModuleType type = UNKNOWN;
96  if ( type == UNKNOWN ) {
97  const std::string& module = moduleNameFull();
98  size_t loc = module.rfind( '.' ) + 1;
99  if ( loc == 0 )
100  type = EXECUTABLE;
101  else if ( module[loc] == 'e' || module[loc] == 'E' )
102  type = EXECUTABLE;
103 #ifdef _WIN32
104  else if ( module[loc] == 'd' || module[loc] == 'D' )
105 #else
106  else if ( module[loc] == 's' && module[loc + 1] == 'o' )
107 #endif
108  type = SHAREDLIB;
109  else
110  type = UNKNOWN;
111  }
112  return type;
113 }

◆ nonPagedMemory()

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 106 of file Memory.cpp.

106  {
107  VM_COUNTERS info;
108  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
109  return adjustMemory( unit, info.QuotaNonPagedPoolUsage );
110  return -2;
111 }

◆ nonPagedMemoryLimit()

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 114 of file Memory.cpp.

114  {
115  POOLED_USAGE_AND_LIMITS quota;
116  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
117  return adjustMemory( unit, quota.NonPagedPoolLimit );
118  return 0;
119 }

◆ nonPagedMemoryPeak()

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 98 of file Memory.cpp.

98  {
99  VM_COUNTERS info;
100  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
101  return adjustMemory( unit, info.QuotaPeakNonPagedPoolUsage );
102  return -2;
103 }

◆ numCmdLineArgs()

long System::numCmdLineArgs ( )

Number of arguments passed to the commandline.

Definition at line 345 of file System.cpp.

345 { return cmdLineArgs().size(); }

◆ numPageFault()

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

Basic Process Information: Number of page faults.

Basic Process Information: priority boost.

Definition at line 146 of file Memory.cpp.

146  {
147  VM_COUNTERS info;
148  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return info.PageFaultCount;
149  return -2;
150 }

◆ osName()

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

OS name.

Definition at line 312 of file System.cpp.

312  {
313  static const std::string osname = Platform::osName();
314  return osname;
315 }

◆ osVersion()

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

OS version.

Definition at line 318 of file System.cpp.

318  {
319  static const std::string osver = Platform::osVersion();
320  return osver;
321 }

◆ pagedMemory()

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 122 of file Memory.cpp.

122  {
123  VM_COUNTERS info;
124  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
125  return adjustMemory( unit, info.QuotaPagedPoolUsage );
126  return -2;
127 }

◆ pagedMemoryLimit()

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 138 of file Memory.cpp.

138  {
139  POOLED_USAGE_AND_LIMITS quota;
140  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
141  return adjustMemory( unit, quota.PagedPoolLimit );
142  return 0;
143 }

◆ pagedMemoryPeak()

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 130 of file Memory.cpp.

130  {
131  VM_COUNTERS info;
132  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
133  return adjustMemory( unit, info.QuotaPeakPagedPoolUsage );
134  return -2;
135 }

◆ pagefileUsage()

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 153 of file Memory.cpp.

153  {
154  VM_COUNTERS info;
155  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.PagefileUsage );
156  return -2;
157 }

◆ pagefileUsageLimit()

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 168 of file Memory.cpp.

168  {
169  POOLED_USAGE_AND_LIMITS quota;
170  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) ) {
171  if ( long( quota.PagefileLimit ) < 0 ) return -1; // LONG_MAX;
172  return adjustMemory( unit, quota.PagefileLimit );
173  }
174  return -2;
175 }

◆ pagefileUsagePeak()

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 160 of file Memory.cpp.

160  {
161  VM_COUNTERS info;
162  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
163  return adjustMemory( unit, info.PeakPagefileUsage );
164  return -2;
165 }

◆ parentID()

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

Basic Process Information: Parent's process ID.

Definition at line 70 of file Memory.cpp.

70  {
71  PROCESS_BASIC_INFORMATION info;
72  if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.InheritedFromUniqueProcessId;
73  return 0;
74 }

◆ PathResolverFindDataFile()

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

Definition at line 169 of file PathResolver.cpp.

169  {
170  return PathResolver::find_file( logical_file_name, "DATAPATH" );
171  }

◆ PathResolverFindXMLFile()

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

Definition at line 165 of file PathResolver.cpp.

165  {
166  return PathResolver::find_file( logical_file_name, "XMLPATH" );
167  }

◆ priorityBoost()

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

Basic Process Information: priority boost.

Definition at line 91 of file Memory.cpp.

91  {
92  long info;
93  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return info;
94  return -2;
95 }

◆ processHandle()

void * System::processHandle ( )

Handle to running process.

Retrieve processhandle.

Definition at line 116 of file ModuleInfo.cpp.

116  {
117  static long pid = ::getpid();
118 #ifdef _WIN32
119  static HANDLE hP = ::OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid );
120 #else
121  static void* hP = (void*)pid;
122 #endif
123  return hP;
124 }

◆ procID()

long System::procID ( )

Basic Process Information: Process ID.

Definition at line 64 of file Memory.cpp.

64  {
65  static const long s_pid = ::getpid();
66  return s_pid;
67 }

◆ remainingTime()

long long 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
typIndicator or the unit the time will be returned.
fetchIndicator of the information to be fetched. If Fetch_None, the information will not be updated.
pidProcess ID of which the information will be returned
Returns
Requested value in the indicated units.

Definition at line 155 of file Timing.cpp.

155  {
156  long long left = 0;
157  QUOTA_LIMITS quota;
158  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) ) {
159  if ( left == -1 ) {
160  // left = _I64_MAX;
161  } else {
162  left = adjustTime( typ, quota.TimeLimit );
163  }
164  }
165  return left;
166 }

◆ resolveEnv()

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

Definition at line 57 of file Environment.cpp.

57  {
58  std::string source = var;
59  res = i_resolve( source, recursions );
60  if ( res.find( "${" ) == std::string::npos ) { return StatusCode::SUCCESS; }
61  return StatusCode::FAILURE;
62 }

◆ setEnv()

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 489 of file System.cpp.

489  {
490 #ifndef WIN32
491  // UNIX version
492  return value.empty() ?
493  // remove if set to nothing (and return success)
494  ::unsetenv( name.c_str() ),
495  0 :
496  // set the value
497  ::setenv( name.c_str(), value.c_str(), overwrite );
498 #else
499  // Windows version
500  if ( value.empty() ) {
501  // equivalent to unsetenv
502  return ::_putenv( ( name + "=" ).c_str() );
503  } else {
504  if ( !getenv( name.c_str() ) || overwrite ) {
505  // set if not yet present or overwrite is set (force)
506  return ::_putenv( ( name + "=" + value ).c_str() );
507  }
508  }
509  return 0; // if we get here, we are trying to set a variable already set, but
510  // not to overwrite.
511  // It is considered a success on Linux (man P setenv)
512 #endif
513 }

◆ setModuleHandle()

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

Attach module handle.

Definition at line 126 of file ModuleInfo.cpp.

126 { ModuleHandle = handle; }

◆ systemStart()

long long System::systemStart ( TimeType  typ = Sec)

Maximum processing time left for this process.

Units of time since system startup and begin of epoche.

Parameters
typIndicator or the unit the time will be returned.
Returns
Requested value in the indicated units.

Definition at line 128 of file Timing.cpp.

128  {
129  static long long sys_start = 0;
130  if ( 0 == sys_start ) {
131  long long c = currentTime( microSec );
132  long long t = tickCount();
133  sys_start = 10 * c - t;
134  }
135  return adjustTime( typ, sys_start );
136 }

◆ tempDirectory()

std::string System::tempDirectory ( )

Definition at line 80 of file Environment.cpp.

80  {
81  // Return a user configured or systemwide directory to create
82  // temporary files in.
83  std::string dir;
84  if ( System::getEnv( "TEMP", dir ) || System::getEnv( "TEMPDIR", dir ) || System::getEnv( "TEMP_DIR", dir ) ||
85  System::getEnv( "TMP", dir ) || System::getEnv( "TMPDIR", dir ) || System::getEnv( "TMP_DIR", dir ) )
86  return dir;
87  else
88  return homeDirectory();
89 }

◆ threadSelf()

ThreadHandle System::threadSelf ( )
inline

thread handle "accessor"

Definition at line 116 of file System.h.

116 { return (void*)0; }

◆ tickCount()

long long System::tickCount ( )

Retrieve the number of ticks since system startup.

Returns
Requested value in the indicated units.

Definition at line 87 of file Timing.cpp.

87  {
88  long long count = 10000;
89 #ifdef _WIN32
90  count *= ::GetTickCount(); // Number of milliSec since system startup
91 #else
92  struct tms buf;
93  count *= 10 * times( &buf );
94 #endif
95  return count;
96 }

◆ typeinfoName() [1/2]

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

Definition at line 303 of file System.cpp.

303 { return Platform::typeinfoName( class_name ); }

◆ typeinfoName() [2/2]

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

Get platform independent information about the class type.

Definition at line 301 of file System.cpp.

301 { return typeinfoName( tinfo.name() ); }

◆ unloadDynamicLib()

unsigned long System::unloadDynamicLib ( ImageHandle  handle)

unload dynamic link library

Definition at line 181 of file System.cpp.

181  {
182 #ifdef _WIN32
183  if ( !::FreeLibrary( (HINSTANCE)handle ) ) {
184 #elif defined( __linux ) || defined( __APPLE__ )
185  ::dlclose( handle );
186  if ( 0 ) {
187 #elif __hpux
188  // On HP we have to run finalization ourselves.....
189  Creator pFinalize = 0;
190  if ( getProcedureByName( handle, "_fini", &pFinalize ) ) { pFinalize(); }
191  HMODULE* mod = (HMODULE*)handle;
192  if ( 0 == ::shl_unload( mod->dsc.handle ) ) {
193  delete mod;
194  } else {
195 #else
196  if ( false ) {
197 #endif
198  return getLastError();
199  }
200  return 1;
201 }

◆ upTime()

long long System::upTime ( TimeType  typ = Hour)

Maximum processing time left for this process.

Units of time since system startup in requested units.

Parameters
typIndicator or the unit the time will be returned.
Returns
Requested value in the indicated units.

Definition at line 139 of file Timing.cpp.

139  {
140  static long long sys_start = 10 * systemStart( microSec );
141  return adjustTime( typ, 10 * currentTime( microSec ) - sys_start );
142 }

◆ userTime()

long long 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
typIndicator or the unit the time will be returned.
fetchIndicator of the information to be fetched. If Fetch_None, the information will not be updated.
pidProcess ID of which the information will be returned
Returns
Requested value in the indicated units.

Definition at line 189 of file Timing.cpp.

189  {
190  long long usertime = 0;
191  KERNEL_USER_TIMES info;
192  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) { usertime = adjustTime( typ, info.UserTime ); }
193  return usertime;
194 }

◆ virtualMemory()

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

Basic Process Information: priority boost.

Definition at line 209 of file Memory.cpp.

209  {
210  VM_COUNTERS info;
211  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.VirtualSize );
212  return -2;
213 }

◆ virtualMemoryLimit()

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 223 of file Memory.cpp.

223  {
224  QUOTA_LIMITS quota;
225  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) ) {
226  if ( long( quota.PagefileLimit ) == -1 ) return -1; // LONG_MAX;
227  return adjustMemory( unit, quota.PagefileLimit );
228  }
229  return 0;
230 }

◆ virtualMemoryPeak()

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

Basic Process Information: priority boost.

Definition at line 216 of file Memory.cpp.

216  {
217  VM_COUNTERS info;
218  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.PeakVirtualSize );
219  return -2;
220 }
System::getErrorString
GAUDI_API const std::string getErrorString(unsigned long error)
Retrieve error code as string for a given error.
Definition: System.cpp:271
System::GByte
@ GByte
Definition: Memory.h:50
System::PR_recursive
@ PR_recursive
Definition: PathResolver.cpp:33
System::ProcessLdtInformation
@ ProcessLdtInformation
Definition: ProcessDescriptor.cpp:27
System::milliSec
@ milliSec
Definition: Timing.h:54
MSG::hex
MsgStream & hex(MsgStream &log)
Definition: MsgStream.h:277
compareOutputFiles.sname
sname
Definition: compareOutputFiles.py:483
System::currentTime< Month >
template long long currentTime< Month >()
System::Hour
@ Hour
Definition: Timing.h:54
System::homeDirectory
GAUDI_API std::string homeDirectory()
Definition: Environment.cpp:64
System::MByte
@ MByte
Definition: Memory.h:50
System::ProcessBasicInformation
@ ProcessBasicInformation
Definition: ProcessDescriptor.cpp:17
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
System::getLastError
GAUDI_API unsigned long getLastError()
Get last system known error.
Definition: System.cpp:255
System::ProcessAffinityMask
@ ProcessAffinityMask
Definition: ProcessDescriptor.cpp:38
System::EntryPoint
unsigned long(* EntryPoint)(const unsigned long iid, void **ppvObject)
Definition of the "generic" DLL entry point function.
Definition: System.h:41
System::adjustTime< Month >
long long adjustTime< Month >(long long t)
Definition: Timing.h:237
gaudirun.s
string s
Definition: gaudirun.py:346
System::ProcessWx86Information
@ ProcessWx86Information
Definition: ProcessDescriptor.cpp:36
System::Year
@ Year
Definition: Timing.h:54
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:376
System::EByte
@ EByte
Definition: Memory.h:50
System::ProcessVmCounters
@ ProcessVmCounters
Definition: ProcessDescriptor.cpp:20
System::microSec
@ microSec
Definition: Timing.h:54
NewInputWrite.fetch
fetch
Definition: NewInputWrite.py:45
System::adjustMemory
GAUDI_API long adjustMemory(MemoryUnit typ, long value)
Convert time from kByte to requested representation (Experts only)
Definition: Memory.cpp:25
System::moduleNameFull
GAUDI_API const std::string & moduleNameFull()
Get the full name of the (executable/DLL) file.
Definition: ModuleInfo.cpp:68
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:204
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:116
System::currentTime< Hour >
template long long currentTime< Hour >()
gaudirun.c
c
Definition: gaudirun.py:525
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:301
System::ProcessAccessToken
@ ProcessAccessToken
Definition: ProcessDescriptor.cpp:26
System::getStackLevel
GAUDI_API bool getStackLevel(void *addresses, void *&addr, std::string &fnc, std::string &lib)
System::backTrace
GAUDI_API int backTrace(void **addresses, const int depth)
GaudiPartProp.tests.id
id
Definition: tests.py:111
System::PriorityBoost
@ PriorityBoost
Definition: SystemBase.h:15
System::MaxProcessInfoClass
@ MaxProcessInfoClass
Definition: ProcessDescriptor.cpp:40
System::EXECUTABLE
@ EXECUTABLE
Definition: ModuleInfo.h:23
System::osName
GAUDI_API const std::string & osName()
OS name.
Definition: System.cpp:312
System::PR_regular_file
@ PR_regular_file
Definition: PathResolver.cpp:31
System::nanoSec
@ nanoSec
Definition: Timing.h:54
System::ProcessEllapsedTime
@ ProcessEllapsedTime
Definition: ProcessDescriptor.cpp:41
System::accountName
GAUDI_API const std::string & accountName()
User login name.
Definition: System.cpp:339
System::Month
@ Month
Definition: Timing.h:54
System::currentTime< Year >
template long long currentTime< Year >()
Gaudi.CommonGaudiConfigurables.mod
mod
Definition: CommonGaudiConfigurables.py:39
bug_34121.t
t
Definition: bug_34121.py:31
System::adjustTime< milliSec >
long long adjustTime< milliSec >(long long t)
Definition: Timing.h:225
System::adjustTime< Day >
long long adjustTime< Day >(long long t)
Definition: Timing.h:209
System::adjustTime< Year >
long long adjustTime< Year >(long long t)
Definition: Timing.h:205
System::ProcessEnableAlignmentFaultFixup
@ ProcessEnableAlignmentFaultFixup
Definition: ProcessDescriptor.cpp:34
System::NoFetch
@ NoFetch
Definition: SystemBase.h:15
System::ProcessTimes
@ ProcessTimes
Definition: ProcessDescriptor.cpp:21
cpluginsvc.func
func
Definition: cpluginsvc.py:235
System::PR_file_type
PR_file_type
Definition: PathResolver.cpp:31
System::adjustTime< Native >
long long adjustTime< Native >(long long t)
Definition: Timing.h:241
System::Memory
@ Memory
Definition: SystemBase.h:15
MSG::dec
MsgStream & dec(MsgStream &log)
Definition: MsgStream.h:273
System::System
@ System
Definition: SystemBase.h:15
System::PR_local
@ PR_local
Definition: PathResolver.cpp:33
System::ProcessRaisePriority
@ ProcessRaisePriority
Definition: ProcessDescriptor.cpp:23
Io::UNKNOWN
@ UNKNOWN
Definition: IFileMgr.h:147
System::ProcessDefaultHardErrorMode
@ ProcessDefaultHardErrorMode
Definition: ProcessDescriptor.cpp:29
System::currentTime< milliSec >
template long long currentTime< milliSec >()
System::tickCount
GAUDI_API long long tickCount()
Retrieve the number of ticks since system startup.
Definition: Timing.cpp:87
System::currentTime
GAUDI_API long long currentTime()
Retrieve absolute system time.
Definition: Timing.h:247
System::adjustTime< nanoSec >
long long adjustTime< nanoSec >(long long t)
Definition: Timing.h:233
System::ProcessUserModeIOPL
@ ProcessUserModeIOPL
Definition: ProcessDescriptor.cpp:33
System::ProcessDebugPort
@ ProcessDebugPort
Definition: ProcessDescriptor.cpp:24
System::ProcessLdtSize
@ ProcessLdtSize
Definition: ProcessDescriptor.cpp:28
System::ProcessPriorityClass
@ ProcessPriorityClass
Definition: ProcessDescriptor.cpp:35
instrset_detect
int instrset_detect(void)
Definition: instrset_detect.cpp:63
System::Byte
@ Byte
Definition: Memory.h:50
System::Modules
@ Modules
Definition: SystemBase.h:15
System::getEnv
GAUDI_API std::vector< std::string > getEnv()
get all environment variables
Definition: System.cpp:403
System::RemainTime
@ RemainTime
Definition: SystemBase.h:15
System::adjustTime< microSec >
long long adjustTime< microSec >(long long t)
Definition: Timing.h:229
System::PR_directory
@ PR_directory
Definition: PathResolver.cpp:31
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
System::moduleName
GAUDI_API const std::string & moduleName()
Get the name of the (executable/DLL) file without file-type.
Definition: ModuleInfo.cpp:45
System::exeHandle
GAUDI_API ImageHandle exeHandle()
Handle to the executable file running.
Definition: ModuleInfo.cpp:149
System::Creator
void *(* Creator)()
Definition of the "generic" DLL entry point function.
Definition: System.h:43
System::currentTime< microSec >
template long long currentTime< microSec >()
System::currentTime< Min >
template long long currentTime< Min >()
System::adjustTime< Min >
long long adjustTime< Min >(long long t)
Definition: Timing.h:217
System::moduleHandle
GAUDI_API ImageHandle moduleHandle()
Handle to currently executed module.
Definition: ModuleInfo.cpp:128
System::adjustTime< Hour >
long long adjustTime< Hour >(long long t)
Definition: Timing.h:213
System::ProcessBasics
@ ProcessBasics
Definition: SystemBase.h:15
gaudirun.type
type
Definition: gaudirun.py:160
System::Times
@ Times
Definition: SystemBase.h:15
System::Sec
@ Sec
Definition: Timing.h:54
System::Quota
@ Quota
Definition: SystemBase.h:15
System::currentTime< Sec >
template long long currentTime< Sec >()
System::Day
@ Day
Definition: Timing.h:54
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:99
System::ModuleType
ModuleType
Definition: ModuleInfo.h:23
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
System::adjustTime< Sec >
long long adjustTime< Sec >(long long t)
Definition: Timing.h:221
System::ProcessPooledUsageAndLimits
@ ProcessPooledUsageAndLimits
Definition: ProcessDescriptor.cpp:31
System::ProcessWorkingSetWatch
@ ProcessWorkingSetWatch
Definition: ProcessDescriptor.cpp:32
System::currentTime< Native >
template long long currentTime< Native >()
System::Native
@ Native
Definition: Timing.h:54
System::currentTime< Day >
template long long currentTime< Day >()
gaudirun.args
args
Definition: gaudirun.py:336
System::Min
@ Min
Definition: Timing.h:54
System::adjustTime
GAUDI_API long long adjustTime(TimeType typ, long long timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition: Timing.cpp:47
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:141
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:351
System::kByte
@ kByte
Definition: Memory.h:50
System::PR_search_type
PR_search_type
Definition: PathResolver.cpp:33
System::ProcessQuotaLimits
@ ProcessQuotaLimits
Definition: ProcessDescriptor.cpp:18
System::machineType
GAUDI_API const std::string & machineType()
Machine type.
Definition: System.cpp:324
System::ProcessIoPortHandlers
@ ProcessIoPortHandlers
Definition: ProcessDescriptor.cpp:30
System::ProcessExceptionPort
@ ProcessExceptionPort
Definition: ProcessDescriptor.cpp:25
System::TByte
@ TByte
Definition: Memory.h:50
System::hostName
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:306
System::SHAREDLIB
@ SHAREDLIB
Definition: ModuleInfo.h:23
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:100
System::getLastErrorString
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
Definition: System.cpp:265
GaudiKernel.Constants.TRUE
TRUE
Definition: Constants.py:37
System::ProcessIoCounters
@ ProcessIoCounters
Definition: ProcessDescriptor.cpp:19
System::ProcessPriorityBoost
@ ProcessPriorityBoost
Definition: ProcessDescriptor.cpp:39
System::systemStart
GAUDI_API long long systemStart(TimeType typ=Sec)
Maximum processing time left for this process.
Definition: Timing.cpp:128
System::PByte
@ PByte
Definition: Memory.h:50
System::currentTime< nanoSec >
template long long currentTime< nanoSec >()
System::osVersion
GAUDI_API const std::string & osVersion()
OS version.
Definition: System.cpp:318
GaudiKernel.Constants.FALSE
FALSE
Definition: Constants.py:38
System::ProcessBasePriority
@ ProcessBasePriority
Definition: ProcessDescriptor.cpp:22
System::ProcessHandleCount
@ ProcessHandleCount
Definition: ProcessDescriptor.cpp:37
System::IO
@ IO
Definition: SystemBase.h:15
System::UNKNOWN
@ UNKNOWN
Definition: ModuleInfo.h:23