Changeset ac65c9f


Ignore:
Timestamp:
03/30/15 13:32:43 (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:
c723e9e
Parents:
91e016c
Message:

Fix bug in reporter dectecting per-packet threads finished too early finished, if stopped using trace_pstop.

Fix typo

Location:
lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_int.h

    r91e016c rac65c9f  
    237237        X(STATE_PAUSING) \
    238238        X(STATE_PAUSED) \
    239         X(STATE_FINSHED) \
     239        X(STATE_FINISHED) \
     240        X(STATE_FINISHING) \
    240241        X(STATE_DESTROYED) \
    241242        X(STATE_JOINED) \
  • lib/trace.c

    r91e016c rac65c9f  
    20912091        /* If the trace has paused or finished get the cached results */
    20922092        if (trace->state == STATE_PAUSED ||
    2093             trace->state == STATE_FINSHED ||
     2093            trace->state == STATE_FINISHED ||
     2094            trace->state == STATE_FINISHING ||
    20942095            trace->state == STATE_JOINED) {
    20952096                if (trace->stats && trace->stats != stat)
  • lib/trace_parallel.c

    r5431dfc rac65c9f  
    250250
    251251        if (trace->perpkt_thread_states[THREAD_FINISHED] == trace->perpkt_thread_count)
    252                 libtrace_change_state(trace, STATE_FINSHED, false);
     252                libtrace_change_state(trace, STATE_FINISHED, false);
    253253
    254254        pthread_cond_broadcast(&trace->perpkt_cond);
     
    722722                                case MESSAGE_DO_STOP:
    723723                                        assert(trace->started == false);
    724                                         assert(trace->state == STATE_FINSHED);
     724                                        assert(trace->state == STATE_FINISHED);
    725725                                        /* Mark the current packet as EOF */
    726726                                        packet->error = 0;
     
    10851085        message.code = MESSAGE_TICK_INTERVAL;
    10861086
    1087         while (trace->state != STATE_FINSHED) {
     1087        while (trace->state != STATE_FINISHED) {
    10881088                fd_set rfds;
    10891089                next_release = tv_to_usec(&prev) + (trace->config.tick_interval * 1000);
     
    19141914        }
    19151915
    1916         // Now release the threads and let them stop
    1917         libtrace_change_state(libtrace, STATE_FINSHED, true);
     1916        /* Now release the threads and let them stop - when the threads finish
     1917         * the state will be set to finished */
     1918        libtrace_change_state(libtrace, STATE_FINISHING, true);
    19181919        return 0;
    19191920}
     
    21802181
    21812182DLLEXPORT bool trace_has_finished(libtrace_t * libtrace) {
    2182         return libtrace->state == STATE_FINSHED || libtrace->state == STATE_JOINED;
     2183        return libtrace->state == STATE_FINISHED || libtrace->state == STATE_JOINED;
    21832184}
    21842185
Note: See TracChangeset for help on using the changeset viewer.