Go to the documentation of this file. 1 #ifndef _OME_DEBUG_INFO_H
2 #define _OME_DEBUG_INFO_H "$Id: OMEdebugInfo.h 312 2020-03-21 21:25:35Z geoff $"
18 # define OMEdebugMethodInvocations (2 << 0)
19 # define OMEdebugObjectCreate (2 << 1)
20 # define OMEdebugObjectDelete (2 << 2)
21 # define OMEdebugThreadDelete (2 << 3)
22 # define OMEdebugIncludeArguments (2 << 4)
23 # define OMEdebugEvents (2 << 5)
24 # define OMEdebugExceptions (2 << 6)
25 # define OMEdebugBlockedInvocations (2 << 7)
26 # define OMEdebugOIL2instructions (2 << 9)
27 # define OMEdebugBadParameter (2 << 10)
28 # define OMEdebugProfileCounters (2 << 11)
31 # define __OME_LOG_LEVEL_BASE 20
32 # define OMEdebugLogLevel0 (1 << (__OME_LOG_LEVEL_BASE + 0))
33 # define OMEdebugLogLevel1 (1 << (__OME_LOG_LEVEL_BASE + 1))
34 # define OMEdebugLogLevel2 (1 << (__OME_LOG_LEVEL_BASE + 2))
35 # define OMEdebugLogLevel3 (1 << (__OME_LOG_LEVEL_BASE + 3))
38 # define OMEdebugEverything (~0)
39 # define OMEdebugAlways (~0)
40 # define OMEdebugNever (0)
59 rec->
next = startOfList;
64 if (startOfList == recToRemove) {
65 startOfList = recToRemove->
next;
69 while (rec !=
nullptr) {
70 if (rec == recToRemove) {
76 if (last ==
nullptr) {
77 startOfList = rec->
next;
94 virtual const char *getName(uint_fast32_t *retNameLen=
nullptr)
const = 0;
96 virtual const OMEtype getValue()
const = 0;
98 virtual void setValue(
const OMEtype &newV) = 0;
100 static OMEarray *listDefinedCounters();
110 if (startOfList ==
nullptr) {
111 o <<
"No FARGOS/VISTA OME counters are defined.\n";
115 o <<
"Counter\t\t\t\tValue\n";
119 const char *cp = rec->getName(&s_len);
121 int_fast32_t
l =
static_cast<int_fast32_t
>(s_len);
130 o << rec->getValue() <<
"\n";
145 template <
typename NUMTYPE>
183 virtual const char *
getName(uint_fast32_t *retNameLen=
nullptr)
const override {
196 result =
static_cast<const NUMTYPE
>(*this);
221 template <
size_t MAXLEN>
238 if (initVal !=
nullptr) {
253 const char *initVal=
nullptr) :
256 if (initVal !=
nullptr) {
264 virtual const char *
getName(uint_fast32_t *retNameLen=
nullptr)
const override {
272 result =
static_cast<const char *
>(*this);
312 # define OME_DEBUG_LEVEL_FLAG(l) (2 << (OME_LOG_LEVEL_BASE + l))
314 # define NOTE_DEFAULT_NLM(s) __defaultMess = s
318 # define DEFINE_NLM_MESSAGE(Lvl, MessID, AppName) \
319 if (((Lvl) == ~0) || ((Lvl) &OMEdebugFlag)) { \
320 OMEtype __messID, __nlmMessage; \
321 OMEarray param, paramInfo; \
322 OMEstring __defaultMess, __catName; \
323 uint32_t _paramSub = 0; \
327 # define AND_OUTPUT_NLM(o, t) \
328 OMEnlm __nlmRec(__defaultMess, ¶m, &__messID, &__catName, ¶mInfo); \
329 o << __nlmRec << t; \
332 # define AND_ASSIGN_INTO(v) \
333 OMEnlm __nlmRec(__defaultMess, ¶m, &__messID, &__catName, ¶mInfo); \
337 # define NEXT_NLM_PARAM param[_paramSub++]
const char * getName(uint_fast32_t *retNameLen=nullptr) const OME_ALWAYS_INLINE
Get variable name.
Definition: shared_variable.hpp:135
#define OMEdebugLogLevel1
Definition: OMEdebugInfo.h:33
Ïúíþ ð Ø ˜ ˜ __text __TEXT € __apple_names __DWARF __apple_objc __DWARF __apple_namespac__DWARF H X __apple_types __DWARF l
Definition: tmp3.o.cpp:1
#define OMEdebugThreadDelete
Definition: OMEdebugInfo.h:21
Base class for application profiling counters or numerical system information.
Definition: OMEdebugInfo.h:146
OME_DLL_EXPORT OMEprofileCounter< uint32_t > OMEreleaseVersion
Specifies FARGOS/VISTA Version release number.
const char s[]
Definition: t.cpp:4
SMV_StandaloneNumeric< uint32_t > OMEdebugFlag("debugFlag")
#define SIGINT
Definition: tmp.o.cpp:525
virtual ~OMEprofileRecord()
Definition: OMEdebugInfo.h:90
#define LOG_COMPONENT_COUT(component, lvl)
Convenience macro that uses LOG_COMPONENT_INTO to conditionally log a message to standard output.
Definition: logging_api.hpp:3022
#define SIGTERM
Definition: tmp.o.cpp:536
OMEprofileString(const char *varName, SharedMemoryVariableNode *parentNode, const char *initVal=nullptr)
Initialize a string with a constant value.
Definition: OMEdebugInfo.h:252
void dump_malloc_blocks(int age, int resetDumpTime)
Definition: test_malloc.c:199
#define OMEdebugObjectDelete
Definition: OMEdebugInfo.h:20
OMEprofileString(const char *varName, const char *initVal, SharedMemoryVariableManager *mgr=&DEFAULT_sharedMemoryVariableManager)
Initialize a profiling string, possibly with an initial value.
Definition: OMEdebugInfo.h:235
int OMEsetDebugFlag(const char *flagName, bool setFlag)
Set or clear named debug flag.
Definition: OMEdebugInfo.cpp:117
Implements associative array of OMEtype elements.
Definition: OMEassoc.h:112
#define SIGPIPE
Definition: tmp.o.cpp:529
OMEprofileRecord * next
Definition: OMEdebugInfo.h:55
Implements text and binary string storage.
Definition: OMEstring.h:305
virtual ~OMEprofileCounter()
Definition: OMEdebugInfo.h:181
#define SIGUSR1
Definition: tmp.o.cpp:542
static STREAMTYPE & outputCounters(STREAMTYPE &o)
Write a counter's value to an output stream.
Definition: OMEdebugInfo.h:108
Fundamental ANY type for FARGOS/VISTA Object Management Environment.
Definition: OMEbaseType.h:250
static const OMEtype getValueOfCounter(const char *name) NONNULL_PARAMETERS(1)
Return the value of an named variable.
Definition: OMEdebugInfo.cpp:355
Intermediate naming node for supporting variable naming hierarchies.
Definition: shared_variable.hpp:318
virtual const OMEtype getValue() const override
Retrieve the variable's value.
Definition: OMEdebugInfo.h:193
#define OMEdebugExceptions
Definition: OMEdebugInfo.h:24
int32_t OMEshutdownRequested()
Returns indication if the shutdown of the FARGOS/VISTA-based component has been requested.
Definition: OMEdebugInfo.cpp:68
static OMEarray * listDefinedCounters()
Get a list of all available information variables.
Definition: OMEdebugInfo.cpp:321
#define OMEdebugMethodInvocations
Definition: OMEdebugInfo.h:18
class OMEstring * s
Definition: OMEbaseType.h:299
#define NONNULL_CLASS_PARAMETERS(...)
Mark a function as never returning a null pointer.
Definition: compiler_hints.h:337
#define OMEdebugProfileCounters
Definition: OMEdebugInfo.h:28
#define NONNULL_PARAMETERS(...)
Mark parameters to a function as not permitting null pointers.
Definition: compiler_hints.h:335
void OMEinitDebugFlag(const char *param)
Set initial default flags, then parse a line of debugging options and set/clear specified flags.
Definition: OMEdebugInfo.cpp:268
SMV_StandaloneString< 128 > OMEadminProcessLabel("adminProcessLabel")
#define OMEdebugOIL2instructions
Definition: OMEdebugInfo.h:26
Base type for system information represented as strings.
Definition: OMEdebugInfo.h:222
virtual void setValue(const OMEtype &newV) override
Definition: OMEdebugInfo.h:281
SMV_StandaloneString< 128 > OMEstopReason("stopReason")
virtual const char * getName(uint_fast32_t *retNameLen=nullptr) const override
Definition: OMEdebugInfo.h:264
const char srcID[]
Definition: catSym.c:17
@ OME_STRING
Definition: OMEmanifests.h:85
#define SIGUSR2
Definition: tmp.o.cpp:543
#define OMEdebugLogLevel3
Definition: OMEdebugInfo.h:35
virtual void incValue(NUMTYPE amt=1)
A convenience function to increment a counter.
Definition: OMEdebugInfo.h:208
#define OMEdebugIncludeArguments
Definition: OMEdebugInfo.h:22
SharedMemoryVariableManager DEFAULT_sharedMemoryVariableManager
Default shared memory variable manager.
OMEprofileString< MAXLEN > & operator=(const char *v)
Definition: OMEdebugInfo.h:276
OME_DLL_EXPORT OMEprofileString< 32 > OMEvistaCPU
Specifies name of the underlying CPU architecture.
OME_FAST_CALL int stringToArrayOfTokens(OMEtype &result, const OMEstring &source, const char *delimeterList=nullptr, const int convertFlag=0)
Tokenizes a string and saves the parsed tokens as individual elements of an array.
Definition: utils.cpp:139
OMEprofileCounter(const char *varName, SharedMemoryVariableNode *parentNode, NUMTYPE initVal=0) NONNULL_CLASS_PARAMETERS(2)
Initialize a counter with a constant value.
Definition: OMEdebugInfo.h:174
OME_DLL_EXPORT OMEprofileCounter< uint32_t > OMEminorVersion
Specifies FARGOS/VISTA Version minor number.
#define OMEdebugObjectCreate
Definition: OMEdebugInfo.h:19
#define SIG_DFL
Definition: tmp.o.cpp:551
LogMaskType_t COMPONENT_LOG_MASK() app("app_logMask", &DEFAULT_sharedMemoryVariableManager, COMPONENT_LEVEL(app, defaultMask))
OME fundamental type implementation.
Base class for OME profiling variable.
Definition: OMEdebugInfo.h:51
SMV_StandaloneNumeric< uint32_t > OMEstopFlag("stopFlag")
External flag used to trigger stop of a FARGOS/VISTA Object Management Environment.
FARGOS Shared Memory Variable routines.
const char srcID[] OME_USED
Definition: tick_time.cpp:24
int flags
Definition: ethers.c:41
OMEprofileRecord()
Definition: OMEdebugInfo.h:86
OME_DLL_EXPORT OMEprofileString< 32 > OMEvistaOS
Specifies name of underlying native operating system.
Manager for collection of shared memory variables.
Definition: shared_variable.hpp:193
virtual const OMEtype getValue() const override
Definition: OMEdebugInfo.h:269
virtual void setValue(const OMEtype &newV) override
Set the variable's value.
Definition: OMEdebugInfo.h:200
#define MAX_MODULE_COMMENTS
Definition: OMEdebugInfo.cpp:33
#define LOG_COMPONENT_CERR(component, lvl)
Convenience macro that uses LOG_COMPONENT_INTO to conditionally log a message to standard error.
Definition: logging_api.hpp:3030
static void removeFromList(OMEprofileRecord *recToRemove)
Definition: OMEdebugInfo.h:63
#define OMEdebugEvents
Definition: OMEdebugInfo.h:23
OME debug and profiling interfaces.
NUMTYPE * getAddress() const OME_ALWAYS_INLINE
Get address of shared memory variable.
Definition: shared_variable.hpp:490
#define OME_DLL_EXPORT
Definition: compiler_hints.h:464
int trace_malloc
Definition: test_malloc.c:66
Implements sparse array of OMEtype elements.
Definition: OMEarray.h:75
OMEprofileCounter(const char *varName, NUMTYPE initVal=0, SharedMemoryVariableManager *mgr=&DEFAULT_sharedMemoryVariableManager) NONNULL_CLASS_PARAMETERS(2)
Initialize a counter with a potentially external source.
Definition: OMEdebugInfo.h:159
#define LOG_ENDLINE
Closing clause for text line output using << operators.
Definition: logging_api.hpp:2956
virtual const char * getName(uint_fast32_t *retNameLen=nullptr) const override
Return name of statistics variable.
Definition: OMEdebugInfo.h:183
void OMEdisplayModuleComments()
Convenience function to display module comments on standard error.
Definition: OMEdebugInfo.cpp:83
static void addToList(OMEprofileRecord *rec)
Definition: OMEdebugInfo.h:58
OMEprofileCounter< NUMTYPE > & operator=(const NUMTYPE v)
Definition: OMEdebugInfo.h:188
static OMEprofileRecord * startOfList
Definition: OMEdebugInfo.h:53
#define OMEdebugLogLevel2
Definition: OMEdebugInfo.h:34
void OMEnoteModuleComment(const char *commentText)
Note a comment module which can be display on demand.
Definition: OMEdebugInfo.cpp:50
SMV_StandaloneString< 128 > OMEadminStopReason("adminStopReason")
virtual ~OMEprofileString()
Definition: OMEdebugInfo.h:262
OME_DLL_EXPORT OMEprofileCounter< uint32_t > OMEmajorVersion
Specifies FARGOS/VISTA Version major number.
#define SA_SIGINFO
Definition: tmp.o.cpp:494
#define OMEdebugBlockedInvocations
Definition: OMEdebugInfo.h:25
void set_malloc_dump_time(unsigned long t, int blockSizeLimit)
Definition: test_malloc.c:266
#define OMEdebugEverything
Definition: OMEdebugInfo.h:38
#define SIG_IGN
Definition: tmp.o.cpp:554
static OMEassoc * getCounters()
Get a snapshot of all counters.
Definition: OMEdebugInfo.cpp:337