Ignore:
Timestamp:
03/23/15 17:52:17 (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:
773d5e2
Parents:
963b13b
Message:

Removes pconfig_input() and replaces trace_config() with trace_set_<option>

  • Removes trace_pconfig completely - only trace_set_hasher is left now in trace_config
  • Rework user configuration so this is no longer modified directly. Now we just apply it directly to a trace.
  • Many minor documentation fixes and additions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_parallel.h

    r1407294 r6b98325  
    8585        size_t size;
    8686
    87         /* C basic types - we cannot be certian of the size */
     87        /* C basic types - we cannot be certain of the size */
    8888        int sint;
    8989        unsigned int uint;
     
    112112        int type;
    113113};
    114 
    115 typedef enum {
    116         /**
    117          * Sets the hasher function, if NULL(default) no hashing is used a
    118          * cores will get packets on a first in first served basis
    119          */
    120         TRACE_OPTION_SET_HASHER,
    121 
    122         /**
    123          * Libtrace set perpkt thread count
    124          */
    125         TRACE_OPTION_SET_PERPKT_THREAD_COUNT,
    126 
    127         /**
    128          * Delays packets so they are played back in trace-time rather than as fast
    129          * as possible.
    130          */
    131         TRACE_OPTION_TRACETIME,
    132 
    133         /**
    134          * Specifies the interval between tick packets in milliseconds, if 0
    135          * or less this is ignored.
    136          */
    137         TRACE_OPTION_TICK_INTERVAL,
    138         TRACE_OPTION_GET_CONFIG,
    139         TRACE_OPTION_SET_CONFIG
    140 } trace_parallel_option_t;
    141114
    142115/** The libtrace_messages enum
     
    256229        MESSAGE_POST_REPORTER,
    257230
    258         /** Sent to per-packet threads perodically after the configured time
     231        /** Sent to per-packet threads periodically after the configured time
    259232         * interval has passed.
    260233         *
    261234         * This is sent out-of-band with respect to packets and as a result
    262          * can appear after a packet with an later timestamp, or before one
    263          * with an earlier timestamp.
    264          *
    265          * @param data data.uint64_t holds the system timestamp in the
     235         * can appear after a packet with an later time-stamp, or before one
     236         * with an earlier time-stamp.
     237         *
     238         * @param data data.uint64_t holds the system time-stamp in the
    266239         * erf format
    267240         * @param sender should be ignored
     
    280253        MESSAGE_TICK_COUNT,
    281254
    282         /** For specific user defined messages use codes above MESSAGE_USER. */
     255        /** For specific user defined messages use codes of MESSAGE_USER or above. */
    283256        MESSAGE_USER = 1000
    284257};
    285258
    286 /** The hasher types avaliable to libtrace application.
     259/** The hasher types available to libtrace application.
    287260 * These can be selected using trace_set_hasher().
    288261 */
     
    321294typedef struct libtrace_info_t {
    322295        /**
    323          * True if a live format (i.e. packets have to be tracetime).
     296         * True if a live format (i.e. packets have to be trace-time).
    324297         * Otherwise false, indicating packets can be read as fast
    325298         * as possible from the format.
     
    339312} libtrace_info_t;
    340313
    341 
    342 /**
    343  * Tuning the parallel sizes
    344  */
    345 struct user_configuration {
    346         // Packet memory cache settings (ocache_init) total
    347         /**
    348          * See diagrams, this sets the maximum size of freelist used to
    349          * maintain packets and their memory buffers.
    350          * NOTE setting this to less than recommend could cause deadlock a
    351          * trace that manages its own packets.
    352          * A unblockable error message will be printed.
    353          */
    354         size_t packet_cache_size;
    355         /**
    356          * Per thread local cache size for the packet freelist
    357          */
    358         size_t packet_thread_cache_size;
    359         /**
    360          * If true the total number of packets that can be created by a trace is limited
    361          * to the packet_cache_size, otherwise once packet_cache_size is exceeded alloc
    362          * and free will be used to create and free packets, this will be slower than
    363          * using the freelist and could run a machine out of memory.
    364          *
    365          * However this does make it easier to ensure that deadlocks will not occur
    366          * due to running out of packets
    367          */
    368         bool fixed_packet_count;
    369         /**
    370          * When reading from a single threaded input source to reduce
    371          * lock contention a 'burst' of packets is read per pkt thread
    372          * this determines the bursts size.
    373          */
    374         size_t burst_size;
    375         // Each perpkt thread has a queue leading into the reporter
    376         //size_t reporter_queue_size;
    377 
    378         /**
    379          * The tick interval - in milliseconds
    380          * When a live trace is used messages are sent at the tick
    381          * interval to ensure that all perpkt threads receive data
    382          * this allows results to be printed in cases flows are
    383          * not being directed to a certian thread, while still
    384          * maintaining order.
    385          */
    386         size_t tick_interval;
    387 
    388         /**
    389          * Like the tick interval but used in the case of file format
    390          * This specifies the number of packets before inserting a tick to
    391          * every thread.
    392          */
    393         size_t tick_count;
    394 
    395         /**
    396          * The number of per packet threads requested, 0 means use default.
    397          * Default typically be the number of processor threads detected less one or two.
    398          */
    399         size_t perpkt_threads;
    400 
    401         /**
    402          * See diagrams, this sets the maximum size of buffers used between
    403          * the single hasher thread and the buffer.
    404          * NOTE setting this to less than recommend could cause deadlock a
    405          * trace that manages its own packets.
    406          * A unblockable warning message will be printed to stderr in this case.
    407          */
    408         /** The number of packets that can queue per thread from hasher thread */
    409         size_t hasher_queue_size;
    410 
    411         /**
    412          * If true use a polling hasher queue, that means that we will spin/or yeild
    413          * when rather than blocking on a lock. This applies to both the hasher thread
    414          * and perpkts reading the queues.
    415          */
    416         bool hasher_polling;
    417 
    418         /**
    419          * If true the reporter thread will continuously poll waiting for results
    420          * if false they are only checked when a message is received, this message
    421          * is controlled by reporter_thold.
    422          */
    423         bool reporter_polling;
    424 
    425         /**
    426          * Perpkt thread result queue size before triggering the reporter step to read results
    427          */
    428         size_t reporter_thold;
    429 
    430         /**
    431          * Prints a line to standard error for every state change
    432          * for both the trace as a whole and for each thread.
    433          */
    434         bool debug_state;
    435 };
    436 
    437314/**
    438315 * The methods we use to combine multiple outputs into a single output
    439316 * This is not considered a stable API however is public.
    440  * Where possible use built in combiners
    441  *
    442  * NOTE this structure is duplicated per trace and as such can
     317 * Where possible use built in combiners.
     318 *
     319 * @note this structure is duplicated per trace and as such can
    443320 * have functions rewritten, and in fact should if possible.
    444321 */
     
    447324
    448325        /**
    449          * Called at the start of the trace to allow datastructures
    450          * to be initilised and allow functions to be swapped if approriate.
     326         * Called at the start of the trace to allow data-structures
     327         * to be initialised and allow functions to be swapped if appropriate.
    451328         *
    452329         * Also factors such as whether the trace is live or not can
     
    474351        /**
    475352         * Read as many results as possible from the trace.
    476          * Directy calls the users code to handle results from here.
     353         * Directly calls the users code to handle results from here.
    477354         *
    478355         * THIS SHOULD BE NON-BLOCKING AND READ AS MANY AS POSSIBLE
     
    512389
    513390        /**
    514          * Configuration options, what this does is upto the combiner
     391         * Configuration options, what this does is up to the combiner
    515392         * chosen.
    516393         */
     
    574451 *
    575452 * @param libtrace The input trace to start
    576  * @param global_blob Global data related to this trace accessable using trace_get_global()
     453 * @param global_blob Global data related to this trace accessible using trace_get_global()
    577454 * @param per_pkt A user supplied function called when a packet is ready
    578455 * @param reporter A user supplied function called when a result is ready.
    579456 * Optional if NULL the reporter thread will not be started.
    580  * @return 0 on success, otherwise -1 to indicate an error has occured
     457 * @return 0 on success, otherwise -1 to indicate an error has occurred
    581458 *
    582459 * This can also be used to restart an existing parallel trace,
     
    592469 *
    593470 * @param libtrace The parallel trace to be paused
    594  * @return 0 on success, otherwise -1 to indicate an error has occured
     471 * @return 0 on success, otherwise -1 to indicate an error has occurred
    595472 *
    596473 */
     
    598475
    599476/** Stops a parallel trace, causing all threads to exit as if an EOF
    600  * has occured. This replaces trace_interrupt(), allowing
     477 * has occurred. This replaces trace_interrupt(), allowing
    601478 * a specified trace to be stopped.
    602479 *
    603480 * @param libtrace The parallel trace to be stopped
    604  * @return 0 on success, otherwise -1 to indicate an error has occured
     481 * @return 0 on success, otherwise -1 to indicate an error has occurred
    605482 *
    606483 * This should only be called by the main thread.
     
    614491 *
    615492 * Waits for a trace to finish, whether this be due to
    616  * an error occuring, an EOF or trace_pstop.
     493 * an error occurring, an EOF or trace_pstop.
    617494 *
    618495 */
     
    622499 * @name User Data Storage
    623500 *
    624  * These method provide a way for users to store data agaist a trace or
     501 * These method provide a way for users to store data against a trace or
    625502 * a thread.
    626503 *
    627504 * Alternatively one could use global variables and thread local
    628  * storage (__thread), respectively, which in many cases could be simplier.
     505 * storage (__thread), respectively, which in many cases could be simpler.
    629506 *
    630507 * @note We do not lock on reads, instead we rely on the
     
    645522 *
    646523 * @param trace The parallel trace.
    647  * @param data The new value to save agaisnt the trace
     524 * @param data The new value to save against the trace
    648525 * @return The previously stored value
    649526 *
     
    666543 *
    667544 * @param The parallel trace.
    668  * @param data The new value to save agaisnt the trace
     545 * @param data The new value to save against the trace
    669546 * @return The previously stored value
    670547 *
    671  * This function is not thread-safe and is intented only to be
     548 * This function is not thread-safe and is intended only to be
    672549 * called on the currently running thread.
    673550 */
     
    675552
    676553/// @}
     554
     555
     556/**
     557 * @name Parallel Configuration
     558 *
     559 * These methods provide a way to configure the parallel libtrace library.
     560 *
     561 * Many of these options are typically unneeded by most applications as they
     562 * control tuning aspects of the library and are more useful to the
     563 * end user.
     564 *
     565 * To allow the end user to change this configuration libtrace will search for
     566 * three environment variables and apply them to the configuration in the
     567 * following order. Such that the first has the lowest priority.
     568 *
     569 * 1. LIBTRACE_CONF, The global environment configuration
     570 * 2. LIBTRACE_CONF_<FORMAT>, Applied to a given format
     571 * 3. LIBTRACE_CONF_<FORMAT_URI>, Applied the specified trace
     572 *
     573 * E.g.
     574 * - int:eth0 would match LIBTRACE_CONF, LIBTRACE_CONF_INT, LIBTRACE_CONF_INT_ETH0
     575 * - dag:/dev/dag0,0 would match LIBTRACE_CONF, LIBTRACE_CONF_DAG, LIBTRACE_CONF_DAG__DEV_DAG0_0
     576 * - test.erf would match LIBTRACE_CONF, LIBTRACE_CONF_ERF, LIBTRACE_CONF_ERF_TEST_ERF
     577 *
     578 * @note All environment variables names MUST only contain
     579 * [A-Z], [0-9] and [_] (underscore). Any characters
     580 * outside of this range should be capitalised if possible or replaced with an
     581 * underscore.
     582 * @{
     583 */
     584
     585/** Set the maximum number of perpkt threads to use in a trace.
     586 *
     587 * @param[in] trace The parallel input trace
     588 * @param[in] nb The number of threads to use. If 0 use default.
     589 * @return 0 if successful otherwise -1
     590 */
     591DLLEXPORT int trace_set_perpkt_threads(libtrace_t *trace, int nb);
     592
     593/** Set the interval between tick messages in milliseconds.
     594 *
     595 * @param[in] trace The parallel input trace
     596 * @param[in] interval The interval in milliseconds. If 0 this is disabled [default].
     597 * @return 0 if successful otherwise -1
     598 *
     599 * When a underlying parallel live trace is used MESSAGE_TICK_INTERVAL is sent
     600 * every tick interval to all per-packet threads to ensure data is received.
     601 * This allows results to be printed even in cases flows are not being directed
     602 * to a per-packet thread, while still maintaining order etc.
     603 *
     604 * @note Tick count is preferred over tick interval and will be used rather
     605 * than tick interval if possible.
     606 * @see MESSAGE_TICK_INTERVAL, trace_set_tick_count()
     607 */
     608DLLEXPORT int trace_set_tick_interval(libtrace_t *trace, size_t interval);
     609
     610/** Set the count between tick messages.
     611 *
     612 * @param[in] trace The parallel input trace
     613 * @param[in] count The tick count.  If 0 this is disabled [default].
     614 * @return 0 if successful otherwise -1
     615 *
     616 * When an underlying trace is accessed internally by libtrace in a
     617 * single-threaded manner MESSAGE_TICK_COUNT is sent to all per-packet threads
     618 * after every count packets have been seen in the trace. This allows results
     619 * to be printed even in cases flows are not being directed to a per-packet
     620 * thread, while still maintaining order etc.
     621 *
     622 * @see MESSAGE_TICK_COUNT, trace_set_tick_interval()
     623 */
     624DLLEXPORT int trace_set_tick_count(libtrace_t *trace, size_t count);
     625
     626/**
     627 * Delays packets so they are played back in trace-time rather than as fast
     628 * as possible (real-time).
     629 *
     630 * @param A parallel input trace
     631 * @param tracetime If true packets are released with time intervals matching
     632 * the original trace. Otherwise packets are read as fast as possible.
     633 * @return 0 if successful otherwise -1
     634 */
     635DLLEXPORT int trace_set_tracetime(libtrace_t *trace, bool tracetime);
     636
     637/** This sets the maximum size of the freelist used to store empty packets
     638 * and their memory buffers.
     639 *
     640 * @param trace A parallel input trace
     641 * @param size The number of empty packets to cache in memory. Set to the
     642 * default, 0, to autoconfigure this value.
     643 * @return 0 if successful otherwise -1
     644 *
     645 * Internally libtrace maintains a buffer of packet structures, this buffer
     646 * includes a cache per thread and a shared main pool. This configures
     647 * the size of the main pool. If an application is not passing packets
     648 * through to the reducer step --- that is to say returns packets from
     649 * the perpkt function --- this buffer will not need to be used.
     650 *
     651 * @note Setting this too low could cause performance issues or a deadlock. An
     652 * unblockable warning will be printed.
     653 *
     654 * @see trace_set_thread_cache_size(), trace_set_fixed_count()
     655 */
     656DLLEXPORT int trace_set_cache_size(libtrace_t *trace, size_t size);
     657
     658/** This sets the maximum size of the freelist thread cache's used to provide
     659 * faster access than the main shared pool.
     660 *
     661 * @param trace A parallel input trace
     662 * @param size The number of empty packets to cache in memory. Set to the
     663 * default, 0, to autoconfigure this value.
     664 * @return 0 if successful otherwise -1
     665 *
     666 * @see trace_set_cache_size(), trace_set_fixed_count()
     667 */
     668DLLEXPORT int trace_set_thread_cache_size(libtrace_t *trace, size_t size);
     669
     670/** If true the total number of packets that can be created by a trace is limited
     671 * to that set by trace_set_cache_size(), otherwise once exceeded malloc
     672 * and free will be used to create and free packets, this will be slower than
     673 * using the freelist and could run a machine out of memory.
     674 *
     675 * @param trace A parallel input trace
     676 * @param fixed If true the total number of packets is limited, otherwise
     677 * it is not. Defaults to false.
     678 * @return 0 if successful otherwise -1
     679 *
     680 * @see trace_set_thread_cache_size(), trace_set_cache_size()
     681 */
     682DLLEXPORT int trace_set_fixed_count(libtrace_t *trace, bool fixed);
     683
     684/** The number of packets to batch together for processing internally
     685 * by libtrace.
     686 *
     687 * @param trace A parallel input trace
     688 * @param size The total number of packets to batch together. Set to the
     689 * default, 0, to autoconfigure this value.
     690 * @return 0 if successful otherwise -1
     691 *
     692 * Internally libtrace will attempt to read up to this number of packets from
     693 * a format typically values of 10 will get good performance and increasing
     694 * beyond that will should little difference.
     695 *
     696 * @note We still pass a single packet at a time to the perpkt function
     697 */
     698DLLEXPORT int trace_set_burst_size(libtrace_t *trace, size_t size);
     699
     700/**
     701 * See diagrams, this sets the maximum size of buffers used between
     702 * the single hasher thread and the buffer.
     703 * NOTE setting this to less than recommend could cause deadlock a
     704 * trace that manages its own packets.
     705 * A unblockable warning message will be printed to stderr in this case.
     706 */
     707/** The number of packets that can queue per thread from hasher thread */
     708DLLEXPORT int trace_set_hasher_queue_size(libtrace_t *trace, size_t size);
     709
     710/** If true use a polling hasher queue, that means that we will spin/or yield
     711 * when data is not available rather than blocking on a condition.
     712 *
     713 * @param trace A parallel input trace
     714 * @param polling If true the hasher will poll waiting for data, otherwise
     715 * it is not. Defaults to false.
     716 *
     717 * We note this is likely to waste many CPU cycles and could even decrease
     718 * performance.
     719 *
     720 * @return 0 if successful otherwise -1
     721 */
     722DLLEXPORT int trace_set_hasher_polling(libtrace_t *trace, bool polling);
     723
     724/** If true the reporter thread will continuously poll waiting for results
     725 * if false they are only checked when a message is received, this message
     726 * is controlled by reporter_thold.
     727 *
     728 * @param trace A parallel input trace
     729 * @param polling If true the reporter will poll waiting for data, otherwise
     730 * it is not. Defaults to false.
     731 * @return 0 if successful otherwise -1
     732 *
     733 * We note this is likely to waste many CPU cycles and could even decrease
     734 * performance.
     735 *
     736 * @note This setting could be ignored by some reporters.
     737 */
     738DLLEXPORT int trace_set_reporter_polling(libtrace_t *trace, bool polling);
     739
     740/** Set the perpkt thread result queue size before triggering the reporter
     741 * to read results.
     742 *
     743 * @param trace A parallel input trace
     744 * @param thold The threshold on the number of results to enqueue before
     745 * notifying the reporter thread to read them.
     746 * @return 0 if successful otherwise -1
     747 *
     748 *
     749 * @note This setting is generally ignored if trace_set_reporter_polling() is
     750 * set however some combiner functions might ignore trace_set_reporter_polling()
     751 * and still require this to be set.
     752 * @see trace_publish_result(), trace_post_reporter()
     753 */
     754DLLEXPORT int trace_set_reporter_thold(libtrace_t *trace, size_t thold);
     755
     756/** Prints a line to standard error for every state change
     757 * for both the trace as a whole and for each thread.
     758 *
     759 * @param trace A parallel input trace
     760 * @param debug_state If true debug is printed. Defaults false.
     761 * @return 0 if successful otherwise -1.
     762 *
     763 */
     764DLLEXPORT int trace_set_debug_state(libtrace_t *trace, bool debug_state);
    677765
    678766/** Set the hasher function for a parallel trace.
     
    699787 * preferred over the default supplied by libtrace.
    700788 *
    701  * @note When supplying a hasher function it should be thread-safe as it could
     789 * @note When supplying a hasher function it should be thread-safe so it can
    702790 * be run in parallel by libtrace. Ideally this should rely upon no state, other
    703791 * than some form of seed value supplied in data.
    704792 */
    705 DLLEXPORT int trace_set_hasher(libtrace_t *trace, enum hasher_types type, fn_hasher hasher, void *data);
     793DLLEXPORT int trace_set_hasher(libtrace_t *trace, enum hasher_types type,
     794                               fn_hasher hasher, void *data);
     795
     796/// @}
     797
    706798
    707799/** Types of results.
     
    724816        /** The result is a tick message
    725817         *
    726          * @param key The erf timestamp of the tick
     818         * @param key The erf time-stamp of the tick
    727819         */
    728820        RESULT_TICK_INTERVAL,
     
    743835/** Publish a result for to the combiner destined for the reporter thread
    744836 *
    745  * @param libtrace[in] The parallel input trace
    746  * @param t[in] The current per-packet thread
    747  * @param key[in] The key of the result (used for sorting by the combiner)
    748  * @param value[in] The value of the result
    749  * @param type[in] The type of result see the documentation for the result_types enum
     837 * @param[in] libtrace The parallel input trace
     838 * @param[in] t The current per-packet thread
     839 * @param[in] key The key of the result (used for sorting by the combiner)
     840 * @param[in] value The value of the result
     841 * @param[in] type The type of result see the documentation for the result_types enum
    750842 */
    751843DLLEXPORT void trace_publish_result(libtrace_t *libtrace,
     
    797889 * @param[in] t The thread to check, if NULL the current thread will be used [Optional]
    798890 * @param[out] message A pointer to libtrace_message_t structure which will be
    799  * filled with the retrived message.
     891 * filled with the retrieved message.
    800892 *
    801893 * @return The number of messages remaining otherwise -1 upon error.
     
    814906 * @param[in] t The thread to check, if NULL the current thread will be used [Optional]
    815907 * @param[out] message A pointer to libtrace_message_t structure which will be
    816  * filled with the retrived message.
     908 * filled with the retrieved message.
    817909 *
    818910 * @return 0 if successful otherwise -1 upon error or if no packets were available.
     
    9231015 *
    9241016 * @param[in] libtrace the parallel input trace
    925  * @param[in] t Either a per packet thread or NULL to retrive the first packet
     1017 * @param[in] t Either a per packet thread or NULL to retrieve the first packet
    9261018 * of across all per packet threads.
    9271019 * @param[out] packet A pointer to the first packet in the trace. [Optional]
    928  * @param[out] tv The system timestamp when this packet was received. [Optional]
     1020 * @param[out] tv The system time-stamp when this packet was received. [Optional]
    9291021 * @return 1 if we are confident this is the first packet. Otherwise 0 if this
    9301022 * is a best guess (this is only possible int the case t=NULL)
     
    9401032                                     struct timeval **tv);
    9411033
    942 /** Makes a packet safe, a packet will become invaild after a
     1034/** Makes a packet safe, a packet will become invalid after a
    9431035 * pausing a trace.
    9441036 *
    945  * @param pkt[in,out] The packet to make safe
     1037 * @param[in,out] pkt The packet to make safe
    9461038 *
    9471039 * This copies a packet in such a way that it will be able to survive a pause.
     
    9531045/** Makes a result safe if a result contains a packet.
    9541046 *
    955  * @param res[in,out] The result to make safe.
     1047 * @param[in,out] res The result to make safe.
    9561048 *
    9571049 * This ensures the internal content of a result is safe to survive a pause.
     
    9601052DLLEXPORT void libtrace_make_result_safe(libtrace_result_t *res);
    9611053
    962 
    963 DLLEXPORT int trace_parallel_config(libtrace_t *libtrace, trace_parallel_option_t option, void *value);
    964 
    9651054/** In a parallel trace, free a packet back to libtrace.
    9661055 *
     
    9761065
    9771066DLLEXPORT libtrace_info_t *trace_get_information(libtrace_t * libtrace);
    978 DLLEXPORT void parse_user_config(struct user_configuration* uc, char * str);
    979 DLLEXPORT void parse_user_config_file(struct user_configuration* uc, FILE *file);
    980 DLLEXPORT int libtrace_get_perpkt_count(libtrace_t* t);
     1067
     1068/** Sets the configuration of a trace based upon a comma separated list of
     1069 * key value pairs.
     1070 *
     1071 * @param trace A parallel trace which is not running or destroyed
     1072 * @param str A comma separated list of key=value pairs.
     1073 * E.g. \em "burst_size=20,perpkt_threads=2,fixed_count=true"
     1074 * @return 0 if successful otherwise -1. If bad options are passed we will
     1075 * print the error to stderr but still return successful.
     1076 *
     1077 * List of keys:
     1078 * * \b cache_size,\b cs see trace_set_cache_size() [size_t]
     1079 * * \b thread_cache_size,\b tcs see trace_set_thread_cache_size() [size_t]
     1080 * * \b fixed_count,\b fc see trace_set_fixed_count() [bool]
     1081 * * \b burst_size,\b bs see trace_set_burst_size() [size_t]
     1082 * * \b tick_interval,\b ti see trace_set_tick_interval() [size_t]
     1083 * * \b tick_count,\b tc see trace_set_tick_count() [size_t]
     1084 * * \b perpkt_threads,\b pt see trace_set_perpkt_threads() [XXX TBA XXX]
     1085 * * \b hasher_queue_size,\b hqs see trace_set_hasher_queue_size() [size_t]
     1086 * * \b hasher_polling,\b hp see trace_set_hasher_polling() [bool]
     1087 * * \b reporter_polling,\b rp see trace_set_reporter_polling() [bool]
     1088 * * \b reporter_thold,\b rt see trace_set_reporter_thold() [size_t]
     1089 * * \b debug_state,\b ds see trace_set_debug_state() [bool]
     1090 *
     1091 * Booleans can be set as 0/1 or false/true.
     1092 *
     1093 * @note a environment variable interface is provided by default to users via
     1094 * LIBTRACE_CONFIG, see Parallel Configuration for more information.
     1095 *
     1096 * @note this interface is provided to allow a user to configure an application
     1097 * if a libtrace applicate wishes to configure a setting it should use a
     1098 * trace_set_*() function with the same name.
     1099 */
     1100DLLEXPORT int trace_set_configuration(libtrace_t *trace, const char * str);
     1101
     1102/** Sets configuration from a file. This reads every line from the file and
     1103 * interprets each line with trace_set_configuration().
     1104 *
     1105 * @param trace A parallel trace which is not running or destroyed
     1106 * @param file A file pointer which we read each line from
     1107 * @return 0 if successful otherwise -1. If bad options are passed we will
     1108 * print the error to stderr but still return successful.
     1109 *
     1110 * @note We do not close the file pointer upon completion
     1111 */
     1112DLLEXPORT int trace_set_configuration_file(libtrace_t *trace, FILE *file);
     1113
     1114DLLEXPORT int libtrace_get_perpkt_count(libtrace_t* t); // TODO MATCH WITH THE SET_PERPKT
    9811115
    9821116/**
     
    9921126DLLEXPORT void trace_set_combiner(libtrace_t *trace, const libtrace_combine_t *combiner, libtrace_generic_t config);
    9931127
    994 #define ZERO_USER_CONFIG(config) memset(&config, 0, sizeof(struct user_configuration));
    995 
    9961128#endif // LIBTRACE_PARALLEL_H
Note: See TracChangeset for help on using the changeset viewer.