12 #ifndef __SPH_LOCK_FREE_LOGGER_H
13 #define __SPH_LOCK_FREE_LOGGER_H
190 unsigned int valid : 1;
192 unsigned int timestamped : 1;
194 unsigned int __reserved : 2;
196 unsigned int category : 12;
198 unsigned int subcat : 8;
200 unsigned int len : 8;
280 #define SPHLFLOGGER_CIRCULAR (1)
282 #define SPHLFLOGGER_CIRCULAR_WRAPED (1<<1)
284 #define SPHLFLOGGER_CIRCULAR_NOTFIRST (1<<2)
286 #define SPHLFLOGGER_CACHE_PREFETCH0 (1<<3)
288 #define SPHLFLOGGER_CACHE_PREFETCH1 (1<<4)
290 #define SPHLFLOGGER_CIRCULAR_RESETMASK (SPHLFLOGGER_CIRCULAR | \
291 SPHLFLOGGER_CACHE_PREFETCH0 | \
292 SPHLFLOGGER_CACHE_PREFETCH1)
327 unsigned short entry_stride,
328 unsigned int options);
357 unsigned short stride);
374 block_size_t alloc_size);
401 int catcode,
int subcode,
402 block_size_t alloc_size,
427 int catcode,
int subcode,
463 int catcode,
int subcode,
464 block_size_t alloc_size,
497 int catcode,
int subcode,
581 extern __C__ block_size_t
__C__ int SPHLFLoggerPrefetch(SPHLFLogger_t log)
Prefetch pages from the specific logger.
__C__ SPHLFLoggerHandle_t * SPHLFLoggerAllocTimeStamped(SPHLFLogger_t log, int catcode, int subcode, block_size_t alloc_size, SPHLFLoggerHandle_t *handlespace)
Allocate and initialize the header, of a timestamped logger entry, from the specified logger...
__C__ int SPHLFLoggerDestroy(SPHLFLogger_t log)
Destroys the logger and frees the SAS storage for reuse.
__C__ SPHLFLoggerHandle_t * SPHLFLoggerAllocStrideTimeStamped(SPHLFLogger_t log, int catcode, int subcode, SPHLFLoggerHandle_t *handlespace)
Allocate and initialize the header, of a timestamped logger entry, from the specified logger...
longPtr_t start_log
Definition: sphlflogger.h:272
Instance of a Lock Free Logger Iterator.
Definition: sphlflogger.h:264
__C__ int SPHLFLoggerResetIfFullSync(SPHLFLogger_t log)
Resets the specific logger to empty state synchronously if it is currently full.
char * next
Definition: sphlflogger.h:248
unsigned short int remaining
Definition: sphlflogger.h:252
__C__ SPHLFLogger_t SPHLFLoggerCreate(block_size_t buf_size)
Allocate and initialize a shared storage block as a Lock Free Event Logger.
__C__ int SPHLFLoggerEntryComplete(SPHLFLoggerHandle_t *entryhandle)
Marks the entry specified by the entry handle as complete.
Functions to access the Time Base register (PPC) or clock_gettime(CLOCK_MONOTONIC) measure time at hi...
longPtr_t current
Definition: sphlflogger.h:268
unsigned long long int sphtimer_t
Value from TB/TSC register (64-bits on all platforms).
Definition: sphtimer.h:66
sphLogEntryLayout_t detail
Definition: sphlflogger.h:212
__C__ int SPHLFLoggerEntryIsTimestamped(SPHLFLoggerHandle_t *entryhandle)
Return the status of the entry specified by the entry handle.
__C__ block_size_t SPHLFLoggerFreeSpace(SPHLFLogger_t log)
Returns the amount of free space (in bytes) remaining in the specified logger.
sphLogEntry_t. Fields defining the entry details word.
Definition: sphlflogger.h:188
Union of Entry details with 32-bit word for atomic update.
Definition: sphlflogger.h:208
Instance of a Lock Free Logger Entry Handle.
Definition: sphlflogger.h:244
__C__ int SPHLFLoggerWrapped(SPHLFLogger_t log)
Return the status of the specified logger.
unsigned short sphpid16_t
Common type for PID/TID values stored in Logger entries.
Definition: sphlflogger.h:217
__C__ int SPHLFLoggerSetCachePrefetch(SPHLFLogger_t log, int prefetch)
Set the cache-line prefetch options for entry allocate.
__C__ void * SPHLFLoggerAllocRaw(SPHLFLogger_t log, block_size_t alloc_size)
Return the address of a (raw) Logger entry allocated from the specified logger.
unsigned int options
Definition: sphlflogger.h:276
SPHLFLogger_t logger
Definition: sphlflogger.h:266
longPtr_t free
Definition: sphlflogger.h:270
__C__ SPHLFLogger_t SPHLFCircularLoggerCreate(block_size_t buf_size, unsigned short stride)
Allocate and initialize a shared storage block as a Lock Free Event Logger. Mark the logger as circul...
__C__ SPHLFLoggerHandle_t * SPHLFLoggerAllocTimeStampedNoLock(SPHLFLogger_t log, int catcode, int subcode, block_size_t alloc_size, SPHLFLoggerHandle_t *handlespace)
Allocate and initialize the header of a timestamped logger entry from the specified logger...
void * SPHLFLogger_t
Handle to an instance of SPH Lock Free Logger.
Definition: sphlflogger.h:173
unsigned long longPtr_t
unsigned int type, consistent with the size of a pointer and used for pointer calculations ...
Definition: sphlflogger.h:183
unsigned int sphLogEntryID_t
Aggregate type for handling sphLogEntryLayout_t.
Definition: sphlflogger.h:204
__C__ int SPHLFLoggerResetAsync(SPHLFLogger_t log)
Resets the specific logger to empty state asynchronously (without locking or atomic updates)...
__C__ int SPHLFLoggerFull(SPHLFLogger_t log)
Return the status of the specified logger.
sphLogEntryID_t idUnit
Definition: sphlflogger.h:210
__C__ SPHLFLogIterator_t * SPHLFLoggerCreateIterator(SPHLFLogger_t log, SPHLFLogIterator_t *iteratorSpace)
Creates a logger Iterator for reading sequential entries from a specific logger.
__C__ SPHLFLoggerHandle_t * SPHLFLoggerIteratorNext(SPHLFLogIterator_t *iterator, SPHLFLoggerHandle_t *handlespace)
For the provided Logger Iterator creates a entry handle for the next sequential Logger entry...
__C__ SPHLFLogger_t SPHLFLoggerInit(void *buf_seg, block_size_t buf_size)
Initialize a shared storage block as a Lock Free Event Logger.
__C__ int SPHLFLoggerEmpty(SPHLFLogger_t log)
Return the status of the specified logger.
SPHLFLogHeader_t * entry
Definition: sphlflogger.h:246
__C__ int SPHLFLoggerEntryIsComplete(SPHLFLoggerHandle_t *entryhandle)
Return the status of the entry specified by the entry handle.
#define __C__
ignore this macro behined the curtain
Definition: sphlflogger.h:179
longPtr_t end_log
Definition: sphlflogger.h:274
__C__ SPHLFLogger_t SPHLFLoggerInitWithStride(void *buf_seg, block_size_t buf_size, unsigned short entry_stride, unsigned int options)
Initialize a shared storage block as a Lock Free Event Logger with a fixed entry stride.
unsigned short int total_size
Definition: sphlflogger.h:250
__C__ SPHLFLoggerHandle_t * SPHLFLoggerAllocStrideTimeStampedNoLock(SPHLFLogger_t log, int catcode, int subcode, SPHLFLoggerHandle_t *handlespace)
Allocate and initialize the header, of a timestamped logger entry, from the specified logger...