Ignore:
Timestamp:
02/16/06 15:44:06 (15 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
f03fc17
Parents:
1fbd938
Message:

Added libtrace_set_err() to everything (except format_rt, that's shane's job)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_helper.c

    r6342c18 r880aa58  
    5555        }
    5656        if (ioctl(event.fd,FIONREAD,&data)==-1) {
    57                 perror("ioctl(FIONREAD)");
     57                event.type = TRACE_EVENT_TERMINATE;
     58                return event;
    5859        }
    5960        if (data>0) {
     
    8283                                        trace->event.packet.size);
    8384                } else {
    84                         // return here, the test for
    85                         // event.size will sort out the error
     85                        /* return here, the test for
     86                         * event.size will sort out the error
     87                         */
    8688                        event.type = TRACE_EVENT_TERMINATE;
    8789                        return event;
     
    9193        ts=trace_get_seconds(packet);
    9294        if (trace->event.tdelta!=0) {
    93                 // Get the adjusted current time
     95                /* Get the adjusted current time */
    9496                gettimeofday(&stv, NULL);
    9597                now = stv.tv_sec +
    9698                        ((double)stv.tv_usec / 1000000.0);
    97                 // adjust for trace delta
     99                /* adjust for trace delta */
    98100                now -= trace->event.tdelta;
    99101
    100                 //if the trace timestamp is still in the
     102                /*if the trace timestamp is still in the
    101103                //future, return a SLEEP event,
    102104                //otherwise fire the packet
     105                 */
    103106                if (ts > now) {
    104107                        event.seconds = ts -
     
    109112        } else {
    110113                gettimeofday(&stv, NULL);
    111                 // work out the difference between the
     114                /* work out the difference between the
    112115                // start of trace replay, and the first
    113116                // packet in the trace
     117                 */
    114118                trace->event.tdelta = stv.tv_sec +
    115119                        ((double)stv.tv_usec / 1000000.0);
     
    117121        }
    118122
    119         // This is the first packet, so just fire away.
     123        /* This is the first packet, so just fire away. */
    120124        packet->size = trace->event.packet.size;
    121125        memcpy(packet->buffer,
Note: See TracChangeset for help on using the changeset viewer.