Changeset f8613e4


Ignore:
Timestamp:
12/12/16 15:56:26 (4 years ago)
Author:
GitHub <noreply@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
47c4490
Parents:
5e3f16c (diff), adb2c4c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Shane Alcock <salcock@…> (12/12/16 15:56:26)
git-committer:
GitHub <noreply@…> (12/12/16 15:56:26)
Message:

Merge pull request #41 from wanduow/remove_packet_locks

Remove mutex in the packet path, which limits performance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r5e3f16c radb2c4c  
    550550
    551551        /* Finish the last packet we read - for backwards compatibility */
    552         if (libtrace->last_packet)
     552        if (!libtrace_parallel && libtrace->last_packet)
    553553                trace_fin_packet(libtrace->last_packet);
    554554        assert(libtrace->last_packet == NULL);
     
    697697
    698698        /* Finish any the last packet we read - for backwards compatibility */
    699         if (libtrace->last_packet) {
     699        if (!libtrace_parallel && libtrace->last_packet) {
    700700                trace_fin_packet(libtrace->last_packet);
    701701        }
     
    837837                packet->trace->format->fin_packet(packet);
    838838        }
    839         if (packet->trace && packet->trace->last_packet == packet)
     839        if (!libtrace_parallel && packet->trace &&
     840             packet->trace->last_packet == packet) {
    840841                packet->trace->last_packet = NULL;
     842        }
    841843       
    842844        if (packet->buf_control == TRACE_CTRL_PACKET && packet->buffer) {
     
    868870
    869871                if (packet->trace) {
    870                         pthread_mutex_lock(&packet->trace->libtrace_lock);
    871                         if (packet->trace->last_packet == packet)
    872                                 packet->trace->last_packet = NULL;
    873                         pthread_mutex_unlock(&packet->trace->libtrace_lock);
     872                        if (!libtrace_parallel && packet->trace->last_packet == packet)
     873                                packet->trace->last_packet = NULL;
    874874                }
    875875
     
    960960                        ++libtrace->accepted_packets;
    961961                        ++libtrace->sequence_number;
    962                         if (packet->trace == libtrace)
     962                        if (!libtrace_parallel && packet->trace == libtrace)
    963963                                libtrace->last_packet = packet;
    964964
     
    10031003
    10041004        packet->trace = trace;
    1005         pthread_mutex_lock(&trace->libtrace_lock);
    1006         trace->last_packet = packet;
    1007         pthread_mutex_unlock(&trace->libtrace_lock);
     1005        if (!libtrace_parallel)
     1006                trace->last_packet = packet;
    10081007        /* Clear packet cache */
    10091008        trace_clear_cache(packet);
Note: See TracChangeset for help on using the changeset viewer.