Ignore:
Timestamp:
03/05/15 15:44:30 (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:
ab3fa18
Parents:
b023181
Message:

Update the reporter method to match with the per_pkt method.

We now treat a result as a type of message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/traceanon/traceanon_parallel.c

    r0ec8a7c r62b3c4e  
    208208struct libtrace_out_t *writer = 0;
    209209
    210 static void write_out(libtrace_t *trace, libtrace_result_t *result, UNUSED libtrace_message_t *mesg) {
     210static void write_out(libtrace_t *trace UNUSED, int mesg,
     211                      libtrace_generic_t data,
     212                      libtrace_thread_t *sender UNUSED) {
    211213        static uint64_t packet_count = 0; // TESTING PURPOSES, this is not going to work with a live format
    212214
    213         if (result) {
    214                 if (result->type == RESULT_PACKET) {
    215                         libtrace_packet_t *packet = (libtrace_packet_t*) libtrace_result_get_value(result).pkt;
    216                         assert(libtrace_result_get_key(result) == packet_count++);
     215        switch (mesg) {
     216        case MESSAGE_RESULT:
     217                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++);
    217220                        if (trace_write_packet(writer,packet)==-1) {
    218221                                trace_perror_output(writer,"writer");
     
    222225
    223226                } else {
    224                         assert(result->type == RESULT_TICK);
     227                        assert(data.res->type == RESULT_TICK);
    225228                        // Ignore it
    226229                }
Note: See TracChangeset for help on using the changeset viewer.