- // Is the file large enough to contain a trace
- if(lTDFStat.st_size <
- (off_t)(ltt_subbuffer_header_size())){
- g_print("The input data file %s does not contain a trace\n", fileName);
- goto close_file;
- }
-
- /* Temporarily map the buffer start header to get trace information */
- /* Multiple of pages aligned head */
- tf->buffer.head = mmap(0,
- PAGE_ALIGN(ltt_subbuffer_header_size()), PROT_READ,
- MAP_PRIVATE, tf->fd, 0);
- if(tf->buffer.head == MAP_FAILED) {
- perror("Error in allocating memory for buffer of tracefile");
- goto close_file;
- }
- g_assert( ( (gulong)tf->buffer.head&(8-1) ) == 0); // make sure it's aligned.
-
- header = (ltt_subbuffer_header_t *)tf->buffer.head;
-
-
- return header;
+ /* Is the file large enough to contain a trace */
+ if(lTDFStat.st_size < (off_t)(ltt_subbuffer_header_size())) {
+ g_print("The input data file %s does not contain a trace\n", fileName);
+ goto close_file;
+ }