Changeset b13b939 for lib/libtrace.h.in


Ignore:
Timestamp:
06/18/14 16:12:46 (7 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:
85e87b5
Parents:
82facc5
Message:

Adds a configuration option for the tick messages.
Adds the trace_information structure which contains information about traces.
Updates trace_rt_stats to use both of these.

Replaced libtrace_t->joined internally with a state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    r82facc5 rb13b939  
    32373237          TRACE_OPTION_USE_DEDICATED_HASHER,
    32383238          TRACE_OPTION_USE_SLIDING_WINDOW_BUFFER,
    3239           TRACE_OPTION_TRACETIME
     3239
     3240          /**
     3241           * Delays packets so they are played back in trace-time rather than as fast
     3242           * as possible.
     3243           */
     3244          TRACE_OPTION_TRACETIME,
     3245
     3246          /**
     3247           * Specifies the interval between tick packets in milliseconds, if 0
     3248           * or less this is ignored.
     3249           */
     3250          TRACE_OPTION_TICK_INTERVAL
    32403251} trace_parallel_option_t;
    32413252
     
    32593270
    32603271enum hasher_types {
    3261         HASHER_BALANCE, /** Balance load across CPUs best as possible this is basically to say don't care about hash, but this might still might be implemented using a hash or round robin etc.. */
    3262         HASHER_BIDIRECTIONAL, /** Use a hash which is uni-directional for TCP flows (IP src dest,TCP port src dest), non TCP
    3263                                                         Will be sent to the same place, with the exception of UDP which may or may not be sent to separate cores */
    3264         HASHER_UNIDIRECTIONAL, /** Use a hash which is uni-directional across TCP flow */
    3265         HASHER_CUSTOM, /** Always use the user supplied hasher */
    3266         HASHER_HARDWARE, /** Set by the format if the hashing is going to be done in hardware */
     3272        /**
     3273         * Balance load across CPUs best as possible, this is basically to say do
     3274         * not care about hash. This might still might be implemented
     3275         * using a hash or round robin etc. under the hood depending on the format
     3276         */
     3277        HASHER_BALANCE,
     3278
     3279        /** Use a hash which is bi-directional for TCP flows, that is packets with
     3280         * the same hash are sent to the same thread. All non TCP packets will be
     3281         * sent to the same thread. UDP may or may not be sent to separate
     3282         * threads like TCP, this depends on the format support.
     3283         */
     3284        HASHER_BIDIRECTIONAL,
     3285       
     3286        /**
     3287         * Use a hash which is uni-directional across TCP flows, that means the
     3288         * opposite directions of the same 5 tuple might end up on separate cores.
     3289         * Otherwise is identical to HASHER_BIDIRECTIONAL
     3290         */
     3291        HASHER_UNIDIRECTIONAL,
     3292
     3293        /**
     3294         * Always use the user supplied hasher, this currently disables native
     3295         * support and is likely significantly slower.
     3296         */
     3297        HASHER_CUSTOM,
     3298
     3299        /**
     3300         * This is not a valid option, used internally only!!! TODO remove
     3301         * Set by the format if the hashing is going to be done in hardware
     3302         */
     3303        HASHER_HARDWARE
    32673304};
     3305
     3306typedef struct libtrace_info_t {
     3307        /**
     3308         * True if a live format (i.e. packets have to be tracetime).
     3309         * Otherwise false, indicating packets can be read as fast
     3310         * as possible from the format.
     3311         */
     3312        bool live;
     3313
     3314        /**
     3315         * The maximum number of threads supported by a parallel trace. 1
     3316         * if parallel support is not native (in this case libtrace will simulate
     3317         * an unlimited number of threads), -1 means unlimited and 0 unknown.
     3318         */
     3319        int max_threads;
     3320
     3321        /* TODO hash fn supported list */
     3322
     3323        /* TODO consider time/clock details?? */
     3324} libtrace_info_t;
    32683325
    32693326DLLEXPORT int trace_parallel_config(libtrace_t *libtrace, trace_parallel_option_t option, void *value);
    32703327DLLEXPORT libtrace_packet_t* trace_result_packet(libtrace_t * libtrace, libtrace_packet_t * packet);
    32713328DLLEXPORT void trace_free_result_packet(libtrace_t * libtrace, libtrace_packet_t * packet);
    3272 enum hasher_types;
    32733329DLLEXPORT int trace_set_hasher(libtrace_t *trace, enum hasher_types type, fn_hasher hasher, void *data);
     3330DLLEXPORT libtrace_info_t *trace_get_information(libtrace_t * libtrace);
    32743331
    32753332#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.