The Gaudi Framework  master (37c0b60a)
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::stringmoduleName ()
 Get the name of the (executable/DLL) file without file-type. More...
 
GAUDI_API const std::stringmoduleNameFull ()
 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::stringexeName ()
 Name of the executable file running. More...
 
GAUDI_API const std::vector< std::stringlinkedModules ()
 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::stringhostName ()
 Host name. More...
 
GAUDI_API const std::stringosName ()
 OS name. More...
 
GAUDI_API const std::stringosVersion ()
 OS version. More...
 
GAUDI_API const std::stringmachineType ()
 Machine type. More...
 
GAUDI_API int instructionsetLevel ()
 Instruction Set "Level". More...
 
GAUDI_API const std::stringaccountName ()
 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::stringcmdLineArgs ()
 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::stringgetEnv ()
 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 47 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 45 of file System.h.

◆ ImageHandle

typedef void * System::ImageHandle

Definition of an image handle.

Definition at line 40 of file ModuleInfo.h.

◆ PPEB

typedef struct _PEB* System::PPEB

Basic Process Information NtQueryInformationProcess using ProcessBasicInfo.

Definition at line 27 of file ProcessDescriptor.h.

◆ ProcessHandle

typedef void * System::ProcessHandle

Definition of the process handle.

Definition at line 42 of file ModuleInfo.h.

◆ ThreadHandle

typedef void* System::ThreadHandle

A Thread handle.

Definition at line 118 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 28 of file SystemBase.h.

◆ MemoryUnit

Unit of memory.

Enumerator
Byte 
kByte 
MByte 
GByte 
TByte 
PByte 
EByte 

Definition at line 65 of file Memory.h.

◆ ModuleType

Enumerator
UNKNOWN 
SHAREDLIB 
EXECUTABLE 

Definition at line 38 of file ModuleInfo.h.

◆ PR_file_type

Enumerator
PR_regular_file 
PR_directory 

Definition at line 45 of file PathResolver.cpp.

◆ PR_search_type

Enumerator
PR_local 
PR_recursive 

Definition at line 47 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 32 of file ProcessDescriptor.cpp.

◆ TimeType

Time type for conversion.

Enumerator
Year 
Month 
Day 
Hour 
Min 
Sec 
milliSec 
microSec 
nanoSec 
Native 

Definition at line 67 of file Timing.h.

Function Documentation

◆ accountName()

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

User login name.

Definition at line 353 of file System.cpp.

353  {
354  static const std::string account = Platform::accountName();
355  return account;
356 }

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

44  {
45  if ( value != -1 ) {
46  switch ( unit ) {
47  case Byte:
48  break;
49  case kByte:
50  value = value / 1024;
51  break;
52  case MByte:
53  value = ( value / 1024 ) / 1024;
54  break;
55  case GByte:
56  value = ( ( value / 1024 ) / 1024 ) / 1024;
57  break;
58  case TByte:
59  value = ( ( ( value / 1024 ) / 1024 ) / 1024 ) / 1024;
60  break;
61  case PByte:
62  value = ( ( ( ( value / 1024 ) / 1024 ) / 1024 ) / 1024 ) / 1024;
63  break;
64  case EByte:
65  value = ( ( ( ( ( value / 1024 ) / 1024 ) / 1024 ) / 1024 ) / 1024 ) / 1024;
66  break;
67  default:
68  value = -1;
69  break;
70  }
71  }
72  return value;
73 }

◆ 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 222 of file Timing.h.

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

◆ adjustTime< Hour >()

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

Definition at line 226 of file Timing.h.

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

◆ adjustTime< microSec >()

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

Definition at line 242 of file Timing.h.

242  {
243  return ( t == -1 ) ? t : t /= ( 10LL );
244  }

◆ adjustTime< milliSec >()

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

Definition at line 238 of file Timing.h.

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

◆ adjustTime< Min >()

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

Definition at line 230 of file Timing.h.

230  {
231  return ( t == -1 ) ? t : t /= ( 60 * 1000 * 1000 * 10 );
232  }

◆ adjustTime< Month >()

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

Definition at line 250 of file Timing.h.

250  {
251  return ( t == -1 ) ? t : t /= ( 1LL * 30 * 24 * 60 * 60 * 1000 * 1000 * 10 );
252  }

◆ adjustTime< nanoSec >()

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

Definition at line 246 of file Timing.h.

246  {
247  return ( t == -1 ) ? t : t *= 100LL;
248  }

◆ adjustTime< Native >()

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

Definition at line 254 of file Timing.h.

254  {
255  return t;
256  }

◆ adjustTime< Sec >()

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

Definition at line 234 of file Timing.h.

234  {
235  return ( t == -1 ) ? t : t /= ( 1000 * 1000 * 10 );
236  }

◆ adjustTime< Year >()

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

Definition at line 218 of file Timing.h.

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

◆ affinityMask()

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

Basic Process Information: Affinity mask.

Definition at line 96 of file Memory.cpp.

96  {
97  PROCESS_BASIC_INFORMATION info;
98  if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.AffinityMask;
99  return 0;
100 }

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

362 { 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 371 of file System.cpp.

371  {
372  auto helperFunc = []( const std::vector<std::string>& args ) -> std::vector<const char*> {
374  std::transform( args.begin(), args.end(), std::back_inserter( result ),
375  []( const std::string& s ) { return s.c_str(); } );
376  return result;
377  };
378  static const std::vector<const char*> args = helperFunc( cmdLineArgs() );
379  // We rely here on the fact that a vector's allocation table is contiguous
380  return (char**)&( args[0] );
381 }

◆ backTrace() [1/2]

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

Definition at line 447 of file System.cpp.

447  {
448  try {
449  // Always hide the first two levels of the stack trace (that's us)
450  const size_t totalOffset = offset + 2;
451  const size_t totalDepth = depth + totalOffset;
452 
453  std::string fnc, lib;
454 
455  std::vector<void*> addresses( totalDepth, nullptr );
456  const size_t count = System::backTrace( addresses.data(), totalDepth );
457  for ( size_t i = totalOffset; i < count; ++i ) {
458  void* addr = nullptr;
459 
460  if ( System::getStackLevel( addresses[i], addr, fnc, lib ) ) {
461  std::ostringstream ost;
462  ost << "#" << std::setw( 3 ) << std::setiosflags( std::ios::left ) << i - totalOffset + 1;
463  ost << std::hex << addr << std::dec << " " << fnc << " [" << lib << "]" << std::endl;
464  btrace += ost.str();
465  }
466  }
467  return true;
468  } catch ( const std::bad_alloc& e ) { return false; }
469 }

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

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

◆ breakExecution() [1/2]

long System::breakExecution ( )

Break the execution of the application and invoke the debugger.

Definition at line 57 of file Debugger.cpp.

57  {
58 #ifdef _WIN32
59  _asm int 3 return 1;
60 #else
61  // I have no clue how to do this in linux
62  return 0;
63 #endif
64 }

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

67  {
68 #ifdef _WIN32
69  long result = 0;
70  if ( pid == Win::_getpid() ) {
71  _asm int 3 return 1;
72  } else {
73  Win::LPTHREAD_START_ROUTINE fun;
74  Win::HANDLE th, ph;
75  Win::HINSTANCE mh;
76  Win::DWORD id;
77  mh = Win::LoadLibrary( "Kernel32" );
78  if ( 0 != mh ) {
79  fun = (Win::LPTHREAD_START_ROUTINE)Win::GetProcAddress( mh, "DebugBreak" );
80  if ( 0 != fun ) {
81  ph = Win::OpenProcess( PROCESS_ALL_ACCESS, TRUE, pid );
82  if ( 0 != ph ) {
83  th = Win::CreateRemoteThread( ph, NULL, 0, fun, 0, 0, &id );
84  if ( 0 != th ) {
85  Win::CloseHandle( th );
86  result = 1;
87  }
88  Win::CloseHandle( ph );
89  }
90  }
91  Win::FreeLibrary( mh );
92  }
93  }
94  if ( result != 1 ) result = Win::GetLastError();
95  return result;
96 #else
97  // I have no clue how to do this in linux
98  return pid;
99 #endif
100 }

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

365  {
367  return args;
368 }

◆ 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 260 of file Timing.h.

260  {
261 #ifdef _WIN32
262  long long current = 0;
263  ::GetSystemTimeAsFileTime( (FILETIME*)&current );
264  return adjustTime<T>( current - UNIX_BASE_TIME );
265 #else
266  struct timeval tv;
267  ::gettimeofday( &tv, 0 );
268  return adjustTime<T>( ( tv.tv_sec * 1000000 + tv.tv_usec ) * 10 );
269 #endif
270  }

◆ 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 260 of file Timing.h.

260  {
261 #ifdef _WIN32
262  long long current = 0;
263  ::GetSystemTimeAsFileTime( (FILETIME*)&current );
264  return adjustTime<T>( current - UNIX_BASE_TIME );
265 #else
266  struct timeval tv;
267  ::gettimeofday( &tv, 0 );
268  return adjustTime<T>( ( tv.tv_sec * 1000000 + tv.tv_usec ) * 10 );
269 #endif
270  }

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

168  {
169 #ifdef _WIN32
170  if ( processHandle() ) {
171  static HINSTANCE handle = 0;
172  DWORD cbNeeded;
173  if ( 0 == handle && _psApi ) {
174  if ( _psApi.EnumProcessModules( processHandle(), &handle, sizeof( ModuleHandle ), &cbNeeded ) ) {}
175  }
176  return handle;
177  }
178  return 0;
179 #elif defined( __linux ) || defined( __APPLE__ )
180  // This does NOT work!
181  static Dl_info infoBuf, *info = &infoBuf;
182  if ( !info ) {
183  void* handle = ::dlopen( nullptr, RTLD_LAZY );
184  // printf("Exe handle:%X\n", handle);
185  if ( handle ) {
186  void* func = ::dlsym( handle, "main" );
187  // printf("Exe:Func handle:%X\n", func);
188  if ( func ) {
189  if ( 0 != ::dladdr( func, &infoBuf ) ) {
190  // std::cout << "All OK" << std::endl;
191  info = &infoBuf;
192  }
193  }
194  }
195  }
196  return info;
197 #elif __hpux
198  // Don't know how to solve this .....
199  return 0;
200 #endif
201 }

◆ exeName()

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

Name of the executable file running.

Definition at line 203 of file ModuleInfo.cpp.

203  {
204  static std::string module( "" );
205  if ( module.length() == 0 ) {
206  char name[PATH_MAX] = { "Unknown.module" };
207  name[0] = 0;
208 #ifdef _WIN32
209  if ( _psApi && processHandle() ) {
210  _psApi.GetModuleFileNameExA( processHandle(), (HINSTANCE)exeHandle(), name, sizeof( name ) );
211  module = name;
212  }
213 #elif defined( __linux ) || defined( __APPLE__ )
214  char cmd[512];
215  ::sprintf( cmd, "/proc/%d/exe", ::getpid() );
216  module = "Unknown";
217  if ( ::readlink( cmd, name, sizeof( name ) ) >= 0 ) module = name;
218 #elif __hpux
219  if ( ::realpath( ( (HMODULE*)exeHandle() )->dsc.filename, name ) ) module = name;
220 #endif
221  }
222  return module;
223 }

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

103  {
104  PROCESS_BASIC_INFORMATION info;
105  if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.ExitStatus;
106  return -2;
107 }

◆ getEnv() [1/4]

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

get all environment variables

get all defined environment vars

Definition at line 417 of file System.cpp.

417  {
418 #if defined( _WIN32 )
419 # define environ _environ
420 #elif defined( __APPLE__ )
421  static char** environ = *_NSGetEnviron();
422 #endif
424  for ( int i = 0; environ[i] != nullptr; ++i ) { vars.push_back( environ[i] ); }
425  return vars;
426 }

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

390  {
391  char* env;
392  if ( ( env = getenv( var ) ) != nullptr ) {
393  return env;
394  } else {
395  return "UNKNOWN";
396  }
397 }

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

400  {
401  char* env;
402  if ( ( env = getenv( var ) ) != nullptr ) {
403  value = env;
404  return true;
405  } else {
406  return false;
407  }
408 }

◆ getEnv() [4/4]

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

Definition at line 100 of file System.h.

100 { 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 285 of file System.cpp.

285  {
286  std::string errString = "";
287 #ifdef _WIN32
288  LPVOID lpMessageBuffer;
289  ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error,
290  MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // The user default language
291  (LPTSTR)&lpMessageBuffer, 0, NULL );
292  errString = (const char*)lpMessageBuffer;
293  // Free the buffer allocated by the system
294  ::LocalFree( lpMessageBuffer );
295 #else
296  char* cerrString( nullptr );
297  // Remember: for linux dl* routines must be handled differently!
298  if ( error == 0xAFFEDEAD ) {
299  cerrString = ::dlerror();
300  if ( !cerrString ) cerrString = ::strerror( error );
301  if ( !cerrString ) {
302  cerrString = (char*)"Unknown error. No information found in strerror()!";
303  } else {
304  errString = std::string( cerrString );
305  }
306  errno = 0;
307  } else {
308  cerrString = ::strerror( error );
309  errString = std::string( cerrString );
310  }
311 #endif
312  return errString;
313 }

◆ getLastError()

unsigned long System::getLastError ( )

Get last system known error.

Retrieve last error code.

Definition at line 269 of file System.cpp.

269  {
270 #ifdef _WIN32
271  return ::GetLastError();
272 #else
273  // convert errno (int) to unsigned long
274  return static_cast<unsigned long>( static_cast<unsigned int>( errno ) );
275 #endif
276 }

◆ getLastErrorString()

const std::string System::getLastErrorString ( )

Get last system error as string.

Retrieve last error code as string.

Definition at line 279 of file System.cpp.

279  {
280  const std::string errString = getErrorString( getLastError() );
281  return errString;
282 }

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

264  {
265  return getProcedureByName( handle, name, (EntryPoint*)pFunction );
266 }

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

218  {
219 #ifdef _WIN32
220  *pFunction = ( EntryPoint )::GetProcAddress( (HINSTANCE)handle, name.data() );
221  if ( 0 == *pFunction ) { return System::getLastError(); }
222  return 1;
223 #elif defined( __linux )
224  *pFunction = reinterpret_cast<EntryPoint>( ::dlsym( handle, name.c_str() ) );
225  if ( !*pFunction ) {
226  errno = 0xAFFEDEAD;
227  // std::cout << "System::getProcedureByName>" << getLastErrorString() << std::endl;
228  return 0;
229  }
230  return 1;
231 #elif defined( __APPLE__ )
232  *pFunction = ( EntryPoint )::dlsym( handle, name.c_str() );
233  if ( !( *pFunction ) ) {
234  // Try with an underscore :
235  std::string sname = "_" + name;
236  *pFunction = ( EntryPoint )::dlsym( handle, sname.c_str() );
237  }
238  if ( 0 == *pFunction ) {
239  errno = 0xAFFEDEAD;
240  std::cout << "System::getProcedureByName>" << getLastErrorString() << std::endl;
241  // std::cout << "System::getProcedureByName> failure" << std::endl;
242  return 0;
243  }
244  return 1;
245 #elif __hpux
246  HMODULE* mod = (HMODULE*)handle;
247  if ( 0 != mod ) {
248  long ll1 = name.length();
249  for ( int i = 0; i < mod->numSym; i++ ) {
250  long ll2 = strlen( mod->sym[i].name );
251  if ( 0 != ::strncmp( mod->sym[i].name, name.c_str(), ( ll1 > ll2 ) ? ll1 : ll2 ) == 0 ) {
252  *pFunction = (EntryPoint)mod->sym[i].value;
253  return 1;
254  }
255  }
256  }
257  return 0;
258 #else
259  return 0;
260 #endif
261 }

◆ getProcess()

ProcessDescriptor * System::getProcess ( )
inline

Retrieve Process structure.

Definition at line 142 of file ProcessDescriptor.h.

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

◆ 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 ) ) {
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 320 of file System.cpp.

320  {
321  static const std::string host = Platform::hostName();
322  return host;
323 }

◆ instructionsetLevel()

int System::instructionsetLevel ( )

Instruction Set "Level".

Definition at line 343 of file System.cpp.

343  {
344 #ifdef __x86_64
345  using namespace Gaudi;
346  return instrset_detect();
347 #else
348  return -1;
349 #endif
350 }

◆ isEnvSet()

bool System::isEnvSet ( const char *  var)

Check if an environment variable is set or not.

Definition at line 410 of file System.cpp.

410 { 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 225 of file ModuleInfo.cpp.

225  {
226  if ( s_linkedModules.size() == 0 ) {
227 #ifdef _WIN32
228  char name[255]; // Maximum file name length on NT 4.0
229  DWORD cbNeeded;
230  HINSTANCE handle[1024];
231  if ( _psApi ) {
232  if ( _psApi.EnumProcessModules( processHandle(), handle, sizeof( handle ), &cbNeeded ) ) {
233  for ( size_t i = 0; i < cbNeeded / sizeof( HANDLE ); i++ ) {
234  if ( 0 < _psApi.GetModuleFileNameExA( processHandle(), handle[i], name, sizeof( name ) ) ) {
235  s_linkedModules.push_back( name );
236  }
237  }
238  }
239  }
240 #elif defined( __linux ) || defined( __APPLE__ )
241  char ff[512], cmd[1024], fname[1024], buf1[64], buf2[64], buf3[64], buf4[64];
242  ::sprintf( ff, "/proc/%d/maps", ::getpid() );
243  FILE* maps = ::fopen( ff, "r" );
244  while ( ::fgets( cmd, sizeof( cmd ), maps ) ) {
245  int len;
246  sscanf( cmd, "%s %s %s %s %d %s", buf1, buf2, buf3, buf4, &len, fname );
247  if ( len > 0 && strncmp( buf2, "r-xp", strlen( "r-xp" ) ) == 0 ) { s_linkedModules.push_back( fname ); }
248  }
249  ::fclose( maps );
250 #endif
251  }
252  return s_linkedModules;
253 }

◆ loadDynamicLib()

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

Load dynamic link library.

Definition at line 150 of file System.cpp.

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

◆ machineType()

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

Machine type.

Definition at line 338 of file System.cpp.

338  {
339  static const std::string mach = Platform::machineType();
340  return mach;
341 }

◆ mappedMemory()

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

Basic Process Information: priority boost.

Definition at line 197 of file Memory.cpp.

197  {
198  VM_COUNTERS info;
199  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.WorkingSetSize );
200  return -2;
201 }

◆ mappedMemoryPeak()

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

Basic Process Information: priority boost.

Definition at line 204 of file Memory.cpp.

204  {
205  VM_COUNTERS info;
206  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
207  return adjustMemory( unit, info.PeakWorkingSetSize );
208  return -2;
209 }

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

220  {
221  QUOTA_LIMITS quota;
222  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
223  return adjustMemory( unit, quota.MaximumWorkingSetSize );
224  return 0;
225 }

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

212  {
213  QUOTA_LIMITS quota;
214  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
215  return adjustMemory( unit, quota.MinimumWorkingSetSize );
216  return 0;
217 }

◆ moduleHandle()

System::ImageHandle System::moduleHandle ( )

Handle to currently executed module.

Definition at line 147 of file ModuleInfo.cpp.

147  {
148  if ( !ModuleHandle ) {
149  if ( processHandle() ) {
150 #ifdef _WIN32
151  static HINSTANCE handle = 0;
152  DWORD cbNeeded;
153  if ( 0 == handle && _psApi ) {
154  if ( _psApi.EnumProcessModules( processHandle(), &handle, sizeof( ModuleHandle ), &cbNeeded ) ) {}
155  }
156  return handle;
157 #elif defined( __linux ) || defined( __APPLE__ )
158  static Dl_info info;
159  if ( ::dladdr( reinterpret_cast<void*>( System::moduleHandle ), &info ) ) return &info;
160 #elif __hpux
161  return 0; // Don't know how to solve this .....
162 #endif
163  }
164  }
165  return ModuleHandle;
166 }

◆ 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 64 of file ModuleInfo.cpp.

64  {
65  static std::string module( "" );
66  if ( module == "" ) {
67  if ( processHandle() && moduleHandle() ) {
68 #ifdef _WIN32
69  char moduleName[256] = { "Unknown.module" };
70  moduleName[0] = 0;
71  if ( _psApi ) {
72  _psApi.GetModuleBaseNameA( processHandle(), (HINSTANCE)moduleHandle(), moduleName, sizeof( moduleName ) );
73  }
75 #elif defined( __linux ) || defined( __APPLE__ )
76  std::string mod = ::basename( (char*)( (Dl_info*)moduleHandle() )->dli_fname );
77 #elif __hpux
78  std::string mod = ::basename( ( (HMODULE*)moduleHandle() )->dsc.filename );
79 #endif
80  module = mod.substr( 0, mod.rfind( '.' ) );
81  }
82  }
83  return module;
84 }

◆ moduleNameFull()

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

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

Retrieve full name of module.

Definition at line 87 of file ModuleInfo.cpp.

87  {
88  static std::string module( "" );
89  if ( module == "" ) {
90  if ( processHandle() && moduleHandle() ) {
91  char name[PATH_MAX] = { "Unknown.module" };
92  name[0] = 0;
93 #ifdef _WIN32
94  if ( _psApi ) {
95  _psApi.GetModuleFileNameExA( processHandle(), (HINSTANCE)moduleHandle(), name, sizeof( name ) );
96  module = name;
97  }
98 #else
99  const char* path =
100 # if defined( __linux ) || defined( __APPLE__ )
101  ( (Dl_info*)moduleHandle() )->dli_fname;
102 # elif __hpux
103  ( (HMODULE*)moduleHandle() )->dsc.filename;
104 # endif
105  if ( ::realpath( path, name ) ) module = name;
106 #endif
107  }
108  }
109  return module;
110 }

◆ moduleType()

System::ModuleType System::moduleType ( )

Get type of the module.

Definition at line 113 of file ModuleInfo.cpp.

113  {
114  static ModuleType type = UNKNOWN;
115  if ( type == UNKNOWN ) {
116  const std::string& module = moduleNameFull();
117  size_t loc = module.rfind( '.' ) + 1;
118  if ( loc == 0 )
119  type = EXECUTABLE;
120  else if ( module[loc] == 'e' || module[loc] == 'E' )
121  type = EXECUTABLE;
122 #ifdef _WIN32
123  else if ( module[loc] == 'd' || module[loc] == 'D' )
124 #else
125  else if ( module[loc] == 's' && module[loc + 1] == 'o' )
126 #endif
127  type = SHAREDLIB;
128  else
129  type = UNKNOWN;
130  }
131  return type;
132 }

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

125  {
126  VM_COUNTERS info;
127  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
128  return adjustMemory( unit, info.QuotaNonPagedPoolUsage );
129  return -2;
130 }

◆ 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 133 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 }

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

117  {
118  VM_COUNTERS info;
119  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
120  return adjustMemory( unit, info.QuotaPeakNonPagedPoolUsage );
121  return -2;
122 }

◆ numCmdLineArgs()

long System::numCmdLineArgs ( )

Number of arguments passed to the commandline.

Definition at line 359 of file System.cpp.

359 { 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 165 of file Memory.cpp.

165  {
166  VM_COUNTERS info;
167  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return info.PageFaultCount;
168  return -2;
169 }

◆ osName()

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

OS name.

Definition at line 326 of file System.cpp.

326  {
327  static const std::string osname = Platform::osName();
328  return osname;
329 }

◆ osVersion()

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

OS version.

Definition at line 332 of file System.cpp.

332  {
333  static const std::string osver = Platform::osVersion();
334  return osver;
335 }

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

141  {
142  VM_COUNTERS info;
143  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
144  return adjustMemory( unit, info.QuotaPagedPoolUsage );
145  return -2;
146 }

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

157  {
158  POOLED_USAGE_AND_LIMITS quota;
159  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) )
160  return adjustMemory( unit, quota.PagedPoolLimit );
161  return 0;
162 }

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

149  {
150  VM_COUNTERS info;
151  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) )
152  return adjustMemory( unit, info.QuotaPeakPagedPoolUsage );
153  return -2;
154 }

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

172  {
173  VM_COUNTERS info;
174  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.PagefileUsage );
175  return -2;
176 }

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

187  {
188  POOLED_USAGE_AND_LIMITS quota;
189  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) ) {
190  if ( long( quota.PagefileLimit ) < 0 ) return -1; // LONG_MAX;
191  return adjustMemory( unit, quota.PagefileLimit );
192  }
193  return -2;
194 }

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

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

◆ parentID()

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

Basic Process Information: Parent's process ID.

Definition at line 89 of file Memory.cpp.

89  {
90  PROCESS_BASIC_INFORMATION info;
91  if ( fetch != NoFetch && getProcess()->query( pid, ProcessBasics, &info ) ) return info.InheritedFromUniqueProcessId;
92  return 0;
93 }

◆ PathResolverFindDataFile()

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

Definition at line 197 of file PathResolver.cpp.

197  {
198  return PathResolver::find_file( logical_file_name, "DATAPATH" );
199  }

◆ PathResolverFindXMLFile()

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

Definition at line 193 of file PathResolver.cpp.

193  {
194  return PathResolver::find_file( logical_file_name, "XMLPATH" );
195  }

◆ priorityBoost()

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

Basic Process Information: priority boost.

Definition at line 110 of file Memory.cpp.

110  {
111  long info;
112  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return info;
113  return -2;
114 }

◆ processHandle()

void * System::processHandle ( )

Handle to running process.

Retrieve processhandle.

Definition at line 135 of file ModuleInfo.cpp.

135  {
136  static long pid = ::getpid();
137 #ifdef _WIN32
138  static HANDLE hP = ::OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid );
139 #else
140  static void* hP = (void*)pid;
141 #endif
142  return hP;
143 }

◆ procID()

long System::procID ( )

Basic Process Information: Process ID.

Definition at line 83 of file Memory.cpp.

83  {
84  static const long s_pid = ::getpid();
85  return s_pid;
86 }

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

503  {
504 #ifndef WIN32
505  // UNIX version
506  return value.empty() ?
507  // remove if set to nothing (and return success)
508  ::unsetenv( name.c_str() ),
509  0 :
510  // set the value
511  ::setenv( name.c_str(), value.c_str(), overwrite );
512 #else
513  // Windows version
514  if ( value.empty() ) {
515  // equivalent to unsetenv
516  return ::_putenv( ( name + "=" ).c_str() );
517  } else {
518  if ( !getenv( name.c_str() ) || overwrite ) {
519  // set if not yet present or overwrite is set (force)
520  return ::_putenv( ( name + "=" + value ).c_str() );
521  }
522  }
523  return 0; // if we get here, we are trying to set a variable already set, but
524  // not to overwrite.
525  // It is considered a success on Linux (man P setenv)
526 #endif
527 }

◆ setModuleHandle()

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

Attach module handle.

Definition at line 145 of file ModuleInfo.cpp.

145 { 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 120 of file System.h.

120 { 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 317 of file System.cpp.

317 { 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 315 of file System.cpp.

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

◆ unloadDynamicLib()

unsigned long System::unloadDynamicLib ( ImageHandle  handle)

unload dynamic link library

Definition at line 195 of file System.cpp.

195  {
196 #ifdef _WIN32
197  if ( !::FreeLibrary( (HINSTANCE)handle ) ) {
198 #elif defined( __linux ) || defined( __APPLE__ )
199  ::dlclose( handle );
200  if ( 0 ) {
201 #elif __hpux
202  // On HP we have to run finalization ourselves.....
203  Creator pFinalize = 0;
204  if ( getProcedureByName( handle, "_fini", &pFinalize ) ) { pFinalize(); }
205  HMODULE* mod = (HMODULE*)handle;
206  if ( 0 == ::shl_unload( mod->dsc.handle ) ) {
207  delete mod;
208  } else {
209 #else
210  if ( false ) {
211 #endif
212  return getLastError();
213  }
214  return 1;
215 }

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

228  {
229  VM_COUNTERS info;
230  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.VirtualSize );
231  return -2;
232 }

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

242  {
243  QUOTA_LIMITS quota;
244  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &quota ) ) {
245  if ( long( quota.PagefileLimit ) == -1 ) return -1; // LONG_MAX;
246  return adjustMemory( unit, quota.PagefileLimit );
247  }
248  return 0;
249 }

◆ virtualMemoryPeak()

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

Basic Process Information: priority boost.

Definition at line 235 of file Memory.cpp.

235  {
236  VM_COUNTERS info;
237  if ( fetch != NoFetch && getProcess()->query( pid, fetch, &info ) ) return adjustMemory( unit, info.PeakVirtualSize );
238  return -2;
239 }
System::getErrorString
GAUDI_API const std::string getErrorString(unsigned long error)
Retrieve error code as string for a given error.
Definition: System.cpp:285
System::GByte
@ GByte
Definition: Memory.h:65
System::PR_recursive
@ PR_recursive
Definition: PathResolver.cpp:47
System::ProcessLdtInformation
@ ProcessLdtInformation
Definition: ProcessDescriptor.cpp:43
System::milliSec
@ milliSec
Definition: Timing.h:67
std::strlen
T strlen(T... args)
compareOutputFiles.sname
sname
Definition: compareOutputFiles.py:483
std::string
STL class.
System::currentTime< Month >
template long long currentTime< Month >()
System::Hour
@ Hour
Definition: Timing.h:67
System::homeDirectory
GAUDI_API std::string homeDirectory()
Definition: Environment.cpp:64
System::MByte
@ MByte
Definition: Memory.h:65
System::ProcessBasicInformation
@ ProcessBasicInformation
Definition: ProcessDescriptor.cpp:33
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
std::bad_alloc
STL class.
System::getLastError
GAUDI_API unsigned long getLastError()
Get last system known error.
Definition: System.cpp:269
System::ProcessAffinityMask
@ ProcessAffinityMask
Definition: ProcessDescriptor.cpp:54
System::EntryPoint
unsigned long(* EntryPoint)(const unsigned long iid, void **ppvObject)
Definition of the "generic" DLL entry point function.
Definition: System.h:45
System::adjustTime< Month >
long long adjustTime< Month >(long long t)
Definition: Timing.h:250
gaudirun.s
string s
Definition: gaudirun.py:346
System::ProcessWx86Information
@ ProcessWx86Information
Definition: ProcessDescriptor.cpp:52
System::Year
@ Year
Definition: Timing.h:67
System::getEnv
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Definition: System.cpp:390
std::vector< std::string >
std::string::find
T find(T... args)
std::vector::size
T size(T... args)
std::back_inserter
T back_inserter(T... args)
std::type_info::name
T name(T... args)
System::EByte
@ EByte
Definition: Memory.h:65
System::ProcessVmCounters
@ ProcessVmCounters
Definition: ProcessDescriptor.cpp:36
System::microSec
@ microSec
Definition: Timing.h:67
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:44
System::moduleNameFull
GAUDI_API const std::string & moduleNameFull()
Get the full name of the (executable/DLL) file.
Definition: ModuleInfo.cpp:87
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:218
System::processHandle
GAUDI_API ProcessHandle processHandle()
Handle to running process.
Definition: ModuleInfo.cpp:135
System::currentTime< Hour >
template long long currentTime< Hour >()
std::sscanf
T sscanf(T... args)
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:315
System::ProcessAccessToken
@ ProcessAccessToken
Definition: ProcessDescriptor.cpp:42
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:28
System::MaxProcessInfoClass
@ MaxProcessInfoClass
Definition: ProcessDescriptor.cpp:56
System::EXECUTABLE
@ EXECUTABLE
Definition: ModuleInfo.h:38
System::osName
GAUDI_API const std::string & osName()
OS name.
Definition: System.cpp:326
std::fgets
T fgets(T... args)
System::PR_regular_file
@ PR_regular_file
Definition: PathResolver.cpp:45
System::nanoSec
@ nanoSec
Definition: Timing.h:67
std::hex
T hex(T... args)
std::vector::push_back
T push_back(T... args)
System::ProcessEllapsedTime
@ ProcessEllapsedTime
Definition: ProcessDescriptor.cpp:57
System::accountName
GAUDI_API const std::string & accountName()
User login name.
Definition: System.cpp:353
System::Month
@ Month
Definition: Timing.h:67
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:238
System::adjustTime< Day >
long long adjustTime< Day >(long long t)
Definition: Timing.h:222
System::adjustTime< Year >
long long adjustTime< Year >(long long t)
Definition: Timing.h:218
System::ProcessEnableAlignmentFaultFixup
@ ProcessEnableAlignmentFaultFixup
Definition: ProcessDescriptor.cpp:50
System::NoFetch
@ NoFetch
Definition: SystemBase.h:28
System::ProcessTimes
@ ProcessTimes
Definition: ProcessDescriptor.cpp:37
cpluginsvc.func
func
Definition: cpluginsvc.py:235
System::PR_file_type
PR_file_type
Definition: PathResolver.cpp:45
System::adjustTime< Native >
long long adjustTime< Native >(long long t)
Definition: Timing.h:254
System::Memory
@ Memory
Definition: SystemBase.h:28
std::cout
System::System
@ System
Definition: SystemBase.h:28
System::PR_local
@ PR_local
Definition: PathResolver.cpp:47
System::ProcessRaisePriority
@ ProcessRaisePriority
Definition: ProcessDescriptor.cpp:39
Io::UNKNOWN
@ UNKNOWN
Definition: IFileMgr.h:156
std::string::c_str
T c_str(T... args)
std::string::compare
T compare(T... args)
std::getenv
T getenv(T... args)
System::ProcessDefaultHardErrorMode
@ ProcessDefaultHardErrorMode
Definition: ProcessDescriptor.cpp:45
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:260
System::adjustTime< nanoSec >
long long adjustTime< nanoSec >(long long t)
Definition: Timing.h:246
System::ProcessUserModeIOPL
@ ProcessUserModeIOPL
Definition: ProcessDescriptor.cpp:49
System::ProcessDebugPort
@ ProcessDebugPort
Definition: ProcessDescriptor.cpp:40
System::ProcessLdtSize
@ ProcessLdtSize
Definition: ProcessDescriptor.cpp:44
System::ProcessPriorityClass
@ ProcessPriorityClass
Definition: ProcessDescriptor.cpp:51
instrset_detect
int instrset_detect(void)
Definition: instrset_detect.cpp:63
System::Byte
@ Byte
Definition: Memory.h:65
System::Modules
@ Modules
Definition: SystemBase.h:28
System::getEnv
GAUDI_API std::vector< std::string > getEnv()
get all environment variables
Definition: System.cpp:417
System::RemainTime
@ RemainTime
Definition: SystemBase.h:28
std::transform
T transform(T... args)
System::adjustTime< microSec >
long long adjustTime< microSec >(long long t)
Definition: Timing.h:242
System::PR_directory
@ PR_directory
Definition: PathResolver.cpp:45
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:64
System::exeHandle
GAUDI_API ImageHandle exeHandle()
Handle to the executable file running.
Definition: ModuleInfo.cpp:168
System::Creator
void *(* Creator)()
Definition of the "generic" DLL entry point function.
Definition: System.h:47
std::ostringstream
STL class.
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:230
System::moduleHandle
GAUDI_API ImageHandle moduleHandle()
Handle to currently executed module.
Definition: ModuleInfo.cpp:147
std::strncmp
T strncmp(T... args)
System::adjustTime< Hour >
long long adjustTime< Hour >(long long t)
Definition: Timing.h:226
System::ProcessBasics
@ ProcessBasics
Definition: SystemBase.h:28
gaudirun.type
type
Definition: gaudirun.py:160
System::Times
@ Times
Definition: SystemBase.h:28
System::Sec
@ Sec
Definition: Timing.h:67
System::Quota
@ Quota
Definition: SystemBase.h:28
System::currentTime< Sec >
template long long currentTime< Sec >()
System::Day
@ Day
Definition: Timing.h:67
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
System::ModuleType
ModuleType
Definition: ModuleInfo.h:38
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
System::adjustTime< Sec >
long long adjustTime< Sec >(long long t)
Definition: Timing.h:234
std::endl
T endl(T... args)
System::ProcessPooledUsageAndLimits
@ ProcessPooledUsageAndLimits
Definition: ProcessDescriptor.cpp:47
System::ProcessWorkingSetWatch
@ ProcessWorkingSetWatch
Definition: ProcessDescriptor.cpp:48
System::currentTime< Native >
template long long currentTime< Native >()
System::Native
@ Native
Definition: Timing.h:67
System::currentTime< Day >
template long long currentTime< Day >()
std::left
T left(T... args)
gaudirun.args
args
Definition: gaudirun.py:336
System::Min
@ Min
Definition: Timing.h:67
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
root_map_dump.maps
maps
Definition: root_map_dump.py:72
System::getProcess
ProcessDescriptor * getProcess()
Retrieve Process structure.
Definition: ProcessDescriptor.h:142
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:365
std::setiosflags
T setiosflags(T... args)
System::kByte
@ kByte
Definition: Memory.h:65
System::PR_search_type
PR_search_type
Definition: PathResolver.cpp:47
System::ProcessQuotaLimits
@ ProcessQuotaLimits
Definition: ProcessDescriptor.cpp:34
System::machineType
GAUDI_API const std::string & machineType()
Machine type.
Definition: System.cpp:338
System::ProcessIoPortHandlers
@ ProcessIoPortHandlers
Definition: ProcessDescriptor.cpp:46
std::count
T count(T... args)
System::ProcessExceptionPort
@ ProcessExceptionPort
Definition: ProcessDescriptor.cpp:41
std::string::empty
T empty(T... args)
System::TByte
@ TByte
Definition: Memory.h:65
std::ostringstream::str
T str(T... args)
System::hostName
GAUDI_API const std::string & hostName()
Host name.
Definition: System.cpp:320
System::SHAREDLIB
@ SHAREDLIB
Definition: ModuleInfo.h:38
std::setw
T setw(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
System::getLastErrorString
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
Definition: System.cpp:279
GaudiKernel.Constants.TRUE
TRUE
Definition: Constants.py:37
System::ProcessIoCounters
@ ProcessIoCounters
Definition: ProcessDescriptor.cpp:35
System::ProcessPriorityBoost
@ ProcessPriorityBoost
Definition: ProcessDescriptor.cpp:55
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:65
System::currentTime< nanoSec >
template long long currentTime< nanoSec >()
System::osVersion
GAUDI_API const std::string & osVersion()
OS version.
Definition: System.cpp:332
GaudiKernel.Constants.FALSE
FALSE
Definition: Constants.py:38
std::string::rfind
T rfind(T... args)
System::ProcessBasePriority
@ ProcessBasePriority
Definition: ProcessDescriptor.cpp:38
System::ProcessHandleCount
@ ProcessHandleCount
Definition: ProcessDescriptor.cpp:53
System::IO
@ IO
Definition: SystemBase.h:28
System::UNKNOWN
@ UNKNOWN
Definition: ModuleInfo.h:38