Changeset d6a56b6


Ignore:
Timestamp:
03/31/14 00:17:45 (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:
fb1fd42
Parents:
29ba7c2
Message:

Move the data structures out of the way and into there own folder and tidy file naming.

Files:
6 edited
10 moved

Legend:

Unmodified
Added
Removed
  • lib/Makefile.am

    r29bbef0 rd6a56b6  
    5353                $(BPFJITSOURCE) \
    5454                libtrace_arphrd.h \
    55                 trace_ringbuffer.c trace_vector.c libtrace_message_queue.c deque.c trace_sliding_window.c hash_toeplitz.c
     55                data-struct/ring_buffer.c data-struct/vector.c data-struct/message_queue.c \
     56                data-struct/deque.c data-struct/sliding_window.c \
     57                hash_toeplitz.c
    5658
    5759if DAG2_4
  • lib/data-struct/deque.c

    r29bbef0 rd6a56b6  
    11#include "deque.h"
     2
    23#include <assert.h>
    34#include <stddef.h>
  • lib/data-struct/deque.h

    r29bbef0 rd6a56b6  
    11#include <pthread.h>
    22
    3 #ifndef DEQUE_H
    4 #define DEQUE_H
     3#ifndef LIBTRACE_DEQUE_H
     4#define LIBTRACE_DEQUE_H
    55
    66typedef struct list_node list_node_t;
  • lib/data-struct/message_queue.c

    r29bbef0 rd6a56b6  
     1#include "message_queue.h"
     2
    13#include <unistd.h>
    24#include <stdio.h>
    3 #include "libtrace_message_queue.h"
    45#include <limits.h>
    56
  • lib/data-struct/message_queue.h

    r29bbef0 rd6a56b6  
    11#include <pthread.h>
    2 #include <assert.h>
    32#include <limits.h>
    43
     
    98typedef struct libtrace_thread_t libtrace_thread_t;
    109typedef struct libtrace_message_queue_t {
    11                 int pipefd[2];
    12                 volatile int message_count;
    13                 size_t message_len;
    14                 pthread_spinlock_t spin;
     10        int pipefd[2];
     11        volatile int message_count;
     12        size_t message_len;
     13        pthread_spinlock_t spin;
    1514} libtrace_message_queue_t;
    1615
     
    2928inline int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq);
    3029
    31 enum libtrace_messages {
    32         MESSAGE_STARTED,
    33         MESSAGE_PAUSE,
    34         MESSAGE_STOP,
    35         MESSAGE_STOPPED,
    36         MESSAGE_FIRST_PACKET,
    37         MESSAGE_MAPPER_ENDED,
    38         MESSAGE_MAPPER_RESUMED,
    39         MESSAGE_MAPPER_PAUSED,
    40         MESSAGE_MAPPER_EOF,
    41         MESSAGE_POST_REDUCE,
    42         MESSAGE_POST_RANGE,
    43         MESSAGE_USER
    44 };
    4530#endif
  • lib/data-struct/ring_buffer.c

    r29ba7c2 rd6a56b6  
    33 */
    44
    5 #include "trace_ringbuffer.h"
     5#include "ring_buffer.h"
     6
    67#include <stdlib.h>
    78#include <assert.h>
  • lib/data-struct/ring_buffer.h

    r29bbef0 rd6a56b6  
    22#include <semaphore.h>
    33
    4 #ifndef TRACE_RINGBUFFER_H
    5 #define TRACE_RINGBUFFER_H
     4#ifndef LIBTRACE_RINGBUFFER_H
     5#define LIBTRACE_RINGBUFFER_H
    66
    77#define LIBTRACE_RINGBUFFER_BLOCKING 0
  • lib/data-struct/sliding_window.c

    r29bbef0 rd6a56b6  
    1 #include "trace_sliding_window.h"
     1#include "sliding_window.h"
     2
    23#include <stdlib.h>
    34#include <assert.h>
  • lib/data-struct/sliding_window.h

    r29bbef0 rd6a56b6  
    1 #include <pthread.h>
    2 #include <semaphore.h>
    31#include <stdint.h>
    42
    5 #ifndef TRACE_SLIDING_WINDOW_H
    6 #define TRACE_SLIDING_WINDOW_H
     3#ifndef LIBTRACE_SLIDING_WINDOW_H
     4#define LIBTRACE_SLIDING_WINDOW_H
    75
    86#define LIBTRACE_SLIDING_WINDOW_BLOCKING 0
  • lib/data-struct/vector.c

    r29bbef0 rd6a56b6  
    1 #include "trace_vector.h"
     1#include "vector.h"
     2
    23#include <stdlib.h>
    34#include <string.h>
  • lib/data-struct/vector.h

    r29bbef0 rd6a56b6  
    11#include <pthread.h>
    2 #include "libtrace_int.h"
     2/* Need libtrace.h for DLLEXPORT defines */
     3#include "../libtrace.h"
    34
    4 #ifndef TRACE_VECTOR_H
    5 #define TRACE_VECTOR_H
     5#ifndef LIBTRACE_VECTOR_H
     6#define LIBTRACE_VECTOR_H
    67
    78typedef struct libtrace_vector {
  • lib/libtrace.h.in

    r29bbef0 rd6a56b6  
    32163216} trace_parallel_option_t;
    32173217
     3218enum libtrace_messages {
     3219        MESSAGE_STARTED,
     3220        MESSAGE_PAUSE,
     3221        MESSAGE_STOP,
     3222        MESSAGE_STOPPED,
     3223        MESSAGE_FIRST_PACKET,
     3224        MESSAGE_MAPPER_ENDED,
     3225        MESSAGE_MAPPER_RESUMED,
     3226        MESSAGE_MAPPER_PAUSED,
     3227        MESSAGE_MAPPER_EOF,
     3228        MESSAGE_POST_REDUCE,
     3229        MESSAGE_POST_RANGE,
     3230        MESSAGE_USER
     3231};
     3232
    32183233DLLEXPORT int trace_parallel_config(libtrace_t *libtrace, trace_parallel_option_t option, void *value);
    32193234DLLEXPORT libtrace_packet_t* trace_result_packet(libtrace_t * libtrace, libtrace_packet_t * packet);
  • lib/libtrace_int.h

    r29bbef0 rd6a56b6  
    147147#include "bpf-jit/bpf-jit.h"
    148148#endif
     149
     150#include "data-struct/ring_buffer.h"
     151#include "data-struct/vector.h"
     152#include "data-struct/message_queue.h"
     153#include "data-struct/deque.h"
     154#include "data-struct/sliding_window.h"
    149155
    150156//#define RP_BUFSIZE 65536U
     
    201207
    202208#define MAPPER_USE_SLIDING_WINDOW 0x20
    203 
    204 
    205 #include "trace_ringbuffer.h"
    206 #include "trace_vector.h"
    207 #include "libtrace_message_queue.h"
    208 #include "deque.h"
    209 #include "trace_sliding_window.h"
    210209
    211210/**
  • tools/traceanon/traceanon_parallel.c

    r29bbef0 rd6a56b6  
    99#include <string.h>
    1010#include <time.h>
     11#include <assert.h>
    1112#include "ipenc.h"
    12 #include <trace_vector.h>
     13#include <data-struct/vector.h>
     14#include <data-struct/message_queue.h>
    1315
    1416bool enc_source = false;
  • tools/tracertstats/tracertstats_parallel.c

    r29bbef0 rd6a56b6  
    5757#include "dagformat.h"
    5858
    59 #include "trace_vector.h"
     59#include "data-struct/vector.h"
     60#include "data-struct/message_queue.h"
    6061
    6162#ifndef UINT32_MAX
  • tools/tracestats/tracestats_parallel.c

    r29bbef0 rd6a56b6  
    5555#include "libtrace.h"
    5656#include "lt_inttypes.h"
    57 #include "trace_vector.h"
     57#include "data-struct/vector.h"
     58#include "data-struct/message_queue.h"
    5859#include <pthread.h>
    5960
Note: See TracChangeset for help on using the changeset viewer.