![]() |
1.5.1 (revision 4026)
|
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. |
This is the local snap reader, which reads snapshot events from one location.
OTF2_ErrorCode OTF2_SnapReader_GetLocationID | ( | const OTF2_SnapReader * | reader, |
OTF2_LocationRef * | location | ||
) |
Return the location ID of the reading related location.
reader | Reader object which reads the snapshot events from its buffer. | |
[out] | location | ID of the 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.
reader | Reader object which reads the events from its buffer. | |
recordsToRead | How many records can be read next. | |
[out] | recordsRead | Return how many records where really read. |
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'.
reader | Reader object which reads the events from its buffer. |
req_time | Requested time (see above) |
found | returns if a matching snapshot was found |
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.
reader | Reader object which reads the events from its buffer. |
callbacks | Struct which holds a function pointer for each record type. OTF2_SnapReaderCallbacks_New. |
userData | Data passed as argument userData to the record callbacks. |