1.4 (revision 3771)
Functions
otf2/OTF2_SnapReader.h File Reference

This is the local snap reader, which reads snapshot events from one location. More...

#include <stdint.h>
#include <otf2/OTF2_ErrorCodes.h>
#include <otf2/OTF2_Events.h>
#include <otf2/OTF2_Definitions.h>
#include <otf2/OTF2_AttributeList.h>
#include <otf2/OTF2_SnapReaderCallbacks.h>

Go to the source code of this file.

Functions

OTF2_ErrorCode OTF2_SnapReader_GetLocationID (const OTF2_SnapReader *reader, OTF2_LocationRef *location)
 Return the location ID of the reading related location.
OTF2_ErrorCode OTF2_SnapReader_ReadSnapshots (OTF2_SnapReader *reader, uint64_t recordsToRead, uint64_t *recordsRead)
 After callback registration, the local events could be read with the following function. Readn reads recordsToRead records. The reader indicates that it reached the end of the trace by just reading less records than requested.
OTF2_ErrorCode OTF2_SnapReader_Seek (OTF2_SnapReader *reader, uint64_t req_time, bool *found)
 Seek jumps to start of latest snaphot that was made before a given time 'req_time'.
OTF2_ErrorCode OTF2_SnapReader_SetCallbacks (OTF2_SnapReader *reader, const OTF2_SnapReaderCallbacks *callbacks, void *userData)
 Sets the callback functions for the given reader object. Everytime 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.

Detailed Description

This is the local snap reader, which reads snapshot events from one location.


Function Documentation

OTF2_ErrorCode OTF2_SnapReader_GetLocationID ( const OTF2_SnapReader reader,
OTF2_LocationRef location 
)

Return the location ID of the reading related location.

Parameters:
readerReader object which reads the snapshot events from its buffer.
[out]locationID of the location.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_SnapReader_ReadSnapshots ( OTF2_SnapReader reader,
uint64_t  recordsToRead,
uint64_t *  recordsRead 
)

After callback registration, the local events could be read with the following function. Readn reads recordsToRead records. The reader indicates that it reached the end of the trace by just reading less records than requested.

Parameters:
readerReader object which reads the events from its buffer.
recordsToReadHow many records can be read next.
[out]recordsReadReturn how many records where really read.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_SnapReader_Seek ( OTF2_SnapReader reader,
uint64_t  req_time,
bool *  found 
)

Seek jumps to start of latest snaphot that was made before a given time 'req_time'.

Parameters:
readerReader object which reads the events from its buffer.
req_timeRequested time (see above)
foundreturns if a matching snapshot was found
Since:
Version 1.2
Returns:
OTF2_ErrorCode with !=OTF2_SUCCESS if there was an error.
OTF2_ErrorCode OTF2_SnapReader_SetCallbacks ( OTF2_SnapReader reader,
const OTF2_SnapReaderCallbacks callbacks,
void *  userData 
)

Sets the callback functions for the given reader object. Everytime 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.

These callbacks are ignored, if the events are read by an global event reader.

Parameters:
readerReader object which reads the events from its buffer.
callbacksStruct which holds a function pointer for each record type. OTF2_SnapReaderCallbacks_New.
userDataData passed as argument userData to the record callbacks.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.