Changeset 5b4d121 for lib/libtrace.h.in


Ignore:
Timestamp:
08/19/14 13:59:33 (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:
f0e8bd6
Parents:
957a72a
Message:

Adds a configuration parser to make it easy to change the parallel configuration.
Adds more configuration options (Tidies some verbose debugging output).
Implements tick packets for the hasher thread case.
Some other minor bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    rf051c1b r5b4d121  
    32883288           * or less this is ignored.
    32893289           */
    3290           TRACE_OPTION_TICK_INTERVAL
     3290          TRACE_OPTION_TICK_INTERVAL,
     3291        TRACE_OPTION_GET_CONFIG,
     3292        TRACE_OPTION_SET_CONFIG
    32913293} trace_parallel_option_t;
    32923294
     
    33823384         * A unblockable error message will be printed.
    33833385         */
    3384         size_t packet_global_cache_size;
    3385         // Per thread
     3386        size_t packet_cache_size;
     3387        /**
     3388         * Per thread local cache size for the packet freelist
     3389         */
    33863390        size_t packet_thread_cache_size;
    3387         // Packet count limited
     3391        /**
     3392         * If true the total number of packets that can be created by a trace is limited
     3393         * to the packet_cache_size, otherwise once packet_cache_size is exceeded alloc
     3394         * and free will be used to create and free packets, this will be slower than
     3395         * using the freelist and could run a machine out of memory.
     3396         *
     3397         * However this does make it easier to ensure that deadlocks will not occur
     3398         * due to running out of packets
     3399         */
    33883400        bool fixed_packet_count;
    3389         // Bursts/Batches of packets this size are combined, used in single thread mode
     3401        /**
     3402         * When reading from a single threaded input source to reduce
     3403         * lock contention a 'burst' of packets is read per pkt thread
     3404         * this determines the bursts size.
     3405         */
    33903406        size_t burst_size;
    33913407        // Each perpkt thread has a queue leading into the reporter
    33923408        //size_t reporter_queue_size;
    3393         /** The tick interval - in milliseconds (0) */
     3409
     3410        /**
     3411         * The tick interval - in milliseconds
     3412         * When a live trace is used messages are sent at the tick
     3413         * interval to ensure that all perpkt threads receive data
     3414         * this allows results to be printed in cases flows are
     3415         * not being directed to a certian thread, while still
     3416         * maintaining order.
     3417         */
    33943418        size_t tick_interval;
    3395         // The tick interval for file based traces, in number of packets TODO implement this
     3419
     3420        /**
     3421         * Like the tick interval but used in the case of file format
     3422         * This specifies the number of packets before inserting a tick to
     3423         * every thread.
     3424         */
    33963425        size_t tick_count;
    33973426
    3398         // The number of per packet threads requested
     3427        /**
     3428         * The number of per packet threads requested, 0 means use default.
     3429         * Default typically be the number of processor threads detected less one or two.
     3430         */
    33993431        size_t perpkt_threads;
    34003432
     
    34093441        size_t hasher_queue_size;
    34103442
    3411         // Reporter threashold before results are sent
     3443        /**
     3444         * If true use a polling hasher queue, that means that we will spin/or yeild
     3445         * when rather than blocking on a lock. This applies to both the hasher thread
     3446         * and perpkts reading the queues.
     3447         */
     3448        bool hasher_polling;
     3449
     3450        /**
     3451         * If true the reporter thread will continuously poll waiting for results
     3452         * if false they are only checked when a message is received, this message
     3453         * is controlled by reporter_thold.
     3454         */
     3455        bool reporter_polling;
     3456
     3457        /**
     3458         * Perpkt thread result queue size before triggering the reporter step to read results
     3459         */
    34123460        size_t reporter_thold;
     3461
     3462        /**
     3463         * Prints a line to standard error for every state change
     3464         * for both the trace as a whole and for each thread.
     3465         */
     3466        bool debug_state;
    34133467};
     3468#include <stdio.h>
     3469DLLEXPORT void parse_user_config(struct user_configuration* uc, char * str);
     3470DLLEXPORT void parse_user_config_file(struct user_configuration* uc, FILE *file);
     3471
     3472#define READ_EOF 0
     3473#define READ_ERROR -1
     3474#define READ_MESSAGE -2
     3475// Used for inband tick message
     3476#define READ_TICK -3
    34143477
    34153478#define ZERO_USER_CONFIG(config) memset(&config, 0, sizeof(struct user_configuration));
Note: See TracChangeset for help on using the changeset viewer.