Changeset 5e3f16c for lib/format_dag25.c


Ignore:
Timestamp:
12/05/16 19:04:41 (4 years ago)
Author:
Richard Sanger <rsanger@…>
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:
adb2c4c, cff1819, f8613e4
Parents:
8ccb8536
Message:

Fix for issue #39 - ring and int pstop() fails on older kernels when using threads

The problem here is that on old kernels without PACKET_FANOUT support
(added in v3.1) will only include the single threaded versions of int
and ring. When used with multiple threads the libtrace API will
fallback to using read rather than pread which does not check message
queues.

To fix this issue, in any format without pread support:

  • We check for new messages with each loop around read_packet as we fill the burst
  • Within read_packet we update the halt to include the pausing state
  • Use a seperate lock to the main lock when reading a burst of packets, otherwise trace_ppause has to wait for a burst to read.

This is not 100% perfect as a single packet might still need to be received
before a generic message can be received.
A proper fix in the future would be to move all format internals purely to the
parallel API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dag25.c

    ree6e802 r5e3f16c  
    13041304                                return -2;
    13051305
    1306                         if (libtrace_halt)
    1307                                 return 0;
     1306                        if ((numbytes=is_halted(libtrace)) != -1)
     1307                                return numbytes;
    13081308                        /* Block until we see a packet */
    13091309                        continue;
Note: See TracChangeset for help on using the changeset viewer.