OpenMPI  0.1.1
OTF_RStream.h
Go to the documentation of this file.
1 /*
2  This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2012.
3  Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
4 */
5 
6 /* NOTE
7 the OTF_RStream interface is not able to perform jumps to random timestamps,
8 and cannot quit at a certain maximum time stamp.
9 Maybe in future versions we add this.
10 It is not in, because the OTF_Reader interface uses the buffer-methodes directly
11 to set the timestamps, so saving it in the stream too will be worthless in this
12 case. */
13 
14 /**
15  * @file OTF_RStream.h
16  *
17  * @brief Provides read access to trace streams, which consist of multiple
18  * buffers.
19  *
20  * \ingroup rstream
21  */
22 
23 /** \defgroup rstream Stream Reader Interface
24  *
25  * rstream provides an interface for dealing with a single stream of a trace.
26  * A stream consists of up to four different buffers (event buffer,
27  * definition buffer, snapshots buffer, statistics buffer).
28  *
29  * rstream is structured similarly to the reader, but it is not
30  * able to perform jumps to random timestamps, and cannot quit at a certain
31  * maximum time stamp.
32  *
33  * \section rstream_example A simple Example
34  *
35  * Common includes
36  * \code
37  * #include <stdio.h>
38  * #include <assert.h>
39  * #include "otf.h"
40  * \endcode
41  *
42  *
43  * Define the Handler(s).
44  * We just want to process the def process event and print out all appearing processes.
45  * \code
46  * int handleDefProcess (void *userData, uint32_t stream, uint32_t process, const char *name, uint32_t parent) {
47  *
48  * printf( "process %u is named \"%s\"\n", process, name );
49  *
50  * return OTF_RETURN_OK;
51  * }
52  * \endcode
53  *
54  * \code
55  * int main( int argc, char** argv ) {
56  * \endcode
57  *
58  * Declare a file manager, a reader, and a handler array
59  * \code
60  * OTF_RStream* rstream;
61  * OTF_FileManager* manager;
62  * OTF_HandlerArray* handlers;
63  * \endcode
64  *
65  * Initialize the file manager. Do not open more than 100 files.
66  * \code
67  * manager= OTF_FileManager_open( 100 );
68  * assert( manager );
69  * \endcode
70  *
71  * Initialize the handler array.
72  * \code
73  * handlers = OTF_HandlerArray_open();
74  * assert( handlers );
75  * \endcode
76  *
77  * Initialize the rstream object.
78  * \code
79 
80  * rstream = OTF_RStream_open( "mytrace", 0, manager );
81  * assert( rstream );
82  * \endcode
83  *
84  * Register your callback functions to the handler array.
85  * \code
86  * OTF_HandlerArray_setHandler( handlers, (OTF_FunctionPointer*) handleDefProcess, OTF_DEFPROCESS_RECORD );
87  * \endcode
88  *
89  *
90  * Do the actual reading.
91  * \code
92  * OTF_RStream_readDefinitions( rstream, handlers );
93  * \endcode
94  *
95  *
96  * Clean everything up before exiting the program.
97  * \code
98  * OTF_RStream_close( rstream );
99  * OTF_HandlerArray_close( handlers );
100  * OTF_FileManager_close( manager );
101  *
102  * return 0;
103  * }
104  * \endcode
105  *
106  * Compile and link this using $ gcc -o test test.c `otfconfig --libs`.
107  *
108  */
109 
110 
111 #ifndef OTF_RSTREAM_H
112 #define OTF_RSTREAM_H
113 
114 
115 #include <stdlib.h>
116 #include <string.h>
117 #include <stdio.h>
118 
119 
120 #include "OTF_inttypes.h"
121 
122 
123 #include "OTF_FileManager.h"
124 #include "OTF_RBuffer.h"
125 #include "OTF_Filenames.h"
126 #include "OTF_HandlerArray.h"
127 
128 
129 #ifdef __cplusplus
130 extern "C" {
131 #endif /* __cplusplus */
132 
134 
135 
136  /** name stub: all files will begin with this name */
137  char* namestub;
138 
139  /** Unique id for the current stream */
140  uint32_t id;
141 
142  /** Definitions buffer. Definitions buffer carries definition
143  records */
145 
146  /** Event buffer. The event buffer carries records for actual
147  events, i.e. records with a time stamp */
149 
150  /** Snaps (snapshots) buffer. The snapshots buffer carries
151  snapshots of the whole state at a point in time - as oppossed to
152  events which only show changes in the state. This can be used to
153  start from such a snapshot instead of from the very begining. */
155 
156  /** Statistics buffer. Statistics buffer carries statistical
157  information about a certain time interval resp. data at
158  points of time that allow to derive statistics without
159  reading through all events of that interval. */
161 
162  /** Marker buffer. */
164 
165  /** Default size of buffers managed by this RStream. */
166  uint32_t buffersizes;
167 
168 #ifdef HAVE_ZLIB
169  /** Default size of zbuffers managed by this RStream. */
170  uint32_t zbuffersizes;
171 #endif /* HAVE_ZLIB */
172 
173  /** file handle manager */
175 
176  /** maximum number of records delivered by a single call to OTF_Reader_readXYZ()
177  defaults to OTF_READ_MAXRECORDS == \infty */
178  uint64_t recordLimit;
179 };
180 /** rstream object \ingroup rstream */
182 
183 
184 /**
185  * Create a new OTF_RStream instance.
186  *
187  * @param nameStub File name prefix which is going to be used by
188  * all sub-files which belong to the reader stream.
189  * @param id Abitrary but unique identifier of the reader stream.
190  * Must be > '0' for real streams. Use '0' for global definitions.
191  * @param manager File handle manager.
192  *
193  * @return Initialized OTF_RStream instance or 0 if an error
194  * occurred.
195  *
196  * \ingroup rstream
197  */
198 OTF_RStream* OTF_RStream_open( const char* nameStub, uint32_t id, OTF_FileManager* manager );
199 
200 
201 /**
202  * Close an OTF_RStream instance and all its related files.
203  *
204  * @param rstream Pointer to an initialized OTF_RStream object. See
205  * also OTF_RStream_open().
206  *
207  * @return 1 if instance was closed successfully and 0 otherwise.
208  *
209  * \ingroup rstream
210  */
211 int OTF_RStream_close( OTF_RStream* rstream );
212 
213 
214 /**
215  * Returns the definition buffer of the according reader stream.
216  *
217  * @param rstream Pointer to an initialized OTF_RStream object. See
218  * also OTF_RStream_open().
219  *
220  * @return Initialized OTF_RBuffer instance or 0 if an error occured.
221  *
222  * \ingroup rstream
223  */
225 
226 
227 /**
228  * Forces the given definition buffer to the according reader stream.
229  *
230  * @param rstream Pointer to an initialized OTF_RStream object. See
231  * also OTF_RStream_open().
232  * @param rbuffer The OTF_RBuffer to use.
233  *
234  * @return The previously used Buffer or NULL if none.
235  *
236  * \ingroup rstream
237  */
239 
240 
241 /**
242  * Closes the stream definition buffer.
243  *
244  * @param rstream Pointer to an initialized OTF_RStream object. See
245  * also OTF_RStream_open().
246  *
247  * @return 1 on success, 0 if an error occurs
248  *
249  * \ingroup rstream
250  */
252 
253 
254 /**
255  * Returns the event buffer of the according reader stream.
256  *
257  * @param rstream Pointer to an initialized OTF_RStream object. See
258  * also OTF_RStream_open().
259  *
260  * @return Initialized OTF_RBuffer instance or 0 if an error occured.
261  *
262  * \ingroup rstream
263  */
265 
266 
267 /**
268  * Closes the stream event buffer.
269  *
270  * @param rstream Pointer to an initialized OTF_RStream object. See
271  * also OTF_RStream_open().
272  *
273  * @return 1 on success, 0 if an error occurs
274  *
275  * \ingroup rstream
276  */
278 
279 
280 /**
281  * Returns the snapshots buffer of the according reader stream.
282  *
283  * @param rstream Pointer to an initialized OTF_RStream object. See
284  * also OTF_RStream_open().
285  *
286  * @return Initialized OTF_RBuffer instance or 0 if an error occured.
287  *
288  * \ingroup rstream
289  */
291 
292 
293 /**
294  * Closes the stream snapshots buffer.
295  *
296  * @param rstream Pointer to an initialized OTF_RStream object. See
297  * also OTF_RStream_open().
298  *
299  * @return 1 on success, 0 if an error occurs
300  *
301  * \ingroup rstream
302  */
304 
305 
306 /**
307  * Returns the statistics buffer of the according reader stream.
308  *
309  * @param rstream Pointer to an initialized OTF_RStream object. See
310  * also OTF_RStream_open().
311  *
312  * @return Initialized OTF_RBuffer instance or 0 if an error occured.
313  *
314  * \ingroup rstream
315  */
317 
318 /**
319  * Closes the stream statistics buffer.
320  *
321  * @param rstream Pointer to an initialized OTF_RStream object. See
322  * also OTF_RStream_open().
323  *
324  * @return 1 on success, 0 if an error occurs
325  *
326  * \ingroup rstream
327  */
329 
330 
331 /**
332  * Returns the marker buffer of the according reader stream.
333  *
334  * @param rstream Pointer to an initialized OTF_RStream object. See
335  * also OTF_RStream_open().
336  *
337  * @return Initialized OTF_RBuffer instance or 0 if an error occured.
338  *
339  * \ingroup rstream
340  */
342 
343 
344 /**
345  * Closes the stream marker buffer.
346  *
347  * @param rstream Pointer to an initialized OTF_RStream object. See
348  * also OTF_RStream_open().
349  *
350  * @return 1 on success, 0 if an error occurs
351  *
352  * \ingroup rstream
353  */
355 
356 
357 /**
358  * Set the default buffer size for all buffers managed by this reader stream.
359  * This is only effective for future buffers and will not change already
360  * allocated buffers. Those can be changed with the buffers directly.
361  *
362  * @param rstream Pointer to an initialized OTF_RStream object. See
363  * also OTF_RStream_open().
364  *
365  * @param size Intended buffer size.
366  *
367  * \ingroup rstream
368  */
369 void OTF_RStream_setBufferSizes( OTF_RStream* rstream, uint32_t size );
370 
371 
372 /**
373  * Get the default buffer size for all buffers managed by this reader stream.
374  *
375  * @param rstream Pointer to an initialized OTF_RStream object. See
376  * also OTF_RStream_open().
377  *
378  * @return Default buffer size for all buffers managed by this reader
379  * stream.
380  *
381  * \ingroup rstream
382  */
383 uint32_t OTF_RStream_getBufferSizes( OTF_RStream* rstream );
384 
385 
386 /**
387  * Set the default zbuffer size for all files managed by this reader stream.
388  * This is only effective for future files and will not change already
389  * allocated buffers. Those can be changed with the files directly.
390  *
391  * @param rstream Pointer to an initialized OTF_RStream object. See
392  * also OTF_RStream_open().
393  *
394  * @param size Intended buffer size.
395  *
396  * \ingroup rstream
397  */
398 void OTF_RStream_setZBufferSizes( OTF_RStream* rstream, uint32_t size );
399 
400 
401 /**
402  * Get the default zbuffer size for all files managed by this reader stream.
403  *
404  * @param rstream Pointer to an initialized OTF_RStream object. See
405  * also OTF_RStream_open().
406  *
407  * @return Default buffer size for all buffers managed by this reader
408  * stream.
409  *
410  * \ingroup rstream
411  */
412 uint32_t OTF_RStream_getZBufferSizes( OTF_RStream* rstream );
413 
414 
415 /**
416  * Sets the maximum number of records delivered by a single call to
417  * OTF_RStream_readXYZ(). Defaults to OTF_READ_MAXRECORDS == \infty.
418  * 'OTF_Reader_readXYZ()' returns with the number of records processed.
419  * Successive calls to 'OTF_Reader_readXYZ()' will deliver the remaining
420  * records.
421  *
422  * This function will NOT destroy a pending read operation, i.e. a read
423  * operation currently interrupted CAN be continued!
424  *
425  * @param rstream Pointer to an initialized OTF_RStream object. See
426  * also OTF_RStream_open().
427  * @param limit new record limit. has to be smaller than or equal to
428  * OTF_READ_MAXRECORDS
429  *
430  * \ingroup rstream
431  */
432 void OTF_RStream_setRecordLimit( OTF_RStream* rstream, uint64_t limit );
433 
434 
435 /**
436  * Returns the current record limit.
437  *
438  * @param rstream Pointer to an initialized OTF_RStream object. See
439  * also OTF_RStream_open().
440  *
441  * @return Current record limit.
442  *
443  * \ingroup rstream
444  */
445 uint64_t OTF_RStream_getRecordLimit( OTF_RStream* rstream );
446 
447 
448 
449 /**
450  * Reads all definitions from the stream.
451  *
452  * @param rstream Pointer to an initialized OTF_RStream object. See
453  * also OTF_RStream_open().
454  * @param handlers Pointer to the handler array.
455  *
456  * @return Number of records read or OTF_READ_MAXRECORDS
457  *
458  * \ingroup rstream
459  */
460 uint64_t OTF_RStream_readDefinitions( OTF_RStream* rstream,
461  OTF_HandlerArray* handlers );
462 
463 
464 /**
465  * Reads all events from the stream and calls the appropriated handler sorted
466  * by time.
467  *
468  * @param rstream Pointer to an initialized OTF_RStream object. See
469  * also OTF_RStream_open().
470  * @param handlers Pointer to the handler array.
471  *
472  * @return Number of records read or OTF_READ_MAXRECORDS
473  *
474  * \ingroup rstream
475  */
476 uint64_t OTF_RStream_readEvents( OTF_RStream* rstream, OTF_HandlerArray* handlers );
477 
478 
479 /**
480  * Reads all snapshots from the stream.
481  *
482  * @param rstream Pointer to an initialized OTF_RStream object. See
483  * also OTF_RStream_open().
484  * @param handlers Pointer to the handler array.
485  *
486  * @return Number of records read or OTF_READ_MAXRECORDS
487  *
488  * \ingroup rstream
489  */
490 uint64_t OTF_RStream_readSnapshots( OTF_RStream* rstream, OTF_HandlerArray* handlers );
491 
492 
493 /**
494  * Reads all statistics from the stream.
495  *
496  * @param rstream Pointer to an initialized OTF_RStream object. See
497  * also OTF_RStream_open().
498  * @param handlers Pointer to the handler array.
499  *
500  * @return Number of records read or OTF_READ_MAXRECORDS
501  *
502  * \ingroup rstream
503  */
504 uint64_t OTF_RStream_readStatistics( OTF_RStream* rstream, OTF_HandlerArray* handlers );
505 
506 
507 /**
508  * Reads all markers from the stream.
509  *
510  * @param rstream Pointer to an initialized OTF_RStream object. See
511  * also OTF_RStream_open().
512  * @param handlers Pointer to the handler array.
513  *
514  * @return Number of records read or OTF_READ_MAXRECORDS
515  *
516  * \ingroup rstream
517  */
518 uint64_t OTF_RStream_readMarker( OTF_RStream* rstream, OTF_HandlerArray* handlers );
519 
520 
521 /** depricated. @see OTF_RStream_eventTimeProgress() \ingroup rstream */
522 uint8_t OTF_RStream_eventProgress( OTF_RStream* rstream, uint64_t* minimum,
523  uint64_t* current, uint64_t* maximum );
524 
525 /** depricated. @see OTF_RStream_snapshotTimeProgress() \ingroup rstream */
526 uint8_t OTF_RStream_snapshotProgress( OTF_RStream* rstream,
527  uint64_t* minimum, uint64_t* current, uint64_t* maximum );
528 
529 /** depricated. @see OTF_RStream_statisticTimeProgress() \ingroup rstream */
531  uint64_t* minimum, uint64_t* current, uint64_t* maximum );
532 
533 
534 /**
535  * Delivers a progress report for reading events. It is given in terms
536  * of time stamps. A percentage can be computed as
537  * ( current - minimum ) / ( maximum - minimum ).
538  * This computation takes restricted time intervals into account which is not
539  * possible with OTF_RStream_eventBytesProgress().
540  *
541  * The progress report is only valid after one or several calls to
542  * OTF_RStream_readEvents(). Otherwise the return arguments 'minimum', 'current'
543  * and 'maximum' are undefined!
544  * If 'minimum' > 'maximum' the values are invalid.
545  *
546  * @param rstream Pointer to an initialized OTF_RStream object. See
547  * also OTF_RStream_open().
548  * @param minimum Return value for the minium time.
549  * @param current Return value for the current time.
550  * @param maximum Return value for the maximum time.
551  *
552  * @return 1 on success, 0 if an error occurs.
553  *
554  * \ingroup rstream
555  */
556 uint8_t OTF_RStream_eventTimeProgress( OTF_RStream* rstream, uint64_t* minimum,
557  uint64_t* current, uint64_t* maximum );
558 
559 
560 /**
561  * Delivers a progress report for reading snapshots. It is given in terms
562  * of time stamps. A percentage can be computed as
563  * ( current - minimum ) / ( maximum - minimum ).
564  * This computation takes restricted time intervals into account which is not
565  * possible with OTF_RStream_snapshotBytesProgress().
566  *
567  * The progress report is only valid after one or several calls to
568  * OTF_RStream_readSnapshots(). Otherwise the return arguments 'minimum', 'current'
569  * and 'maximum' are undefined!
570  * If 'minimum' > 'maximum' the values are invalid.
571  *
572  * @param rstream Pointer to an initialized OTF_RStream object. See
573  * also OTF_RStream_open().
574  * @param minimum Return value for the minium time.
575  * @param current Return value for the current time.
576  * @param maximum Return value for the maximum time.
577  *
578  * @return 1 on success, 0 if an error occurs.
579  *
580  * \ingroup rstream
581  */
583  uint64_t* minimum, uint64_t* current, uint64_t* maximum );
584 
585 
586 /**
587  * Delivers a progress report for reading statistics. It is given in terms
588  * of time stamps. A percentage can be computed as
589  * ( current - minimum ) / ( maximum - minimum ).
590  * This computation takes restricted time intervals into account which is not
591  * possible with OTF_Reader_statisticBytesProgress().
592  *
593  * The progress report is only valid after one or several calls to
594  * OTF_Reader_readStatistics(). Otherwise the return arguments 'minimum', 'current'
595  * and 'maximum' are undefined!
596  * If 'minimum' > 'maximum' the values are invalid.
597  *
598  * @param rstream Pointer to an initialized OTF_RStream object. See
599  * also OTF_RStream_open().
600  * @param minimum Return value for the minium time.
601  * @param current Return value for the current time.
602  * @param maximum Return value for the maximum time.
603  *
604  * @return 1 on success, 0 if an error occurs.
605  *
606  * \ingroup rstream
607  */
609  uint64_t* minimum, uint64_t* current, uint64_t* maximum );
610 
611 
612 /**
613  * Delivers a progress report for reading events. Progress is given in terms
614  * of bytes. The percentage can be computed as ( current - minimum ) / ( maximum - minimum ).
615  *
616  * ATTENTION: This in only a rough estimate of the progress, because it is
617  * computed based on the block I/O from files but not based on the actual bytes
618  * processed. This may result in constant values for small traces.
619  * See also OTF_RStream_eventTimeProgress():
620  *
621  * The progress report is only valid after one or several calls to
622  * OTF_RStream_readEvents(). Otherwise the return arguments 'minimum', 'current' and 'maximum' are
623  * undefined! If 'minimum' > 'maximum' the values are invalid.
624 *
625  * @param rstream Pointer to an initialized OTF_RStream object. See
626  * also OTF_RStream_open().
627  * @param minimum Return value for the minium bytes read ( is 0 everytime ).
628  * @param current Return value for the current bytes read.
629  * @param maximum Return value for the filesize.
630  *
631  * @return 1 on success, 0 if an error occurs.
632  *
633  * \ingroup rstream
634  */
635 uint8_t OTF_RStream_eventBytesProgress( OTF_RStream* rstream, uint64_t* minimum,
636  uint64_t* current, uint64_t* maximum );
637 
638 
639 /**
640  * Delivers a progress report for reading snapshots. Progress is given in terms
641  * of bytes. The percentage can be computed as ( current - minimum ) / ( maximum - minimum ).
642  *
643  * ATTENTION: This in only a rough estimate of the progress, because it is
644  * computed based on the block I/O from files but not based on the actual bytes
645  * processed. This may result in constant values for small traces.
646  * See also OTF_RStream_snapshotTimeProgress():
647  *
648  * The progress report is only valid after one or several calls to
649  * OTF_RStream_readSnapshots(). Otherwise the return arguments 'minimum', 'current' and 'maximum' are
650  * undefined! If 'minimum' > 'maximum' the values are invalid.
651  *
652  * @param rstream Pointer to an initialized OTF_RStream object. See
653  * also OTF_RStream_open().
654  * @param minimum Return value for the minium bytes read ( is 0 everytime ).
655  * @param current Return value for the current bytes read.
656  * @param maximum Return value for the filesize.
657  *
658  * @return 1 on success, 0 if an error occurs.
659  *
660  * \ingroup rstream
661  */
663  uint64_t* minimum, uint64_t* current, uint64_t* maximum );
664 
665 /**
666  * Delivers a progress report for reading statistics. Progress is given in terms
667  * of bytes. The percentage can be computed as ( current - minimum ) / ( maximum - minimum ).
668  *
669  * ATTENTION: This in only a rough estimate of the progress, because it is
670  * computed based on the block I/O from files but not based on the actual bytes
671  * processed. This may result in constant values for small traces.
672  * See also OTF_RStream_statisticTimeProgress():
673  *
674  * The progress report is only valid after one or several calls to
675  * OTF_RStream_readStatistics(). Otherwise the return arguments 'minimum', 'current' and 'maximum' are
676  * undefined! If 'minimum' > 'maximum' the values are invalid.
677  *
678  * @param rstream Pointer to an initialized OTF_RStream object. See
679  * also OTF_RStream_open().
680  * @param minimum Return value for the minium bytes read ( is 0 everytime ).
681  * @param current Return value for the current bytes read.
682  * @param maximum Return value for the filesize.
683  *
684  * @return 1 on success, 0 if an error occurs.
685  *
686  * \ingroup rstream
687  */
689  uint64_t* minimum, uint64_t* current, uint64_t* maximum );
690 
691 #ifdef __cplusplus
692 }
693 #endif /* __cplusplus */
694 
695 #endif /* OTF_RSTREAM_H */
OTF_RBuffer * OTF_RStream_getStatsBuffer(OTF_RStream *rstream)
Returns the statistics buffer of the according reader stream.
Definition: OTF_RStream.c:408
uint64_t OTF_RStream_readSnapshots(OTF_RStream *rstream, OTF_HandlerArray *handlers)
Reads all snapshots from the stream.
Definition: OTF_RStream.c:782
OTF_RBuffer * OTF_RStream_getMarkerBuffer(OTF_RStream *rstream)
Returns the marker buffer of the according reader stream.
Definition: OTF_RStream.c:469
OTF_RBuffer * defBuffer
Definitions buffer.
Definition: OTF_RStream.h:144
uint32_t OTF_RStream_getBufferSizes(OTF_RStream *rstream)
Get the default buffer size for all buffers managed by this reader stream.
Definition: OTF_RStream.c:559
uint64_t OTF_RStream_readMarker(OTF_RStream *rstream, OTF_HandlerArray *handlers)
Reads all markers from the stream.
Definition: OTF_RStream.c:956
void OTF_RStream_setZBufferSizes(OTF_RStream *rstream, uint32_t size)
Set the default zbuffer size for all files managed by this reader stream.
Definition: OTF_RStream.c:566
uint32_t id
Unique id for the current stream.
Definition: OTF_RStream.h:140
char * namestub
name stub: all files will begin with this name
Definition: OTF_RStream.h:137
int OTF_RStream_closeMarkerBuffer(OTF_RStream *rstream)
Closes the stream marker buffer.
Definition: OTF_RStream.c:507
uint32_t OTF_RStream_getZBufferSizes(OTF_RStream *rstream)
Get the default zbuffer size for all files managed by this reader stream.
Definition: OTF_RStream.c:599
int OTF_RStream_closeEventBuffer(OTF_RStream *rstream)
Closes the stream event buffer.
Definition: OTF_RStream.c:326
uint8_t OTF_RStream_snapshotTimeProgress(OTF_RStream *rstream, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
Delivers a progress report for reading snapshots.
Definition: OTF_RStream.c:1060
uint64_t OTF_RStream_readEvents(OTF_RStream *rstream, OTF_HandlerArray *handlers)
Reads all events from the stream and calls the appropriated handler sorted by time.
Definition: OTF_RStream.c:696
int OTF_RStream_closeStatsBuffer(OTF_RStream *rstream)
Closes the stream statistics buffer.
Definition: OTF_RStream.c:447
void OTF_RStream_setRecordLimit(OTF_RStream *rstream, uint64_t limit)
Sets the maximum number of records delivered by a single call to OTF_RStream_readXYZ().
Definition: OTF_RStream.c:610
uint8_t OTF_RStream_snapshotProgress(OTF_RStream *rstream, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
depricated.
Definition: OTF_RStream.c:1025
OTF_RBuffer * statsBuffer
Statistics buffer.
Definition: OTF_RStream.h:160
uint8_t OTF_RStream_eventTimeProgress(OTF_RStream *rstream, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
Delivers a progress report for reading events.
Definition: OTF_RStream.c:1041
Definition: OTF_RBuffer.h:40
int OTF_RStream_closeSnapsBuffer(OTF_RStream *rstream)
Closes the stream snapshots buffer.
Definition: OTF_RStream.c:386
Object structure which holds OTF record handlers.
Definition: OTF_HandlerArray.h:52
OTF_RBuffer * OTF_RStream_getSnapsBuffer(OTF_RStream *rstream)
Returns the snapshots buffer of the according reader stream.
Definition: OTF_RStream.c:348
int OTF_RStream_close(OTF_RStream *rstream)
Close an OTF_RStream instance and all its related files.
Definition: OTF_RStream.c:180
OTF_FileManager * manager
file handle manager
Definition: OTF_RStream.h:174
uint32_t buffersizes
Default size of buffers managed by this RStream.
Definition: OTF_RStream.h:166
Manages file handles.
uint8_t OTF_RStream_statisticBytesProgress(OTF_RStream *rstream, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
Delivers a progress report for reading statistics.
Definition: OTF_RStream.c:1130
OTF_RBuffer * OTF_RStream_getDefBuffer(OTF_RStream *rstream)
Returns the definition buffer of the according reader stream.
Definition: OTF_RStream.c:203
uint64_t recordLimit
maximum number of records delivered by a single call to OTF_Reader_readXYZ() defaults to OTF_READ_MAX...
Definition: OTF_RStream.h:178
uint8_t OTF_RStream_eventProgress(OTF_RStream *rstream, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
depricated.
Definition: OTF_RStream.c:1017
uint8_t OTF_RStream_statisticProgress(OTF_RStream *rstream, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
depricated.
Definition: OTF_RStream.c:1033
OTF_RBuffer * eventBuffer
Event buffer.
Definition: OTF_RStream.h:148
uint64_t OTF_RStream_readDefinitions(OTF_RStream *rstream, OTF_HandlerArray *handlers)
Reads all definitions from the stream.
Definition: OTF_RStream.c:635
OTF_RBuffer * markerBuffer
Marker buffer.
Definition: OTF_RStream.h:163
Definition: OTF_RStream.h:133
int OTF_RStream_closeDefBuffer(OTF_RStream *rstream)
Closes the stream definition buffer.
Definition: OTF_RStream.c:259
uint8_t OTF_RStream_snapshotBytesProgress(OTF_RStream *rstream, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
Delivers a progress report for reading snapshots.
Definition: OTF_RStream.c:1114
uint64_t OTF_RStream_getRecordLimit(OTF_RStream *rstream)
Returns the current record limit.
Definition: OTF_RStream.c:627
OTF_RBuffer * OTF_RStream_setDefBuffer(OTF_RStream *rstream, OTF_RBuffer *rbuffer)
Forces the given definition buffer to the according reader stream.
Definition: OTF_RStream.c:241
OTF_RBuffer * OTF_RStream_getEventBuffer(OTF_RStream *rstream)
Returns the event buffer of the according reader stream.
Definition: OTF_RStream.c:282
uint8_t OTF_RStream_statisticTimeProgress(OTF_RStream *rstream, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
Delivers a progress report for reading statistics.
Definition: OTF_RStream.c:1079
OTF_RBuffer * snapsBuffer
Snaps (snapshots) buffer.
Definition: OTF_RStream.h:154
file handles management structure
Definition: OTF_FileManager.c:32
Provides read access to OTF traces which consist of multiple streams.
void OTF_RStream_setBufferSizes(OTF_RStream *rstream, uint32_t size)
Set the default buffer size for all buffers managed by this reader stream.
Definition: OTF_RStream.c:530
Handles file naming issues.
Deals with all data type related issues.
uint64_t OTF_RStream_readStatistics(OTF_RStream *rstream, OTF_HandlerArray *handlers)
Reads all statistics from the stream.
Definition: OTF_RStream.c:868
OTF_RStream * OTF_RStream_open(const char *nameStub, uint32_t id, OTF_FileManager *manager)
Create a new OTF_RStream instance.
Definition: OTF_RStream.c:142
Provides read access to trace buffers.
uint8_t OTF_RStream_eventBytesProgress(OTF_RStream *rstream, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
Delivers a progress report for reading events.
Definition: OTF_RStream.c:1098