3.0-rc2 (revision 337012f1)
Functions
OTF2_GlobalEvtReader.h File Reference

This is the global event reader. More...

#include <stdint.h>
#include <otf2/OTF2_ErrorCodes.h>
#include <otf2/OTF2_EvtReader.h>
#include <otf2/OTF2_GlobalEvtReaderCallbacks.h>

Go to the source code of this file.

Functions

OTF2_ErrorCode OTF2_GlobalEvtReader_SetCallbacks (OTF2_GlobalEvtReader *reader, const OTF2_GlobalEvtReaderCallbacks *callbacks, void *userData)
 Sets the callback functions for the given reader object. Every time when OTF2 reads a record, a callback function is called and the records data is passed to this function. Therefore the programmer needs to set function pointers at the "callbacks" struct for the record type he wants to read. More...
 
OTF2_ErrorCode OTF2_GlobalEvtReader_ReadEvent (OTF2_GlobalEvtReader *reader)
 Triggers the callback for the next event record. More...
 
OTF2_ErrorCode OTF2_GlobalEvtReader_HasEvent (OTF2_GlobalEvtReader *reader, int *flag)
 Has more events. More...
 
OTF2_ErrorCode OTF2_GlobalEvtReader_ReadEvents (OTF2_GlobalEvtReader *reader, uint64_t recordsToRead, uint64_t *recordsRead)
 Reads the given number of records from the global event reader. More...
 

Detailed Description

This is the global event reader.

Used to read from multiple local event readers, and provide them in a timely ordered sequence.

Function Documentation

OTF2_ErrorCode OTF2_GlobalEvtReader_SetCallbacks ( OTF2_GlobalEvtReader reader,
const OTF2_GlobalEvtReaderCallbacks callbacks,
void *  userData 
)

Sets the callback functions for the given reader object. Every time when OTF2 reads a record, a callback function is called and the records data is passed to this function. Therefore the programmer needs to set function pointers at the "callbacks" struct for the record type he wants to read.

Parameters
readerReader object which reads the events from its buffer.
callbacksStruct which holds a function pointer for each record type. OTF2_GlobalEvtReaderCallbacks_New.
userDataData passed as argument userData to the record callbacks.
Returns
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_GlobalEvtReader_ReadEvent ( OTF2_GlobalEvtReader reader)

Triggers the callback for the next event record.

Parameters
readerReader object which reads the events from its buffer.
Returns
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_GlobalEvtReader_HasEvent ( OTF2_GlobalEvtReader reader,
int *  flag 
)

Has more events.

Parameters
readerGlobal event reader handle.
[out]flagIn case of success, the flag will be set to 1 when there is at least more more event to read. To 0 if not. Otherwise the value is undefined.
Returns
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_GlobalEvtReader_ReadEvents ( OTF2_GlobalEvtReader reader,
uint64_t  recordsToRead,
uint64_t *  recordsRead 
)

Reads the given number of records from the global event reader.

Parameters
readerThe records of this reader will be read when the function is issued.
recordsToReadThis variable tells the reader how much records it has to read.
[out]recordsReadThis is a pointer to variable where the amount of actually read records is returned. This may differ to the given recordsToRead if there are no more records left in the trace. In this case the programmer can easily check that the reader has finished his job by checking recordsRead < recordsToRead.
Returns
OTF2_SUCCESS if successful, an error code if an error occurs.