Changeset fac8c46 for lib/trace.c


Ignore:
Timestamp:
05/20/14 03:25:13 (7 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
82facc5
Parents:
a5662447
Message:

Tidies up the pausing so that it now works as expected and a trace can easily be paused and restarted.
Ensures that packets will not be lost if pause is called on a file, any queued packets will be read (a message is sent allowing the user to drop these packets if they are unwanted).
Differentiates packets from other results in the queues to the reducer/reporter and makes a copy of the packets in result queues when pausing

  • this is needed to ensure that bad memory isn't referenced if a zero-copy trace is paused by closing sockets/associated data like in the case of ring:.

Fixed up the re-starting of traces which hadn't been finished to account for different configurations.
Adds a 'state' to libtrace to handle the state of parallel traces, rather than hacking around the existing 'started' boolean. Also provides two levels of checks for consistency if the trace is using existing that are checking started.

Various other bug fixes and tidy ups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r17a3dff rfac8c46  
    263263        // libtrace->libtrace_lock
    264264        // libtrace->perpkt_cond;
     265        libtrace->state = STATE_NEW;
    265266        libtrace->perpkts_pausing = 0;
    266267        libtrace->perpkt_queue_full = false;
     
    282283        libtrace->perpkt_thread_count = 0;
    283284        libtrace->perpkt_threads = NULL;
     285        libtrace->tracetime = 0;
    284286
    285287        /* Parse the URI to determine what sort of trace we are dealing with */
     
    381383        // libtrace->libtrace_lock
    382384        // libtrace->perpkt_cond;
     385        libtrace->state = STATE_NEW; // TODO MAYBE DEAD
    383386        libtrace->perpkts_pausing = 0;
    384387        libtrace->perpkt_queue_full = false;
     
    400403        libtrace->perpkt_thread_count = 0;
    401404        libtrace->perpkt_threads = NULL;
     405        libtrace->tracetime = 0;
    402406       
    403407        for(tmp=formats_list;tmp;tmp=tmp->next) {
     
    783787                if (packet->buf_control != TRACE_CTRL_PACKET)
    784788                {
    785                         //packet->buf_control = 0; // Invalid value this should be fixed
    786789                        packet->buffer = NULL;
    787790                }
Note: See TracChangeset for help on using the changeset viewer.