WAND Trace processing  4.0.5
libtrace_combine Struct Reference

The methods we use to combine the results from multiple processing threads into a single output. More...

Collaboration diagram for libtrace_combine:

Data Fields

int(* initialise )(libtrace_t *, libtrace_combine_t *)
 Called at the start of the trace to allow data-structures to be initialised and allow functions to be swapped if appropriate. More...
 
void(* destroy )(libtrace_t *, libtrace_combine_t *)
 Called when the trace ends, clean up any memory allocated by the initialise function. More...
 
void(* publish )(libtrace_t *, int thread_id, libtrace_combine_t *, libtrace_result_t *)
 Receive a result from a processing thread. More...
 
void(* read )(libtrace_t *, libtrace_combine_t *)
 Read as many results as possible from the trace. More...
 
void(* read_final )(libtrace_t *, libtrace_combine_t *)
 Called when the trace is finished to flush the final results to the reporter thread. More...
 
void(* pause )(libtrace_t *, libtrace_combine_t *)
 Pause must make sure any queued results that contain packets are safe. More...
 
void * queues
 Data storage for all the combiner threads. More...
 
uint64_t last_count_tick
 The last counter tick that we saw, so we can avoid duplicating any ticks that are published. More...
 
uint64_t last_ts_tick
 The last timestamp tick that we saw, so we can avoid duplicating any ticks that are published. More...
 
libtrace_generic_t configuration
 Configuration options, what this does is up to the combiner chosen. More...
 

Detailed Description

The methods we use to combine the results from multiple processing threads into a single output.

Users can write their own combiners, but we strongly recommend that you use one of the provided combiners.

Field Documentation

libtrace_generic_t libtrace_combine::configuration

Configuration options, what this does is up to the combiner chosen.

Referenced by trace_set_combiner().

void(* libtrace_combine::destroy)(libtrace_t *, libtrace_combine_t *)

Called when the trace ends, clean up any memory allocated by the initialise function.

Referenced by trace_destroy().

int(* libtrace_combine::initialise)(libtrace_t *, libtrace_combine_t *)

Called at the start of the trace to allow data-structures to be initialised and allow functions to be swapped if appropriate.

Also factors such as whether the trace is live or not can be used to determine the functions used.

Returns
0 if successful, -1 if an error occurs

Referenced by trace_pstart().

uint64_t libtrace_combine::last_count_tick

The last counter tick that we saw, so we can avoid duplicating any ticks that are published.

uint64_t libtrace_combine::last_ts_tick

The last timestamp tick that we saw, so we can avoid duplicating any ticks that are published.

void(* libtrace_combine::pause)(libtrace_t *, libtrace_combine_t *)

Pause must make sure any queued results that contain packets are safe.

See libtrace_make_result_safe() for more details on what it means for a result to be safe. This function should be NULL if publish is NULL.

Referenced by trace_ppause().

void(* libtrace_combine::publish)(libtrace_t *, int thread_id, libtrace_combine_t *, libtrace_result_t *)

Receive a result from a processing thread.

Most implementations of this function will push the result into an appropriate queue. If this is NULL, the result will automatically be pushed to the reporter thread.

Referenced by trace_publish_result().

void* libtrace_combine::queues

Data storage for all the combiner threads.

void(* libtrace_combine::read)(libtrace_t *, libtrace_combine_t *)

Read as many results as possible from the trace.

Each result that is read should cause a MESSAGE_RESULT to be sent to the reporter thread.

THIS SHOULD BE NON-BLOCKING AND READ AS MANY AS POSSIBLE! If publish is NULL, this probably should be NULL as it will not be called in that case.

void(* libtrace_combine::read_final)(libtrace_t *, libtrace_combine_t *)

Called when the trace is finished to flush the final results to the reporter thread.

Any leftover results should cause a MESSAGE_RESULT to be sent to the reporter thread.

There may be no results, in which case this function should just return.

Libtrace state: This function will be called from the reporter thread. No processing threads will be running, i.e. you can assume that publish will not be called again.

If publish is NULL, this probably should be NULL as it will not be called in that case.


The documentation for this struct was generated from the following file: