Changeset b606855 for lib


Ignore:
Timestamp:
06/22/17 10:36:26 (4 years ago)
Author:
Richard Sanger <rsanger@…>
Branches:
cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
1105ce0
Parents:
f398c61
Message:

Fixes issue #50 pstop errors/assertions

Pstop was either causing a assertion failure or an error,

when a hasher thread was used.

The assertion failure was due to assertion being out of date.

The error was due to removing trace_interrupt from pstop(),
but still going through the read_packet path.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace_parallel.c

    rf4fdcd1 rb606855  
    805805                                        break;
    806806                                case MESSAGE_DO_STOP:
     807                                        /* Either FINISHED or FINISHING */
    807808                                        assert(trace->started == false);
    808                                         assert(trace->state == STATE_FINISHED);
    809809                                        /* Mark the current packet as EOF */
    810810                                        packet->error = 0;
    811                                         break;
     811                                        goto hasher_eof;
    812812                                default:
    813813                                        fprintf(stderr, "Hasher thread didn't expect message code=%d\n", message.code);
     
    850850                }
    851851        }
    852 
     852hasher_eof:
    853853        /* Broadcast our last failed read to all threads */
    854854        for (i = 0; i < trace->perpkt_thread_count; i++) {
     
    862862                ASSERT_RET(pthread_mutex_lock(&trace->libtrace_lock), == 0);
    863863                if (trace->perpkt_threads[i].state != THREAD_FINISHED) {
    864                         // Unlock early otherwise we could deadlock
    865864                        libtrace_ringbuffer_write(&trace->perpkt_threads[i].rbuffer, bcast);
     865                } else {
     866                        libtrace_ocache_free(&trace->packet_freelist, (void **) &bcast, 1, 1);
    866867                }
    867868                ASSERT_RET(pthread_mutex_unlock(&trace->libtrace_lock), == 0);
Note: See TracChangeset for help on using the changeset viewer.