Ignore:
Timestamp:
02/24/15 17:18:21 (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:
116f970
Parents:
10c47a0
Message:

Move the accepted packet count to dispatching packets for threads.
Accounting for the doubled count when using a single threaded format.

Rework statistics logic slightly to remove duplicated code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace_parallel.c

    r10c47a0 r526d9d0  
    173173 * @return true if the trace has dedicated hasher thread otherwise false.
    174174 */
    175 static inline bool trace_has_dedicated_hasher(libtrace_t * libtrace)
     175inline bool trace_has_dedicated_hasher(libtrace_t * libtrace)
    176176{
    177177        return libtrace->hasher_thread.type == THREAD_HASHER;
     
    412412                                return READ_MESSAGE;
    413413                }
     414                t->accepted_packets++;
    414415                *packet = (*trace->per_pkt)(trace, *packet, NULL, t);
    415416                trace_fin_packet(*packet);
     
    732733                assert(packet);
    733734
    734                 if (libtrace_halt) // Signal to die has been sent - TODO
     735                if (libtrace_halt) {
     736                        packet->error = 0;
    735737                        break;
     738                }
    736739
    737740                // Check for messages that we expect MESSAGE_DO_PAUSE, (internal messages only)
     
    750753                                        break;
    751754                                case MESSAGE_DO_STOP:
    752                                         // Stop called after pause
    753755                                        assert(trace->started == false);
    754756                                        assert(trace->state == STATE_FINSHED);
     757                                        /* Mark the current packet as EOF */
     758                                        packet->error = 0;
    755759                                        break;
    756760                                default:
     
    761765                }
    762766
    763                 if ((packet->error = trace_read_packet(trace, packet)) <1 /*&& psize != LIBTRACE_MESSAGE_WAITING*/) {
     767                if ((packet->error = trace_read_packet(trace, packet)) <1) {
    764768                        break; /* We are EOF or error'd either way we stop  */
    765769                }
     
    14431447                                trace_packet_set_order(packets[i], trace_get_erf_timestamp(packets[i]));
    14441448                        }
    1445                         t->accepted_packets += ret;
    14461449                } while(ret == 0);
    14471450                return ret;
     
    16811684         */
    16821685        if (trace_has_dedicated_hasher(libtrace)) {
     1686                libtrace->hasher_thread.type = THREAD_EMPTY;
    16831687                ret = trace_start_thread(libtrace, &libtrace->hasher_thread,
    16841688                                   THREAD_HASHER, hasher_entry, -1,
Note: See TracChangeset for help on using the changeset viewer.