Changeset 6a6e6a8 for tools/traceanon


Ignore:
Timestamp:
03/12/15 17:14:42 (6 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:
a978dec
Parents:
b54e2da
Message:

More documentation, including some renaming and modifications to behaviour

  • Removes accessor functions for libtrace_result_t, instead directly access the structure
  • Documentation for most functions
  • Split tick into interval and count messages for the two modes of operation
  • Normalise interval and packet order to use the erf timestamp format
  • Rename trace_send_message_to_XXX to trace trace_message_XXX
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/traceanon/traceanon_parallel.c

    r6a082f8 r6a6e6a8  
    161161        libtrace_udp_t *udp = NULL;
    162162        libtrace_tcp_t *tcp = NULL;
    163 
     163        libtrace_stat_t *stats = NULL;
    164164        switch (mesg) {
    165165        case MESSAGE_PACKET:
     
    199199                enc_init(enc_type,key);
    200200                break;
    201         case MESSAGE_TICK:
    202                 trace_publish_result(trace, t, data.uint64, (libtrace_generic_t){0}, RESULT_TICK);
     201        case MESSAGE_TICK_INTERVAL:
     202                trace_publish_result(trace, t, data.uint64, (libtrace_generic_t){0}, RESULT_TICK_INTERVAL);
     203                break;
     204        case MESSAGE_TICK_COUNT:
     205                trace_publish_result(trace, t, data.uint64, (libtrace_generic_t){0}, RESULT_TICK_COUNT);
     206                break;
     207        case MESSAGE_STOPPING:
     208                stats = trace_create_statistics();
     209                trace_get_thread_statistics(trace, t, stats);
     210                trace_print_statistics(stats, stderr, NULL);
     211                free(stats);
     212                stats = trace_get_statistics(trace, NULL);
     213                trace_print_statistics(stats, stderr, NULL);
     214                //fprintf(stderr, "tracestats_parallel:\t Stopping thread - publishing results\n");
    203215                break;
    204216        }
     
    216228        case MESSAGE_RESULT:
    217229                if (data.res->type == RESULT_PACKET) {
    218                         libtrace_packet_t *packet = (libtrace_packet_t*) libtrace_result_get_value(data.res).pkt;
    219                         assert(libtrace_result_get_key(data.res) == packet_count++);
     230                        libtrace_packet_t *packet = (libtrace_packet_t*) data.res->value.pkt;
     231                        assert(data.res->key >= packet_count);
     232                        packet_count = data.res->key;
    220233                        if (trace_write_packet(writer,packet)==-1) {
    221234                                trace_perror_output(writer,"writer");
    222235                                trace_interrupt();
    223236                        }
    224                         trace_free_result_packet(trace, packet);
     237                        trace_free_packet(trace, packet);
    225238
    226239                } else {
    227                         assert(data.res->type == RESULT_TICK);
     240                        assert(data.res->type == RESULT_TICK_COUNT || data.res->type == RESULT_TICK_INTERVAL);
    228241                        // Ignore it
    229242                }
Note: See TracChangeset for help on using the changeset viewer.