1.2 (revision 3183)
Defines | Typedefs | Enumerations | Functions

OTF2_Archive.h File Reference

Writing interface for OTF2 archives. More...

#include <stdint.h>
#include <otf2/OTF2_ErrorCodes.h>
#include <otf2/OTF2_Callbacks.h>
#include <otf2/OTF2_DefWriter.h>
#include <otf2/OTF2_DefReader.h>
#include <otf2/OTF2_EvtWriter.h>
#include <otf2/OTF2_EvtReader.h>
#include <otf2/OTF2_SnapWriter.h>
#include <otf2/OTF2_SnapReader.h>
#include <otf2/OTF2_GlobalDefWriter.h>
#include <otf2/OTF2_GlobalDefReader.h>
#include <otf2/OTF2_GlobalEvtReader.h>
#include <otf2/OTF2_GlobalSnapReader.h>
#include <otf2/OTF2_Thumbnail.h>
#include <otf2/OTF2_MarkerWriter.h>
#include <otf2/OTF2_MarkerReader.h>

Go to the source code of this file.

Defines

#define OTF2_CHUNK_SIZE_DEFINITIONS_DEFAULT   ( 4 * 1024 * 1024 )
 Default size for OTF2's internal event chunk memory handling.
#define OTF2_CHUNK_SIZE_EVENTS_DEFAULT   ( 1024 * 1024 )
 Default size for OTF2's internal event chunk memory handling.

Typedefs

typedef struct OTF2_Archive_struct OTF2_Archive
 Keeps all meta-data for an OTF2 archive.
typedef uint8_t OTF2_MasterSlaveMode
 Defines whether a location is master or slave.

Enumerations

enum  OTF2_MasterSlaveMode_enum {
  OTF2_SLAVE = 0,
  OTF2_MASTER = 1
}
 

Defines whether a location is master or slave.

More...

Functions

OTF2_ErrorCode OTF2_Archive_Close (OTF2_Archive *archive)
 Close an opened archive.
OTF2_ErrorCode OTF2_Archive_CloseDefReader (OTF2_Archive *archive, OTF2_DefReader *reader)
 Close an opened local definition reader.
OTF2_ErrorCode OTF2_Archive_CloseDefWriter (OTF2_Archive *archive, OTF2_DefWriter *writer)
 Close an opened local definition writer.
OTF2_ErrorCode OTF2_Archive_CloseEvtReader (OTF2_Archive *archive, OTF2_EvtReader *reader)
 Close an opened local event reader.
OTF2_ErrorCode OTF2_Archive_CloseEvtWriter (OTF2_Archive *archive, OTF2_EvtWriter *writer)
 Close an opened local event writer.
OTF2_ErrorCode OTF2_Archive_CloseGlobalDefReader (OTF2_Archive *archive, OTF2_GlobalDefReader *globalDefReader)
 Closes the global definition reader.
OTF2_ErrorCode OTF2_Archive_CloseGlobalEvtReader (OTF2_Archive *archive, OTF2_GlobalEvtReader *globalEvtReader)
 Closes the global event reader.
OTF2_ErrorCode OTF2_Archive_CloseGlobalSnapReader (OTF2_Archive *archive, OTF2_GlobalSnapReader *globalSnapReader)
 Close the opened global snapshot reader.
OTF2_ErrorCode OTF2_Archive_CloseMarkerReader (OTF2_Archive *archive, OTF2_MarkerReader *markerReader)
 Closes the marker reader.
OTF2_ErrorCode OTF2_Archive_CloseMarkerWriter (OTF2_Archive *archive, OTF2_MarkerWriter *writer)
 Close an opened marker writer.
OTF2_ErrorCode OTF2_Archive_CloseSnapReader (OTF2_Archive *archive, OTF2_SnapReader *reader)
 Close an opened local snap reader.
OTF2_ErrorCode OTF2_Archive_CloseSnapWriter (OTF2_Archive *archive, OTF2_SnapWriter *writer)
 Close an opened local snap writer.
OTF2_ErrorCode OTF2_Archive_CloseThumbReader (OTF2_Archive *archive, OTF2_ThumbReader *reader)
 Close an opened thumbnail reader.
OTF2_ErrorCode OTF2_Archive_GetChunkSize (OTF2_Archive *archive, uint64_t *chunkSizeEvents, uint64_t *chunkSizeDefs)
 Get the chunksize.
OTF2_ErrorCode OTF2_Archive_GetCompression (OTF2_Archive *archive, OTF2_Compression *compression)
 Get compression mode (none or zlib)
OTF2_ErrorCode OTF2_Archive_GetCreator (OTF2_Archive *archive, char **creator)
 Get creator information.
OTF2_DefReaderOTF2_Archive_GetDefReader (OTF2_Archive *archive, OTF2_LocationRef location)
 Get a local definition reader.
OTF2_DefWriterOTF2_Archive_GetDefWriter (OTF2_Archive *archive, OTF2_LocationRef location)
 Get a local definition writer.
OTF2_ErrorCode OTF2_Archive_GetDescription (OTF2_Archive *archive, char **description)
 Get description.
OTF2_EvtReaderOTF2_Archive_GetEvtReader (OTF2_Archive *archive, OTF2_LocationRef location)
 Get a local event reader.
OTF2_EvtWriterOTF2_Archive_GetEvtWriter (OTF2_Archive *archive, OTF2_LocationRef location)
 Get a local event writer.
OTF2_ErrorCode OTF2_Archive_GetFileSubstrate (OTF2_Archive *archive, OTF2_FileSubstrate *substrate)
 Get the file substrate (posix, sion, none)
OTF2_GlobalDefReaderOTF2_Archive_GetGlobalDefReader (OTF2_Archive *archive)
 Get a global definition reader.
OTF2_GlobalDefWriterOTF2_Archive_GetGlobalDefWriter (OTF2_Archive *archive)
 Get a global definition writer.
OTF2_GlobalEvtReaderOTF2_Archive_GetGlobalEvtReader (OTF2_Archive *archive)
 Get a global event reader.
OTF2_GlobalSnapReaderOTF2_Archive_GetGlobalSnapReader (OTF2_Archive *archive)
 Get a global snap reader.
OTF2_ErrorCode OTF2_Archive_GetMachineName (OTF2_Archive *archive, char **machineName)
 Get machine name.
OTF2_MarkerReaderOTF2_Archive_GetMarkerReader (OTF2_Archive *archive)
 Get a marker reader.
OTF2_MarkerWriterOTF2_Archive_GetMarkerWriter (OTF2_Archive *archive)
 Get a marker writer.
OTF2_ErrorCode OTF2_Archive_GetMasterSlaveMode (OTF2_Archive *archive, OTF2_MasterSlaveMode *masterOrSlave)
 Get master slave mode.
OTF2_ErrorCode OTF2_Archive_GetNumberOfGlobalDefinitions (OTF2_Archive *archive, uint64_t *numberOfDefinitions)
 Get the number of global definitions.
OTF2_ErrorCode OTF2_Archive_GetNumberOfLocations (OTF2_Archive *archive, uint64_t *numberOfLocations)
 Get the number of locations.
OTF2_ErrorCode OTF2_Archive_GetNumberOfSnapshots (OTF2_Archive *archive, uint32_t *number)
 Get the number of snapshots.
OTF2_ErrorCode OTF2_Archive_GetNumberOfThumbnails (OTF2_Archive *archive, uint32_t *number)
 Get the number of thumbnails.
OTF2_ErrorCode OTF2_Archive_GetProperty (OTF2_Archive *archive, const char *name, char **value)
 Get the value of the named trace file property.
OTF2_ErrorCode OTF2_Archive_GetPropertyNames (OTF2_Archive *archive, uint32_t *numberOfProperties, char ***names)
 Get the names of all trace file properties.
OTF2_SnapReaderOTF2_Archive_GetSnapReader (OTF2_Archive *archive, OTF2_LocationRef location)
 Get a local snap reader.
OTF2_SnapWriterOTF2_Archive_GetSnapWriter (OTF2_Archive *archive, OTF2_LocationRef location)
 Get a local snap writer.
OTF2_ThumbReaderOTF2_Archive_GetThumbReader (OTF2_Archive *archive, uint32_t number)
 Get a thumb reader.
OTF2_ThumbWriterOTF2_Archive_GetThumbWriter (OTF2_Archive *archive, const char *name, const char *description, OTF2_ThumbnailType type, uint32_t numberOfSamples, uint32_t numberOfMetrics, const uint64_t *refsToDefs)
 Get a thumb writer.
OTF2_ErrorCode OTF2_Archive_GetTraceId (OTF2_Archive *archive, uint64_t *id)
 Get the identifier of the trace file.
OTF2_ErrorCode OTF2_Archive_GetVersion (OTF2_Archive *archive, uint8_t *major, uint8_t *minor, uint8_t *bugfix)
 Get format version.
OTF2_ArchiveOTF2_Archive_Open (const char *archivePath, const char *archiveName, const OTF2_FileMode fileMode, const uint64_t chunkSizeEvents, const uint64_t chunkSizeDefs, const OTF2_FileSubstrate fileSubstrate, const OTF2_Compression compression)
 Create a new archive.
OTF2_ErrorCode OTF2_Archive_SetBoolProperty (OTF2_Archive *archive, const char *name, bool value, bool overwrite)
 Add or remove a boolean trace file property to this archive.
OTF2_ErrorCode OTF2_Archive_SetCreator (OTF2_Archive *archive, const char *creator)
 Set creator.
OTF2_ErrorCode OTF2_Archive_SetDescription (OTF2_Archive *archive, const char *description)
 Set a description.
OTF2_ErrorCode OTF2_Archive_SetFileSionCallbacks (OTF2_Archive *archive, const OTF2_FileSionCallbacks *fileSionCallbacks, void *fileSionData)
 Set the SION callbacks for the archive.
OTF2_ErrorCode OTF2_Archive_SetFlushCallbacks (OTF2_Archive *archive, const OTF2_FlushCallbacks *flushCallbacks, void *flushData)
 Set the flush callbacks for the archive.
OTF2_ErrorCode OTF2_Archive_SetMachineName (OTF2_Archive *archive, const char *machineName)
 Set machine name.
OTF2_ErrorCode OTF2_Archive_SetMasterSlaveMode (OTF2_Archive *archive, OTF2_MasterSlaveMode masterOrSlave)
 Set master slave mode.
OTF2_ErrorCode OTF2_Archive_SetMemoryCallbacks (OTF2_Archive *archive, const OTF2_MemoryCallbacks *memoryCallbacks, void *memoryData)
 Set the memory callbacks for the archive.
OTF2_ErrorCode OTF2_Archive_SetNumberOfSnapshots (OTF2_Archive *archive, uint32_t number)
 Set the number of snapshots.
OTF2_ErrorCode OTF2_Archive_SetProperty (OTF2_Archive *archive, const char *name, const char *value, bool overwrite)
 Add or remove a trace file property to this archive.
OTF2_ErrorCode OTF2_Archive_SwitchFileMode (OTF2_Archive *archive, OTF2_FileMode newFileMode)
 Switch file mode of the archive.

Detailed Description

Writing interface for OTF2 archives.

Maintainer:
Michael Wagner <michael.wagner@zih.tu-dresden.de>
Authors:
Dominic Eschweiler <d.eschweiler@fz-juelich.de>, Michael Wagner <michael.wagner@zih.tu-dresden.de>

Define Documentation

#define OTF2_CHUNK_SIZE_DEFINITIONS_DEFAULT   ( 4 * 1024 * 1024 )

Default size for OTF2's internal event chunk memory handling.

If you are not sure which chunk size is the best to use, use this default value.

#define OTF2_CHUNK_SIZE_EVENTS_DEFAULT   ( 1024 * 1024 )

Default size for OTF2's internal event chunk memory handling.

If you are not sure which chunk size is the best to use, use this default value.


Typedef Documentation

typedef struct OTF2_Archive_struct OTF2_Archive

Keeps all meta-data for an OTF2 archive.

An OTF2 archive handle keeps all runtime information about an OTF2 archive. It is the central handle to get and set information about the archive and to request event and definition writer handles.

typedef uint8_t OTF2_MasterSlaveMode

Defines whether a location is master or slave.

The master of creates the directory layout and writes the anchor file. Therefore, only one archive handle can be the master, e.g. the MPI rank 0. All other archive handles must be defined as slaves.

Please see OTF2_MasterSlaveMode_enum for a description of available values.


Enumeration Type Documentation

Defines whether a location is master or slave.

Enumerator:
OTF2_SLAVE 

Location is slave.

OTF2_MASTER 

Location is master.


Function Documentation

OTF2_ErrorCode OTF2_Archive_Close ( OTF2_Archive archive)

Close an opened archive.

Closes an opened archive and releases the associated resources. Closes also all opened writer and reader handles. Does nothing if NULL is passed.

Parameters:
archiveArchive handle.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseDefReader ( OTF2_Archive archive,
OTF2_DefReader reader 
)

Close an opened local definition reader.

Parameters:
archiveArchive handle.
readerReader handle to be closed.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseDefWriter ( OTF2_Archive archive,
OTF2_DefWriter writer 
)

Close an opened local definition writer.

Parameters:
archiveArchive handle.
writerWriter handle to be closed.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseEvtReader ( OTF2_Archive archive,
OTF2_EvtReader reader 
)

Close an opened local event reader.

Parameters:
archiveArchive handle.
readerReader handle to be closed.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseEvtWriter ( OTF2_Archive archive,
OTF2_EvtWriter writer 
)

Close an opened local event writer.

Parameters:
archiveArchive handle.
writerWriter handle to be closed.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseGlobalDefReader ( OTF2_Archive archive,
OTF2_GlobalDefReader globalDefReader 
)

Closes the global definition reader.

Parameters:
archiveArchive handle.
globalDefReaderThe global definition reader.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseGlobalEvtReader ( OTF2_Archive archive,
OTF2_GlobalEvtReader globalEvtReader 
)

Closes the global event reader.

This closes also all local event readers.

Parameters:
archiveArchive handle.
globalEvtReaderThe global event reader.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseGlobalSnapReader ( OTF2_Archive archive,
OTF2_GlobalSnapReader globalSnapReader 
)

Close the opened global snapshot reader.

Parameters:
archiveArchive handle.
readerReader handle to be closed.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseMarkerReader ( OTF2_Archive archive,
OTF2_MarkerReader markerReader 
)

Closes the marker reader.

Parameters:
archiveArchive handle.
markerReaderThe marker reader.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseMarkerWriter ( OTF2_Archive archive,
OTF2_MarkerWriter writer 
)

Close an opened marker writer.

Parameters:
archiveArchive handle.
writerWriter handle to be closed.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseSnapReader ( OTF2_Archive archive,
OTF2_SnapReader reader 
)

Close an opened local snap reader.

Parameters:
archiveArchive handle.
readerReader handle to be closed.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
Since:
Version 1.2
OTF2_ErrorCode OTF2_Archive_CloseSnapWriter ( OTF2_Archive archive,
OTF2_SnapWriter writer 
)

Close an opened local snap writer.

Parameters:
archiveArchive handle.
writerWriter handle to be closed.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_CloseThumbReader ( OTF2_Archive archive,
OTF2_ThumbReader reader 
)

Close an opened thumbnail reader.

Parameters:
archiveArchive handle.
readerReader handle to be closed.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetChunkSize ( OTF2_Archive archive,
uint64_t *  chunkSizeEvents,
uint64_t *  chunkSizeDefs 
)

Get the chunksize.

Parameters:
archiveArchive handle.
[out]chunkSizeEventsChunk size for event files.
[out]chunkSizeDefsChunk size for definition files.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetCompression ( OTF2_Archive archive,
OTF2_Compression compression 
)

Get compression mode (none or zlib)

Parameters:
archiveArchive handle.
[out]compressionReturned compression mode.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetCreator ( OTF2_Archive archive,
char **  creator 
)

Get creator information.

Parameters:
archiveArchive handle.
[out]creatorReturned creator. Allocated with malloc.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_DefReader* OTF2_Archive_GetDefReader ( OTF2_Archive archive,
OTF2_LocationRef  location 
)

Get a local definition reader.

Parameters:
archiveArchive handle.
locationLocation ID of the requested reader handle.
Returns:
Returns a local definition reader handle if successful, NULL if an error occurs.
OTF2_DefWriter* OTF2_Archive_GetDefWriter ( OTF2_Archive archive,
OTF2_LocationRef  location 
)

Get a local definition writer.

Parameters:
archiveArchive handle.
locationLocation ID of the requested writer handle.
Returns:
Returns a local definition writer handle if successful, NULL if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetDescription ( OTF2_Archive archive,
char **  description 
)

Get description.

Parameters:
archiveArchive handle.
[out]descriptionReturned description. Allocated with malloc.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_EvtReader* OTF2_Archive_GetEvtReader ( OTF2_Archive archive,
OTF2_LocationRef  location 
)

Get a local event reader.

Parameters:
archiveArchive handle.
locationLocation ID of the requested reader handle.
Returns:
Returns a local event reader handle if successful, NULL if an error occurs.
OTF2_EvtWriter* OTF2_Archive_GetEvtWriter ( OTF2_Archive archive,
OTF2_LocationRef  location 
)

Get a local event writer.

Parameters:
archiveArchive handle.
locationLocation ID of the requested writer handle.
Returns:
Returns a local event writer handle if successful, NULL if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetFileSubstrate ( OTF2_Archive archive,
OTF2_FileSubstrate substrate 
)

Get the file substrate (posix, sion, none)

Parameters:
archiveArchive handle.
[out]substrateReturned file substrate.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_GlobalDefReader* OTF2_Archive_GetGlobalDefReader ( OTF2_Archive archive)

Get a global definition reader.

Parameters:
archiveArchive handle.
Returns:
Returns a global definition reader handle if successful, NULL if an error occurs.
OTF2_GlobalDefWriter* OTF2_Archive_GetGlobalDefWriter ( OTF2_Archive archive)

Get a global definition writer.

Parameters:
archiveArchive handle.
Returns:
Returns a global definition writer handle if successful, NULL if an error occurs.
OTF2_GlobalEvtReader* OTF2_Archive_GetGlobalEvtReader ( OTF2_Archive archive)

Get a global event reader.

Parameters:
archiveArchive handle.
Returns:
Returns a global event reader handle if successful, NULL if an error occurs.
OTF2_GlobalSnapReader* OTF2_Archive_GetGlobalSnapReader ( OTF2_Archive archive)

Get a global snap reader.

Parameters:
archiveArchive handle.
Since:
Version 1.2
Returns:
Returns a global snap reader handle if successful, NULL if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetMachineName ( OTF2_Archive archive,
char **  machineName 
)

Get machine name.

Parameters:
archiveArchive handle.
[out]machineNameReturned machine name. Allocated with malloc.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_MarkerReader* OTF2_Archive_GetMarkerReader ( OTF2_Archive archive)

Get a marker reader.

Parameters:
archiveArchive handle.
Since:
Version 1.2
Returns:
Returns a marker reader handle if successful, NULL if an error occurs.
OTF2_MarkerWriter* OTF2_Archive_GetMarkerWriter ( OTF2_Archive archive)

Get a marker writer.

Parameters:
archiveArchive handle.
Since:
Version 1.2
Returns:
Returns a marker writer handle if successful, NULL if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetMasterSlaveMode ( OTF2_Archive archive,
OTF2_MasterSlaveMode masterOrSlave 
)

Get master slave mode.

Parameters:
archiveArchive handle.
[out]masterOrSlaveReturn pointer to the master slave mode.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetNumberOfGlobalDefinitions ( OTF2_Archive archive,
uint64_t *  numberOfDefinitions 
)

Get the number of global definitions.

Parameters:
archiveArchive handle.
[out]numberOfDefinitionsReturn pointer to the number of global definitions.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetNumberOfLocations ( OTF2_Archive archive,
uint64_t *  numberOfLocations 
)

Get the number of locations.

Parameters:
archiveArchive handle.
[out]numberOfLocationsReturn pointer to the number of locations.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetNumberOfSnapshots ( OTF2_Archive archive,
uint32_t *  number 
)

Get the number of snapshots.

Parameters:
archiveArchive handle.
numberSnapshot number.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetNumberOfThumbnails ( OTF2_Archive archive,
uint32_t *  number 
)

Get the number of thumbnails.

Parameters:
archiveArchive handle.
numberThumb number.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetProperty ( OTF2_Archive archive,
const char *  name,
char **  value 
)

Get the value of the named trace file property.

Parameters:
archiveArchive handle.
nameName of the property.
[out]valueReturned value of the property. Allocated with malloc.
Returns:
OTF2_SUCCESS

if successful

OTF2_ERROR_PROPERTY_NOT_FOUND

if the named property was not found

OTF2_ErrorCode OTF2_Archive_GetPropertyNames ( OTF2_Archive archive,
uint32_t *  numberOfProperties,
char ***  names 
)

Get the names of all trace file properties.

Parameters:
archiveArchive handle.
[out]numberOfPropertiesReturned number of trace file properties.
[out]namesReturned list of property names. Allocated with malloc. To release memory, just pass *names to free.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_SnapReader* OTF2_Archive_GetSnapReader ( OTF2_Archive archive,
OTF2_LocationRef  location 
)

Get a local snap reader.

Parameters:
archiveArchive handle.
locationLocation ID of the requested snap handle.
Since:
Version 1.2
Returns:
Returns a local snap handle if successful, NULL if an error occurs.
OTF2_SnapWriter* OTF2_Archive_GetSnapWriter ( OTF2_Archive archive,
OTF2_LocationRef  location 
)

Get a local snap writer.

Parameters:
archiveArchive handle.
locationLocation ID of the requested writer handle.
Since:
Version 1.2
Returns:
Returns a local event writer handle if successful, NULL if an error occurs.
OTF2_ThumbReader* OTF2_Archive_GetThumbReader ( OTF2_Archive archive,
uint32_t  number 
)

Get a thumb reader.

Parameters:
archiveArchive handle.
numberThumbnail number.
Since:
Version 1.2
Returns:
Returns a global definition writer handle if successful, NULL if an error occurs.
OTF2_ThumbWriter* OTF2_Archive_GetThumbWriter ( OTF2_Archive archive,
const char *  name,
const char *  description,
OTF2_ThumbnailType  type,
uint32_t  numberOfSamples,
uint32_t  numberOfMetrics,
const uint64_t *  refsToDefs 
)

Get a thumb writer.

Parameters:
archiveArchive handle.
nameName of thumb.
descriptionDescription of thumb.
typeType of thumb.
numberOfSamplesNumber of samples.
numberOfMetricsNumber of metrics.
refsToDefsnumberOfMetrics references to defintion matching the thumbnail type.
Since:
Version 1.2
Returns:
Returns a thumb writer handle if successful, NULL if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetTraceId ( OTF2_Archive archive,
uint64_t *  id 
)

Get the identifier of the trace file.

Note:
This call is only allowed when the archive was opened with mode OTF2_FILEMODE_READ.
Parameters:
archiveArchive handle.
[out]idTrace identifier.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_GetVersion ( OTF2_Archive archive,
uint8_t *  major,
uint8_t *  minor,
uint8_t *  bugfix 
)

Get format version.

Parameters:
archiveArchive handle
[out]majorMajor version number
[out]minorMinor version number
[out]bugfixBugfix revision
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_Archive* OTF2_Archive_Open ( const char *  archivePath,
const char *  archiveName,
const OTF2_FileMode  fileMode,
const uint64_t  chunkSizeEvents,
const uint64_t  chunkSizeDefs,
const OTF2_FileSubstrate  fileSubstrate,
const OTF2_Compression  compression 
)

Create a new archive.

Creates a new archive handle that keeps all meta data about the archive on runtime.

Parameters:
archivePathPath to the archive i.e. the directory where the anchor file is located.
archiveNameName of the archive. It is used to generate sub pathes e.g. 'archiveName.otf2'.
fileModeDetermines if in reading or writing mode. Available values are OTF2_FILEMODE_WRITE or OTF2_FILEMODE_READ.
chunkSizeEventsRequested size of OTF2's internal event chunks in writing mode. Available values are from 256kB to 16MB. The event chunk size affects performance as well as total memory usage. A value satisfying both is about 1MB. If you are not sure which chunk size is the best to use, use OTF2_CHUNK_SIZE_EVENTS_DEFAULT. In reading mode this value is ignored because the correct chunk size is extracted from the anchor file.
chunkSizeDefsRequested size of OTF2's internal definition chunks in writing mode. Available values are from 256kB to 16MB. The definition chunk size affects performance as well as total memory usage. In addition, the definition chunk size must be big enough to carry the largest possible definition record. Therefore, the definition chunk size must be at least 10 times the number of locations. A value satisfying these requirements is about 4MB. If you are not sure which chunk size is the best to use, use OTF2_CHUNK_SIZE_DEFINITIONS_DEFAULT. In reading mode this value is ignored because the correct chunk size is extracted from the anchor file.
fileSubstrateDetermines which file substrate should be used in writing mode. Available values are OTF2_SUBSTRATE_POSIX to use the standard Posix interface, OTF2_SUBSTRATE_SION to use an installed SION library to store multiple logical files into fewer or one physical file, and OTF2_SUBSTRATE_NONE to supress file writing at all. In reading mode this value is ignored because the correct file substrated is extracted from the anchor file.
compressionDetermines if compression is used to reduce the size of data in files. Available values are OTF2_COMPRESSION_ZLIB to use an installed zlib and OTF2_COMPRESSION_NONE to disable compression. In reading mode this value is ignored because the correct file compression is extracted from the anchor file.
Returns:
Returns an archive handle if successful, NULL otherwise.
OTF2_ErrorCode OTF2_Archive_SetBoolProperty ( OTF2_Archive archive,
const char *  name,
bool  value,
bool  overwrite 
)

Add or remove a boolean trace file property to this archive.

Note:
This call is only allowed when the archive was opened with mode OTF2_FILEMODE_WRITE.
Parameters:
archiveArchive handle.
nameName of the trace file property (case insensitive, [A-Z0-9_]).
valueBoolean value of property (e.g. true or false).
overwriteIf true a previous trace file property with the same name name will be overwritten.
Returns:
OTF2_SUCCESS

if successful

OTF2_ERROR_PROPERTY_NAME_INVALID

if property name does not conform to the naming scheme

OTF2_ERROR_PROPERTY_NOT_FOUND

if property was not found, but requested to remove

OTF2_ERROR_PROPERTY_EXISTS

if property exists but overwrite was not set

OTF2_ErrorCode OTF2_Archive_SetCreator ( OTF2_Archive archive,
const char *  creator 
)

Set creator.

Sets information about the creator of the trace archive. This value is optional. It only needs to be set for an archive handle marked as 'master' or does not need to be set at all.

Parameters:
archiveArchive handle.
creatorCreator information.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_SetDescription ( OTF2_Archive archive,
const char *  description 
)

Set a description.

Sets a description for a trace archive. This value is optional. It only needs to be set for an archive handle marked as 'master' or does not need to be set at all.

Parameters:
archiveArchive handle.
descriptionDescription.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_SetFileSionCallbacks ( OTF2_Archive archive,
const OTF2_FileSionCallbacks fileSionCallbacks,
void *  fileSionData 
)

Set the SION callbacks for the archive.

Parameters:
archiveArchive handle.
fileSionCallbacksStruct holding the SION callback functions.
fileSionDataData passed to the SION callbacks in the userData argument.
Returns:
OTF2_ErrorCode, or error code.
OTF2_ErrorCode OTF2_Archive_SetFlushCallbacks ( OTF2_Archive archive,
const OTF2_FlushCallbacks flushCallbacks,
void *  flushData 
)

Set the flush callbacks for the archive.

Parameters:
archiveArchive handle.
flushCallbacksStruct holding the flush callback functions.
flushDataData passed to the flush callbacks in the userData argument.
Returns:
OTF2_ErrorCode, or error code.
OTF2_ErrorCode OTF2_Archive_SetMachineName ( OTF2_Archive archive,
const char *  machineName 
)

Set machine name.

Sets the name for the machine the trace was recorded. This value is optional. It only needs to be set for an archive handle marked as 'master' or does not need to be set at all.

Parameters:
archiveArchive handle.
machineNameMachine name.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_SetMasterSlaveMode ( OTF2_Archive archive,
OTF2_MasterSlaveMode  masterOrSlave 
)

Set master slave mode.

Sets master slave mode for a location. If OTF2_MASTER is passed, the location creates the directory structure for the trace files to store. Therefore, exactly one location can be master, all other locations must be slaves.

Please note: This call is only allowed in writing mode.

Parameters:
archiveArchive handle.
masterOrSlaveMaster or slave. Available values are OTF2_MASTER and OTF2_SLAVE.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_SetMemoryCallbacks ( OTF2_Archive archive,
const OTF2_MemoryCallbacks memoryCallbacks,
void *  memoryData 
)

Set the memory callbacks for the archive.

Parameters:
archiveArchive handle.
memoryCallbacksStruct holding the memory callback functions.
memoryDataData passed to the memory callbacks in the userData argument.
Returns:
OTF2_ErrorCode, or error code.
OTF2_ErrorCode OTF2_Archive_SetNumberOfSnapshots ( OTF2_Archive archive,
uint32_t  number 
)

Set the number of snapshots.

Parameters:
archiveArchive handle.
numberSnapshot number.
Since:
Version 1.2
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
OTF2_ErrorCode OTF2_Archive_SetProperty ( OTF2_Archive archive,
const char *  name,
const char *  value,
bool  overwrite 
)

Add or remove a trace file property to this archive.

Removing a trace file property is done by passing "" in the value parameter. The overwrite parameter is ignored than.

Note:
This call is only allowed when the archive was opened with mode OTF2_FILEMODE_WRITE.
Parameters:
archiveArchive handle.
nameName of the trace file property (case insensitive, [A-Z0-9_]).
valueValue of property.
overwriteIf true a previous trace file property with the same name name will be overwritten.
Returns:
OTF2_SUCCESS

if successful

OTF2_ERROR_PROPERTY_NAME_INVALID

if property name does not conform to the naming scheme

OTF2_ERROR_PROPERTY_NOT_FOUND

if property was not found, but requested to remove

OTF2_ERROR_PROPERTY_EXISTS

if property exists but overwrite was not set

OTF2_ErrorCode OTF2_Archive_SwitchFileMode ( OTF2_Archive archive,
OTF2_FileMode  newFileMode 
)

Switch file mode of the archive.

Currently only a switch from OTF2_FILEMODE_READ to OTF2_FILEMODE_WRITE is permitted and in this case, the master/slave mode is reset and must be set again with OTF2_Archive_SetMasterSlaveMode. Currrently it is also only permitted when operating on an OTF2 archive with the OTF2_SUBSTRATE_POSIX file substrate.

Parameters:
archiveArchive handle.
newFileModeNew OTF2_FileMode to switch to.
Returns:
OTF2_SUCCESS if successful, an error code if an error occurs.
Since:
Version 1.2