#include "AliHLTStdIncludes.h"
#include "AliHLTLogging.h"
+// global logging buffer
+#define LOG_BUFFER_SIZE 100
+char gAliHLTLoggingBuffer[LOG_BUFFER_SIZE]="";
+char gAliHLTLoggingOriginBuffer[LOG_BUFFER_SIZE]="";
+
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTLogging)
return *this;
}
-char AliHLTLogging::fLogBuffer[LOG_BUFFER_SIZE]="";
-char AliHLTLogging::fOriginBuffer[LOG_BUFFER_SIZE]="";
AliHLTComponent_LogSeverity AliHLTLogging::fGlobalLogFilter=kHLTLogAll;
AliHLTfctLogging AliHLTLogging::fLoggingFunc=NULL;
const char* AliHLTLogging::BuildLogString(const char *format, va_list ap) {
int tgtLen=0;
int iBufferSize=LOG_BUFFER_SIZE;
- char* tgtBuffer=fLogBuffer;
+ char* tgtBuffer=gAliHLTLoggingBuffer;
tgtBuffer[tgtLen]=0;
#if (defined LOG_PREFIX)
*tgtBuffer=0; // terminate the buffer
}
}
- return fLogBuffer;
+ return gAliHLTLoggingBuffer;
}
int AliHLTLogging::Logging(AliHLTComponent_LogSeverity severity, const char* origin, const char* keyword, const char* format, ... ) {
int iMaxSize=LOG_BUFFER_SIZE-1;
int iPos=0;
const char* separator="";
- fOriginBuffer[iPos]=0;
+ gAliHLTLoggingOriginBuffer[iPos]=0;
if (origin_class) {
if ((int)strlen(origin_class)<iMaxSize-iPos) {
- strcpy(&fOriginBuffer[iPos], origin_class);
+ strcpy(&gAliHLTLoggingOriginBuffer[iPos], origin_class);
iPos+=strlen(origin_class);
separator="::";
}
}
if (origin_func) {
if ((int)strlen(origin_func)+(int)strlen(separator)<iMaxSize-iPos) {
- strcpy(&fOriginBuffer[iPos], separator);
+ strcpy(&gAliHLTLoggingOriginBuffer[iPos], separator);
iPos+=strlen(separator);
- strcpy(&fOriginBuffer[iPos], origin_func);
+ strcpy(&gAliHLTLoggingOriginBuffer[iPos], origin_func);
iPos+=strlen(origin_func);
}
}
message=AliHLTLogging::BuildLogString(format, args);
}
if (fLoggingFunc) {
- iResult=(*fLoggingFunc)(NULL/*fParam*/, severity, fOriginBuffer, GetKeyword(), message);
+ iResult=(*fLoggingFunc)(NULL/*fParam*/, severity, gAliHLTLoggingOriginBuffer, GetKeyword(), message);
} else {
- iResult=Message(NULL/*fParam*/, severity, fOriginBuffer, GetKeyword(), message);
+ iResult=Message(NULL/*fParam*/, severity, gAliHLTLoggingOriginBuffer, GetKeyword(), message);
}
va_end(args);
}
#include "AliHLTDataTypes.h"
#include <TObject.h>
-#include <stdio.h>
+#include "AliHLTStdIncludes.h"
-#define LOG_BUFFER_SIZE 100 // global logging buffer
//#define LOG_PREFIX "" // logging prefix, for later extensions
private:
static AliHLTComponent_LogSeverity fGlobalLogFilter;
AliHLTComponent_LogSeverity fLocalLogFilter;
- static char fLogBuffer[LOG_BUFFER_SIZE];
- static char fOriginBuffer[LOG_BUFFER_SIZE];
static AliHLTfctLogging fLoggingFunc;
const char* fpDefaultKeyword;
const char* fpCurrentKeyword;
printf( "Found raw data block %lu\n", blk );
#endif
// Check for corrupt data
+#if HOMER_VERSION >= 2
AliHLTUInt64_t corruptFlag = reader->GetBlockStatusFlags( blk );
if (corruptFlag & 0x00000001) {
LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplayMain::ReadData","Block status flags") << "Data block is corrupt"<<ENDLOG;
continue;
}
+#endif
unsigned long rawDataBlock = (unsigned long) reader->GetBlockData( blk );
unsigned long rawDataLen = reader->GetBlockDataLength( blk );
if ( ~(unsigned long)0 != blk ){
+#if HOMER_VERSION >= 2
// Check for corrupt data
AliHLTUInt64_t corruptFlag = reader->GetBlockStatusFlags( blk );
if (corruptFlag & 0x00000001) {
LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplayMain::ReadData","Block status flags") << "Data block is corrupt"<<ENDLOG;
continue;
}
+#endif
#if DEBUG
printf( "Raw Data found for slice %u/patch %u\n", fSlicePadRow, patch );
while ( blk != ~(ULong_t)0 ) {
HLTDebug( "Found raw data block %lu\n", blk );
+#if HOMER_VERSION >= 2
// -- Check for corrupt data
AliHLTUInt64_t corruptFlag = reader->GetBlockStatusFlags( blk );
if (corruptFlag & 0x00000001) {
blk = reader->FindBlockNdx( rawID, " CPT", 0xFFFFFFFF, blk+1 );
continue;
}
+#endif
void* rawDataBlock = (void*) reader->GetBlockData( blk );
unsigned long rawDataLen = reader->GetBlockDataLength( blk );
@ALIROOT_LDFLAGS@ \
@ALIROOT_LIBS@ \
@HOMER_LDFLAGS@ \
+ @HOMER_LIBS@ \
-version-info 1:1:0
# automatic generation of data and time of library build
with_pubsub=no
fi
AC_MSG_RESULT([$with_pubsub])
+HOMER_VERSION=1
+HOMER_LIBS=
AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
if test "x$with_pubsub" != "xno" ; then
with_homer=no
AC_LANG_PUSH(C++)
AC_CHECK_HEADER([HOMERReader.h],
- [ AC_CHECK_LIB([HOMERReader],[_init],[with_homer=yes])])
+ [ AC_CHECK_LIB([HOMER],[_init],
+ [with_homer=yes
+ HOMER_LIBS="-lHOMER"],
+ [ AC_CHECK_LIB([HOMERReader],[_init],
+ [with_homer=yes
+ HOMER_LIBS="-lHOMERReader"])])
+ LIBS="$LIBS $HOMER_LIBS"
+ AC_MSG_CHECKING([for HOMER version])
+ dnl The Homer library has no versioning, so we do our own
+ dnl version description
+ dnl ----------------------------------------------------------------------
+ dnl 1 inintial version
+ dnl 2 GetBlockStatusFlags added to the interface
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
+ [HOMERReader reader("dummy", 0);
+ reader.GetBlockStatusFlags(0);])],
+ [if test $HOMER_VERSION -lt 2 ; then HOMER_VERSION=2; fi],
+ [])
+ AC_MSG_RESULT([$HOMER_VERSION])
+ ]) #AC_CHECK_HEADER([HOMERReader.h])
AC_LANG_POP(C++)
if test "x$with_homer" = "xno" ; then
HOMER_CPPFLAGS=
HOMER_LDFLAGS=
+ HOMER_LIBS=
else
+ HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
AC_DEFINE(HAVE_HOMERREADER)
fi
CPPFLAGS="$save_CPPFLAGS"
fi
AC_SUBST([HOMER_CPPFLAGS])
AC_SUBST([HOMER_LDFLAGS])
+AC_SUBST([HOMER_LIBS])
dnl ------------------------------------------------------------------
AC_MSG_CHECKING([whether to impose strict coding conventions])