Ignore:
Timestamp:
08/25/15 17:40:12 (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:
2fa43fa
Parents:
03aca91
Message:

Fix #5 make trace_pstart fallback to the single threaded format

If starting a parallel format fails we now retry as a single threaded format.
This fixes ring/int on older (pre 3.1 kernels) machines without PACKET_FANOUT.
This behaviour can be detected using trace_is_parallel()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_parallel.h

    r4007dbb rf2066fa  
    537537 *
    538538 * @param libtrace The input trace to start
    539  * @param message The message to intercept
    540539 * @param handler the handler to be called when the message is received
    541540 * @return 0 if successful otherwise -1.
     
    627626/** Store data against a thread.
    628627 *
    629  * @param The parallel trace.
    630  * @param data The new value to save against the trace
     628 * @param thread The thread
     629 * @param data The new value to save against the thread
    631630 * @return The previously stored value
    632631 *
     
    713712 * as possible (real-time).
    714713 *
    715  * @param A parallel input trace
     714 * @param trace A parallel input trace
    716715 * @param tracetime If true packets are released with time intervals matching
    717716 * the original trace. Otherwise packets are read as fast as possible.
     
    895894         *
    896895         * @param key (Typically) The packets order, see trace_packet_get_order()
    897          * @param
    898896         */
    899897        RESULT_PACKET,
     
    10511049 */
    10521050DLLEXPORT bool trace_has_finished(libtrace_t * libtrace);
     1051
     1052
     1053/** Check if libtrace is directly reading from multiple queues
     1054 * from the format (such as a NICs hardware queues).
     1055 *
     1056 * When a parallel trace is running, or if checked after its completion
     1057 * this returns true if a trace was able to run natively parallel
     1058 * from the format. Otherwise false is returned, meaning libtrace is
     1059 * distibuting packets across multiple threads from a single source.
     1060 *
     1061 * Factors that may stop this happening despite the format supporting
     1062 * native parallel reads include: the choice of hasher function,
     1063 * the number of threads choosen (such as 1 or more than the trace supports)
     1064 * or another error when trying to start the parallel format.
     1065 *
     1066 * If this is called before the trace is started. I.e. before pstart
     1067 * this returns an indication that the trace has the possiblity to support
     1068 * native parallel reads. After trace pstart is called this should be
     1069 * checked again to confirm this has happened.
     1070 *
     1071 *
     1072 * @return true if the trace is parallel or false if the library is splitting
     1073 * the trace into multiple threads.
     1074 */
     1075DLLEXPORT bool trace_is_parallel(libtrace_t * libtrace);
    10531076
    10541077/** Returns either the sequence number or erf timestamp of a packet.
Note: See TracChangeset for help on using the changeset viewer.