Changeset f051c1b for lib/trace.c


Ignore:
Timestamp:
08/12/14 14:14:50 (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:
0862c20
Parents:
f9a70ca
Message:

Tidies up the state messages received, now all states are passed through created->resumed->paused->stopped this might simplify some code. Removed the extra paused state.
Hooks up the reporter method through trace_pstart, hopefully resulting in simpler code most of the time. Also renames this from reducer to reporter anywhere it was not already. Adds a test for this also.
Removes is_packet from a result in favour of a more generic type, with packet being one of these.
Moves configuration for tuning relelated settings into a single structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rf9a70ca rf051c1b  
    265265        libtrace->state = STATE_NEW;
    266266        libtrace->perpkt_queue_full = false;
    267         libtrace->reducer_flags = 0;
     267        libtrace->reporter_flags = 0;
    268268        libtrace->global_blob = NULL;
    269269        libtrace->per_pkt = NULL;
    270         libtrace->reducer = NULL;
     270        libtrace->reporter = NULL;
    271271        libtrace->hasher = NULL;
    272         libtrace->packet_freelist_size = 0;
    273         libtrace->perpkt_buffer_size = 0;
    274272        libtrace->expected_key = 0;
    275273        libtrace_zero_ocache(&libtrace->packet_freelist);
    276274        libtrace_zero_thread(&libtrace->hasher_thread);
    277         libtrace_zero_thread(&libtrace->reducer_thread);
     275        libtrace_zero_thread(&libtrace->reporter_thread);
    278276        libtrace_zero_thread(&libtrace->keepalive_thread);
    279277        libtrace_zero_slidingwindow(&libtrace->sliding_window);
    280         libtrace->reducer_thread.type = THREAD_EMPTY;
     278        libtrace->reporter_thread.type = THREAD_EMPTY;
    281279        libtrace->perpkt_thread_count = 0;
    282280        libtrace->perpkt_threads = NULL;
    283281        libtrace->tracetime = 0;
    284         libtrace->tick_interval = 0;
    285282        libtrace->first_packets.first = 0;
    286283        libtrace->first_packets.count = 0;
    287284        libtrace->first_packets.packets = NULL;
    288285        libtrace->dropped_packets = UINT64_MAX;
     286        ZERO_USER_CONFIG(libtrace->config);
    289287
    290288        /* Parse the URI to determine what sort of trace we are dealing with */
     
    388386        libtrace->state = STATE_NEW; // TODO MAYBE DEAD
    389387        libtrace->perpkt_queue_full = false;
    390         libtrace->reducer_flags = 0;
     388        libtrace->reporter_flags = 0;
    391389        libtrace->global_blob = NULL;
    392390        libtrace->per_pkt = NULL;
    393         libtrace->reducer = NULL;
     391        libtrace->reporter = NULL;
    394392        libtrace->hasher = NULL;
    395393        libtrace->expected_key = 0;
    396         libtrace->packet_freelist_size = 0;
    397         libtrace->perpkt_buffer_size = 0;
    398394        libtrace_zero_ocache(&libtrace->packet_freelist);
    399395        libtrace_zero_thread(&libtrace->hasher_thread);
    400         libtrace_zero_thread(&libtrace->reducer_thread);
     396        libtrace_zero_thread(&libtrace->reporter_thread);
    401397        libtrace_zero_thread(&libtrace->keepalive_thread);
    402398        libtrace_zero_slidingwindow(&libtrace->sliding_window);
    403         libtrace->reducer_thread.type = THREAD_EMPTY;
     399        libtrace->reporter_thread.type = THREAD_EMPTY;
    404400        libtrace->perpkt_thread_count = 0;
    405401        libtrace->perpkt_threads = NULL;
    406402        libtrace->tracetime = 0;
    407         libtrace->tick_interval = 0;
     403        ZERO_USER_CONFIG(libtrace->config);
    408404       
    409405        for(tmp=formats_list;tmp;tmp=tmp->next) {
Note: See TracChangeset for help on using the changeset viewer.