sphlfentry.h
Go to the documentation of this file.
/*
* Copyright (c) 2011-2015 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation, Steven Munroe - initial API and implementation
*/
#ifndef __SPH_LOCK_FREE_ENTRY_H
#define __SPH_LOCK_FREE_ENTRY_H
#include <string.h>
#include "sastype.h"
#include "sasatom.h"
#include "sphtimer.h"
typedef unsigned long longPtr_t;
typedef struct {
unsigned int valid : 1;
unsigned int timestamped : 1;
unsigned int allocated : 1;
unsigned int __reserved : 1;
unsigned int category : 12;
unsigned int subcat : 8;
unsigned int len : 8;
} sphLFEntryLayout_t;
typedef unsigned int sphLFEntryID_t;
typedef union {
sphLFEntryID_t idUnit;
sphLFEntryLayout_t detail;
} sphLFEntry_t;
typedef unsigned short sphpid16_t;
typedef struct {
sphLFEntry_t entryID;
sphpid16_t PID;
sphpid16_t TID;
sphtimer_t timeStamp;
} SPHLFEntryHeader_t;
typedef struct {
SPHLFEntryHeader_t *entry;
char *next;
unsigned short int total_size;
unsigned short int remaining;
} SPHLFEntryHandle_t;
static inline int
SPHLFEntryStrongComplete (SPHLFEntryHandle_t *handlespace)
{
int rc = 0;
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
sphLFEntry_t entrytemp;
sas_read_barrier();
entrytemp.idUnit = entryPtr->entryID.idUnit;
entrytemp.detail.valid = 1;
entryPtr->entryID.idUnit = entrytemp.idUnit;
return rc;
}
static inline int
SPHLFEntryWeakComplete (SPHLFEntryHandle_t *handlespace)
{
int rc = 0;
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
sphLFEntry_t entrytemp;
entrytemp.idUnit = entryPtr->entryID.idUnit;
entrytemp.detail.valid = 1;
entryPtr->entryID.idUnit = entrytemp.idUnit;
return rc;
}
static inline int
SPHLFEntryComplete (SPHLFEntryHandle_t *handlespace)
{
int rc = 0;
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
sphLFEntry_t entrytemp;
sas_write_barrier();
entrytemp.idUnit = entryPtr->entryID.idUnit;
entrytemp.detail.valid = 1;
entryPtr->entryID.idUnit = entrytemp.idUnit;
return rc;
}
static inline int
SPHLFEntryIsComplete (SPHLFEntryHandle_t *handlespace)
{
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
return (entryPtr->entryID.detail.valid == 1);
}
static inline int
SPHLFEntryIsTimestamped (SPHLFEntryHandle_t *handlespace)
{
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
return ((entryPtr->entryID.detail.valid == 1)
&&(entryPtr->entryID.detail.timestamped == 1));
}
static inline sphtimer_t
SPHLFEntryTimeStamp (SPHLFEntryHandle_t *handlespace)
{
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
sphtimer_t result = 0;
if ((entryPtr->entryID.detail.valid == 1)
&&(entryPtr->entryID.detail.timestamped == 1))
result = entryPtr->timeStamp;
return result;
}
static inline sphpid16_t
SPHLFEntryPID (SPHLFEntryHandle_t *handlespace)
{
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
sphpid16_t result = 0;
if ((entryPtr->entryID.detail.valid == 1)
&&(entryPtr->entryID.detail.timestamped == 1))
result = entryPtr->PID;
return result;
}
static inline sphpid16_t
SPHLFEntryTID (SPHLFEntryHandle_t *handlespace)
{
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
sphpid16_t result = 0;
if ((entryPtr->entryID.detail.valid == 1)
&&(entryPtr->entryID.detail.timestamped == 1))
result = entryPtr->TID;
return result;
}
static inline SPHLFEntryHeader_t*
SPHLFEntryHeader (SPHLFEntryHandle_t *handlespace)
{
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
if (entryPtr->entryID.detail.valid != 1)
entryPtr = NULL;
return entryPtr;
}
static inline int
SPHLFEntryCategory (SPHLFEntryHandle_t *handlespace)
{
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
int result = -1;
#if 0
printf ("SPHLFEntryCategory(%p) entry=%p id=%x\n",
handlespace, entryPtr, entryPtr->entryID.idUnit);
#endif
if (entryPtr->entryID.detail.valid == 1)
result = entryPtr->entryID.detail.category;
return result;
}
static inline int
SPHLFEntrySubcat (SPHLFEntryHandle_t *handlespace)
{
SPHLFEntryHeader_t *entryPtr = handlespace->entry;
int result = -1;
#if 0
printf ("SPHLFEntrySubcat(%p) entry=%p id=%x\n",
handlespace, entryPtr, entryPtr->entryID.idUnit);
#endif
if (entryPtr->entryID.detail.valid == 1)
result = entryPtr->entryID.detail.subcat;
return result;
}
static inline void*
SPHLFEntryGetFreePtr (SPHLFEntryHandle_t *handle)
{
char *ptr = handle->next;
return (void*)ptr;
}
#define SPHENTRYGETSTRUCTPTR(__handle, __struct) SPHLFEntryGetStructPtr(__handle, sizeof(__struct), __alignof__(__struct))
static inline void*
SPHLFEntryGetStructPtr (SPHLFEntryHandle_t *handle,
unsigned long __size, unsigned long __align)
{
char *ptr = (char*)handle->next;
unsigned long len = handle->remaining;
unsigned long adjust = __align - 1;
unsigned long mask = ~adjust;
ptr = (char*)
((((unsigned long)ptr)
+ adjust)
& mask);
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= __size)
{
handle->next = ptr + __size;
handle->remaining = len - __size;
} else {
ptr = NULL;
}
return ptr;
}
#define SPHENTRYALLOCSTRUCT(__handle, __struct) SPHLFEntryAllocStruct(__handle, sizeof(__struct), __alignof__(__struct))
static inline void*
SPHLFEntryAllocStruct (SPHLFEntryHandle_t *handle,
unsigned long __size, unsigned long __align)
{
char *ptr = (char*)handle->next;
unsigned long len = handle->remaining;
unsigned long adjust = __align - 1;
unsigned long mask = ~adjust;
ptr = (char*)
((((unsigned long)ptr)
+ adjust)
& mask);
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= __size)
{
handle->next = ptr + __size;
handle->remaining = len - __size;
} else {
ptr = NULL;
}
return ptr;
}
static inline int
SPHLFEntryAddString (SPHLFEntryHandle_t *handle,
char *value)
{
char *ptr = handle->next;
unsigned short int len = handle->remaining;
int vlen = (strlen(value) + 1);
int rc = 0;
if (len >= vlen)
{
strcpy (ptr, value);
ptr += vlen;
len -= vlen;
handle->next = ptr;
handle->remaining = len;
} else {
rc = -1;
}
return rc;
}
static inline int
SPHLFEntryAddChar (SPHLFEntryHandle_t *handle,
char value)
{
char *ptr = handle->next;
unsigned short int len = handle->remaining;
int rc = 0;
if (len >= sizeof(char))
{
*ptr++ = value;
len -= sizeof(char);
handle->next = (char*)ptr;
handle->remaining = len;
} else {
rc = -1;
}
return rc;
}
static inline int
SPHLFEntryAddShort (SPHLFEntryHandle_t *handle,
short int value)
{
short int *ptr = (short int*)handle->next;
unsigned short int len = handle->remaining;
int rc = 0;
unsigned long adjust = __alignof__(short int) -1;
unsigned long mask = ~adjust;
ptr = (short int*)
((((unsigned long)ptr)
+ adjust)
& mask);
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(short int))
{
*ptr++ = value;
len -= sizeof(short);
handle->next = (char*)ptr;
handle->remaining = len;
} else {
rc = -1;
}
return rc;
}
static inline int
SPHLFEntryAddInt (SPHLFEntryHandle_t *handle,
int value)
{
int *ptr = (int*)handle->next;
unsigned short int len = handle->remaining;
int rc = 0;
ptr = (int*)(((((unsigned long)ptr))
+ (__alignof__(int) -1))
& (~(__alignof__(int) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(int))
{
*ptr++ = value;
len -= sizeof(int);
handle->next = (char*)ptr;
handle->remaining = len;
} else {
rc = -1;
}
return rc;
}
static inline int
SPHLFEntryAddLong (SPHLFEntryHandle_t *handle,
long value)
{
long *ptr = (long*)handle->next;
unsigned short int len = handle->remaining;
int rc = 0;
ptr = (long*)(((((unsigned long)ptr))
+ (__alignof__(long) -1))
& (~(__alignof__(long) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(long))
{
*ptr++ = value;
len -= sizeof(long);
handle->next = (char*)ptr;
handle->remaining = len;
} else {
rc = -1;
}
return rc;
}
static inline int
SPHLFEntryAddPtr (SPHLFEntryHandle_t *handle,
void *value)
{
void **ptr = (void**)handle->next;
unsigned short int len = handle->remaining;
int rc = 0;
ptr = (void**)(((((unsigned long)ptr))
+ (__alignof__(void*) -1))
& (~(__alignof__(void*) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(void*))
{
*ptr++ = value;
len -= sizeof(void*);
handle->next = (char*)ptr;
handle->remaining = len;
} else {
rc = -1;
}
return rc;
}
static inline int
SPHLFEntryAddLongLong (SPHLFEntryHandle_t *handle,
long long value)
{
long long *ptr = (long long*)handle->next;
unsigned short int len = handle->remaining;
int rc = 0;
ptr = (long long*)(((((unsigned long)ptr))
+ (__alignof__(long long) -1))
& (~(__alignof__(long long) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(long long))
{
*ptr++ = value;
len -= sizeof(long long);
handle->next = (char*)ptr;
handle->remaining = len;
} else {
rc = -1;
}
return rc;
}
static inline int
SPHLFEntryAddFloat (SPHLFEntryHandle_t *handle,
float value)
{
float *ptr = (float*)handle->next;
unsigned short int len = handle->remaining;
int rc = 0;
ptr = (float*)(((((unsigned long)ptr))
+ (__alignof__(float) -1))
& (~(__alignof__(float) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(float))
{
*ptr++ = value;
len -= sizeof(float);
handle->next = (char*)ptr;
handle->remaining = len;
} else {
rc = -1;
}
return rc;
}
static inline int
SPHLFEntryAddDouble (SPHLFEntryHandle_t *handle,
double value)
{
double *ptr = (double*)handle->next;
unsigned short int len = handle->remaining;
int rc = 0;
ptr = (double*)(((((unsigned long)ptr))
+ (__alignof__(double) -1))
& (~(__alignof__(double) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(double))
{
*ptr++ = value;
len -= sizeof(double);
handle->next = (char*)ptr;
handle->remaining = len;
} else {
rc = -1;
}
return rc;
}
static inline char
SPHLFEntryGetNextChar (SPHLFEntryHandle_t *handle)
{
char *ptr = handle->next;
unsigned short int len = handle->remaining;
char value = 0;
if (len >= sizeof(char))
{
value = *ptr++;
len -= sizeof(char);
handle->next = (char*)ptr;
handle->remaining = len;
}
return value;
}
static inline char*
SPHLFEntryGetNextString (SPHLFEntryHandle_t *handle)
{
char *ptr = handle->next;
unsigned short int len = handle->remaining;
int vlen = (strlen(ptr) + 1);
char *value = 0;
if (len >= vlen)
{
value = ptr;
ptr += vlen;
len -= vlen;
handle->next = ptr;
handle->remaining = len;
}
return value;
}
static inline short int
SPHLFEntryGetNextShort (SPHLFEntryHandle_t *handle)
{
short int *ptr = (short int*)handle->next;
unsigned short int len = handle->remaining;
unsigned long adjust = __alignof__(short int) -1;
unsigned long mask = ~adjust;
short int value = 0;
ptr = (short int*)
((((unsigned long)ptr)
+ adjust)
& mask);
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(short int))
{
value = *ptr++;
len -= sizeof(short);
handle->next = (char*)ptr;
handle->remaining = len;
}
return value;
}
static inline int
SPHLFEntryGetNextInt (SPHLFEntryHandle_t *handle)
{
int *ptr = (int*)handle->next;
unsigned short int len = handle->remaining;
int value = 0;
ptr = (int*)(((((unsigned long)ptr))
+ (__alignof__(int) -1))
& (~(__alignof__(int) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(int))
{
value = *ptr++;
len -= sizeof(int);
handle->next = (char*)ptr;
handle->remaining = len;
}
return value;
}
static inline long
SPHLFEntryGetNextLong (SPHLFEntryHandle_t *handle)
{
long *ptr = (long*)handle->next;
unsigned short int len = handle->remaining;
long value = 0;
ptr = (long*)(((((unsigned long)ptr))
+ (__alignof__(long) -1))
& (~(__alignof__(long) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(long))
{
value = *ptr++;
len -= sizeof(long);
handle->next = (char*)ptr;
handle->remaining = len;
}
return value;
}
static inline void*
SPHLFEntryGetNextPtr (SPHLFEntryHandle_t *handle)
{
void **ptr = (void**)handle->next;
unsigned short int len = handle->remaining;
void *value = NULL;
ptr = (void**)(((((unsigned long)ptr))
+ (__alignof__(void*) -1))
& (~(__alignof__(void*) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(void*))
{
value = *ptr++;
len -= sizeof(void*);
handle->next = (char*)ptr;
handle->remaining = len;
}
return value;
}
static inline long long
SPHLFEntryGetNextLongLong (SPHLFEntryHandle_t *handle)
{
long long *ptr = (long long*)handle->next;
unsigned short int len = handle->remaining;
long long value = 0LL;
ptr = (long long*)(((((unsigned long)ptr))
+ (__alignof__(long long) -1))
& (~(__alignof__(long long) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(long long))
{
value = *ptr++;
len -= sizeof(long long);
handle->next = (char*)ptr;
handle->remaining = len;
}
return value;
}
static inline float
SPHLFEntryGetNextFloat (SPHLFEntryHandle_t *handle)
{
float *ptr = (float*)handle->next;
unsigned short int len = handle->remaining;
float value = 0.0;
ptr = (float*)(((((unsigned long)ptr))
+ (__alignof__(float) -1))
& (~(__alignof__(float) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(float))
{
value = *ptr++;
len -= sizeof(float);
handle->next = (char*)ptr;
handle->remaining = len;
}
return value;
}
static inline double
SPHLFEntryGetNextDouble (SPHLFEntryHandle_t *handle)
{
double *ptr = (double*)handle->next;
unsigned short int len = handle->remaining;
double value = 0.0;
ptr = (double*)(((((unsigned long)ptr))
+ (__alignof__(double) -1))
& (~(__alignof__(double) -1)));
if ((unsigned long)ptr != (unsigned long)handle->next)
{
len -= ((unsigned long)ptr
- (unsigned long)handle->next);
}
if (len >= sizeof(double))
{
value = *ptr++;
len -= sizeof(double);
handle->next = (char*)ptr;
handle->remaining = len;
}
return value;
}
#endif /* __SPH_LOCK_FREE_ENTRY_H */
sasatom.h
Type and functions for SAS atomic operations.
sas_read_barrier
#define sas_read_barrier()
Definition: sasatom.h:56
sas_write_barrier
#define sas_write_barrier()
Definition: sasatom.h:51
SPHLFEntryAddLongLong
static int SPHLFEntryAddLongLong(SPHLFEntryHandle_t *handle, long long value)
Insert a long long int at the next free location within the entry.
Definition: sphlfentry.h:690
SPHLFEntryGetNextInt
static int SPHLFEntryGetNextInt(SPHLFEntryHandle_t *handle)
Return the next int from the entry via the current next value pointer. Leading bytes may be skipped t...
Definition: sphlfentry.h:896
SPHLFEntryGetNextString
static char * SPHLFEntryGetNextString(SPHLFEntryHandle_t *handle)
Return the pointer to the next C string from the logger entry via the current next value pointer....
Definition: sphlfentry.h:829
SPHLFEntryPID
static sphpid16_t SPHLFEntryPID(SPHLFEntryHandle_t *handlespace)
Return the process ID for the entry specified by the entry handle.
Definition: sphlfentry.h:247
SPHLFEntryGetNextShort
static short int SPHLFEntryGetNextShort(SPHLFEntryHandle_t *handle)
Return the next short int from the entry via the current next value pointer. Leading bytes may be ski...
Definition: sphlfentry.h:857
SPHLFEntryAddLong
static int SPHLFEntryAddLong(SPHLFEntryHandle_t *handle, long value)
Insert a long int at the next free location within the entry.
Definition: sphlfentry.h:614
SPHLFEntryStrongComplete
static int SPHLFEntryStrongComplete(SPHLFEntryHandle_t *handlespace)
Marks the entry specified by the entry handle as complete. Also executes any memory barriers required...
Definition: sphlfentry.h:135
SPHLFEntryGetNextLong
static long SPHLFEntryGetNextLong(SPHLFEntryHandle_t *handle)
Return the next long int from the entry via the current next value pointer. Leading bytes may be skip...
Definition: sphlfentry.h:932
SPHLFEntryAddShort
static int SPHLFEntryAddShort(SPHLFEntryHandle_t *handle, short int value)
Insert a short int at the next free location within the entry.
Definition: sphlfentry.h:535
SPHLFEntryAddFloat
static int SPHLFEntryAddFloat(SPHLFEntryHandle_t *handle, float value)
Insert a float at the next free location within the entry.
Definition: sphlfentry.h:728
SPHLFEntryAllocStruct
static void * SPHLFEntryAllocStruct(SPHLFEntryHandle_t *handle, unsigned long __size, unsigned long __align)
Allocate space for struct starting at the next free location within the entry.
Definition: sphlfentry.h:439
sphLFEntryID_t
unsigned int sphLFEntryID_t
Aggregate type for handling sphLogEntryLayout_t.
Definition: sphlfentry.h:77
SPHLFEntrySubcat
static int SPHLFEntrySubcat(SPHLFEntryHandle_t *handlespace)
Return the entry sub-category for the entry specified by the entry handle.
Definition: sphlfentry.h:323
SPHLFEntryAddString
static int SPHLFEntryAddString(SPHLFEntryHandle_t *handle, char *value)
Insert a C string at the next free location within the entry.
Definition: sphlfentry.h:477
SPHLFEntryGetFreePtr
static void * SPHLFEntryGetFreePtr(SPHLFEntryHandle_t *handle)
Return the first free byte address for the entry specified by the entry handle.
Definition: sphlfentry.h:353
SPHLFEntryGetNextDouble
static double SPHLFEntryGetNextDouble(SPHLFEntryHandle_t *handle)
Return the next double from the entry via the current next value pointer. Leading bytes may be skippe...
Definition: sphlfentry.h:1076
sphpid16_t
unsigned short sphpid16_t
Common type for PID/TID values stored in event entries.
Definition: sphlfentry.h:89
SPHLFEntryGetNextPtr
static void * SPHLFEntryGetNextPtr(SPHLFEntryHandle_t *handle)
Return the next void* from the entry via the current next value pointer. Leading bytes may be skipped...
Definition: sphlfentry.h:968
SPHLFEntryGetStructPtr
static void * SPHLFEntryGetStructPtr(SPHLFEntryHandle_t *handle, unsigned long __size, unsigned long __align)
Return the correctly aligned pointer for a struct or array starting at the next free location within ...
Definition: sphlfentry.h:384
SPHLFEntryIsTimestamped
static int SPHLFEntryIsTimestamped(SPHLFEntryHandle_t *handlespace)
Return the status of the entry specified by the entry handle.
Definition: sphlfentry.h:213
SPHLFEntryGetNextFloat
static float SPHLFEntryGetNextFloat(SPHLFEntryHandle_t *handle)
Return the next float from the entry via the current next value pointer. Leading bytes may be skipped...
Definition: sphlfentry.h:1040
SPHLFEntryTimeStamp
static sphtimer_t SPHLFEntryTimeStamp(SPHLFEntryHandle_t *handlespace)
Return the time stamp value for the entry specified by the entry handle.
Definition: sphlfentry.h:228
longPtr_t
unsigned long longPtr_t
unsigned int type, consistent with the size of a pointer and used for pointer calculations
Definition: sphlfentry.h:55
SPHLFEntryHeader
static SPHLFEntryHeader_t * SPHLFEntryHeader(SPHLFEntryHandle_t *handlespace)
Return the address for the entry header specified by the entry handle.
Definition: sphlfentry.h:285
SPHLFEntryAddInt
static int SPHLFEntryAddInt(SPHLFEntryHandle_t *handle, int value)
Insert a int at the next free location within the entry.
Definition: sphlfentry.h:576
SPHLFEntryComplete
static int SPHLFEntryComplete(SPHLFEntryHandle_t *handlespace)
Marks the entry specified by the entry handle as complete. Also executes write memory barries require...
Definition: sphlfentry.h:179
SPHLFEntryAddDouble
static int SPHLFEntryAddDouble(SPHLFEntryHandle_t *handle, double value)
Insert a double at the next free location within the entry.
Definition: sphlfentry.h:766
SPHLFEntryGetNextLongLong
static long long SPHLFEntryGetNextLongLong(SPHLFEntryHandle_t *handle)
Return the next long long int from the entry via the current next value pointer. Leading bytes may be...
Definition: sphlfentry.h:1004
SPHLFEntryIsComplete
static int SPHLFEntryIsComplete(SPHLFEntryHandle_t *handlespace)
Return the status of the entry specified by the entry handle.
Definition: sphlfentry.h:200
SPHLFEntryAddChar
static int SPHLFEntryAddChar(SPHLFEntryHandle_t *handle, char value)
Insert a character at the next free location within the entry.
Definition: sphlfentry.h:507
SPHLFEntryWeakComplete
static int SPHLFEntryWeakComplete(SPHLFEntryHandle_t *handlespace)
Marks the entry specified by the entry handle as complete. No memory barriers are performance....
Definition: sphlfentry.h:158
SPHLFEntryGetNextChar
static char SPHLFEntryGetNextChar(SPHLFEntryHandle_t *handle)
Return the next char from the entry via the current next value pointer. The internal next value point...
Definition: sphlfentry.h:804
SPHLFEntryAddPtr
static int SPHLFEntryAddPtr(SPHLFEntryHandle_t *handle, void *value)
Insert a void* at the next free location within the entry.
Definition: sphlfentry.h:652
SPHLFEntryTID
static sphpid16_t SPHLFEntryTID(SPHLFEntryHandle_t *handlespace)
Return the thread ID for the entry specified by the entry handle.
Definition: sphlfentry.h:266
SPHLFEntryCategory
static int SPHLFEntryCategory(SPHLFEntryHandle_t *handlespace)
Return the entry category for the entry specified by the entry handle.
Definition: sphlfentry.h:302
sphpid16_t
unsigned short sphpid16_t
Common type for PID/TID values stored in Logger entries.
Definition: sphlflogger.h:217
sphtimer.h
Functions to access the Time Base register (PPC) or clock_gettime(CLOCK_MONOTONIC) measure time at hi...
sphtimer_t
unsigned long long int sphtimer_t
Value from TB/TSC register (64-bits on all platforms).
Definition: sphtimer.h:66
SPHLFEntryHandle_t
Instance of a Lock Free event data Entry Handle.
Definition: sphlfentry.h:115
SPHLFEntryHandle_t::remaining
unsigned short int remaining
Definition: sphlfentry.h:123
SPHLFEntryHandle_t::total_size
unsigned short int total_size
Definition: sphlfentry.h:121
SPHLFEntryHandle_t::next
char * next
Definition: sphlfentry.h:119
SPHLFEntryHandle_t::entry
SPHLFEntryHeader_t * entry
Definition: sphlfentry.h:117
SPHLFEntryHeader_t
Instance of a Lock Free Entry Header.
Definition: sphlfentry.h:95
SPHLFEntryHeader_t::entryID
sphLFEntry_t entryID
Definition: sphlfentry.h:97
SPHLFEntryHeader_t::PID
sphpid16_t PID
Definition: sphlfentry.h:99
SPHLFEntryHeader_t::timeStamp
sphtimer_t timeStamp
Definition: sphlfentry.h:103
SPHLFEntryHeader_t::TID
sphpid16_t TID
Definition: sphlfentry.h:101
sphLFEntryLayout_t
Fields defining the entry header details word.
Definition: sphlfentry.h:59
sphLFEntryLayout_t::subcat
unsigned int subcat
Definition: sphlfentry.h:71
sphLFEntryLayout_t::__reserved
unsigned int __reserved
Definition: sphlfentry.h:67
sphLFEntryLayout_t::len
unsigned int len
Definition: sphlfentry.h:73
sphLFEntryLayout_t::timestamped
unsigned int timestamped
Definition: sphlfentry.h:63
sphLFEntryLayout_t::category
unsigned int category
Definition: sphlfentry.h:69
sphLFEntryLayout_t::allocated
unsigned int allocated
Definition: sphlfentry.h:65
sphLFEntryLayout_t::valid
unsigned int valid
Definition: sphlfentry.h:61
sphLFEntry_t
Union of Entry details with 32-bit word for atomic update.
Definition: sphlfentry.h:81
sphLFEntry_t::detail
sphLFEntryLayout_t detail
Definition: sphlfentry.h:85
sphLFEntry_t::idUnit
sphLFEntryID_t idUnit
Definition: sphlfentry.h:83