4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since 5ba34eb was
fac8c46,
checked in by Richard Sanger <rsangerarj@…>, 8 years ago
|
Tidies up the pausing so that it now works as expected and a trace can easily be paused and restarted.
Ensures that packets will not be lost if pause is called on a file, any queued packets will be read (a message is sent allowing the user to drop these packets if they are unwanted).
Differentiates packets from other results in the queues to the reducer/reporter and makes a copy of the packets in result queues when pausing
- this is needed to ensure that bad memory isn't referenced if a zero-copy trace is paused by closing sockets/associated data like in the case of ring:.
Fixed up the re-starting of traces which hadn't been finished to account for different configurations.
Adds a 'state' to libtrace to handle the state of parallel traces, rather than hacking around the existing 'started' boolean. Also provides two levels of checks for consistency if the trace is using existing that are checking started.
Various other bug fixes and tidy ups.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | #include <pthread.h> |
---|
2 | #include "../libtrace.h" |
---|
3 | |
---|
4 | #ifndef LIBTRACE_DEQUE_H |
---|
5 | #define LIBTRACE_DEQUE_H |
---|
6 | |
---|
7 | typedef struct list_node list_node_t; |
---|
8 | typedef void (*deque_data_fn)(void *data); |
---|
9 | typedef struct libtrace_queue { |
---|
10 | list_node_t * head; |
---|
11 | list_node_t * tail; |
---|
12 | pthread_mutex_t lock; |
---|
13 | size_t size; |
---|
14 | size_t element_size; |
---|
15 | } libtrace_queue_t; |
---|
16 | |
---|
17 | DLLEXPORT void libtrace_deque_init(libtrace_queue_t * q, size_t element_size); |
---|
18 | DLLEXPORT void libtrace_deque_push_back(libtrace_queue_t *q, void *d); |
---|
19 | DLLEXPORT void libtrace_deque_push_front(libtrace_queue_t *q, void *d); |
---|
20 | DLLEXPORT size_t libtrace_deque_get_size(libtrace_queue_t *q); |
---|
21 | |
---|
22 | DLLEXPORT int libtrace_deque_peek_front(libtrace_queue_t *q, void *d); |
---|
23 | DLLEXPORT int libtrace_deque_peek_tail(libtrace_queue_t *q, void *d); |
---|
24 | DLLEXPORT int libtrace_deque_pop_front(libtrace_queue_t *q, void *d); |
---|
25 | DLLEXPORT int libtrace_deque_pop_tail(libtrace_queue_t *q, void *d); |
---|
26 | DLLEXPORT void libtrace_zero_deque(libtrace_queue_t *q); |
---|
27 | |
---|
28 | // Apply a given function to every data item, while keeping the entire |
---|
29 | // structure locked from external modifications |
---|
30 | DLLEXPORT void libtrace_deque_apply_function(libtrace_queue_t *q, deque_data_fn fn); |
---|
31 | |
---|
32 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.