Changeset 59ef093


Ignore:
Timestamp:
06/25/14 02:04:40 (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:
3296252
Parents:
a360b61
Message:

Adds more tests

  • Test hashing function is used
  • Test single threaded path works
  • Stress test with 100 threads
  • Test hash+singlethreaded works

Additionally fixes some bugs/compile warnings and removes some verbose debug printing

Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • lib/hash_toeplitz.c

    r5ba34eb r59ef093  
    1010#include <stdlib.h>
    1111#include <time.h>
    12 
     12#include <stdio.h>
     13 
    1314static inline uint8_t get_bit(uint8_t byte, size_t num) {
    1415        return byte & (0x80>>num);
  • lib/trace_parallel.c

    r9594cf9 r59ef093  
    222222 */
    223223static void trace_thread_pause(libtrace_t *trace) {
    224         printf("Pausing thread #%d\n", get_thread_table_num(trace));
     224        //printf("Pausing thread #%d\n", get_thread_table_num(trace));
    225225        trace_make_results_packets_safe(trace);
    226226        assert(pthread_mutex_lock(&trace->libtrace_lock) == 0);
     
    233233        pthread_cond_broadcast(&trace->perpkt_cond);
    234234        assert(pthread_mutex_unlock(&trace->libtrace_lock) == 0);
    235         printf("Releasing thread #%d\n", get_thread_table_num(trace));
     235        //printf("Releasing thread #%d\n", get_thread_table_num(trace));
    236236}
    237237
     
    10681068                /* We don't care about which core a packet goes to */
    10691069                ret = trace_pread_packet_first_in_first_served(libtrace, packet);
    1070         } /* else if (libtrace->reducer_flags & PERPKT_USE_SLIDING_WINDOW) {
    1071                 ret = trace_pread_packet_sliding_window(libtrace, packet);
    1072         } else {
     1070        } /* else {
    10731071                ret = trace_pread_packet_hash_locked(libtrace, packet);
    10741072        }*/
     
    11651163                fprintf(stderr, "WARNING deadlocks may occur and extra memory allocating buffer sizes (packet_freelist_size) mismatched\n");
    11661164
    1167         libtrace->started=true; // Before we start the threads otherwise we could have issues
     1165        libtrace->started = true; // Before we start the threads otherwise we could have issues
    11681166        libtrace->state = STATE_RUNNING;
    11691167        /* Disable signals - Pthread signal handling */
     
    15031501                fprintf(stderr, "Waiting to join with the hasher\n");
    15041502                pthread_join(libtrace->hasher_thread.tid, NULL);
    1505                 fprintf(stderr, "Joined with with the hasher\n");
     1503                fprintf(stderr, "Joined with the hasher\n");
    15061504                libtrace->hasher_thread.state = THREAD_FINISHED;
    15071505        }
  • test/Makefile

    r014f733 r59ef093  
    1111LDLIBS = -L$(PREFIX)/lib/.libs -L$(PREFIX)/libpacketdump/.libs -ltrace -lpacketdump
    1212
    13 BINS_DATASTRUCT = test-datastruct-vector test-datastruct-deque test-datastruct-ringbuffer
     13BINS_DATASTRUCT = test-datastruct-vector test-datastruct-deque \
     14        test-datastruct-ringbuffer
     15BINS_PARALLEL = test-format-parallel test-format-parallel-hasher \
     16        test-format-parallel-singlethreaded test-format-parallel-stressthreads \
     17        test-format-parallel-singlethreaded-hasher
    1418
    1519BINS = test-pcap-bpf test-event test-time test-dir test-wireless test-errors \
    16         test-plen test-autodetect $(BINS_DATASTRUCT)
     20        test-plen test-autodetect $(BINS_DATASTRUCT) $(BINS_PARALLEL)
    1721
    1822.PHONY: all clean distclean install depend test
    1923
    20 all: $(BINS) test-drops test-format test-format-parallel test-decode test-decode2 test-write test-convert test-convert2
     24all: $(BINS) test-drops test-format test-decode test-decode2 test-write test-convert test-convert2
    2125
    2226clean:
    23         $(RM) $(BINS) $(OBJS) test-format test-format-parallel test-decode test-convert \
     27        $(RM) $(BINS) $(OBJS) test-format test-decode test-convert \
    2428        test-decode2 test-write test-drops test-convert2
    2529
    2630distclean:
    27         $(RM) $(BINS) $(OBJS) test-format test-format-parallel test-decode test-convert test-drops test-convert2
     31        $(RM) $(BINS) $(OBJS) test-format test-decode test-convert test-drops test-convert2
    2832
    2933install:
  • test/do-tests-parallel.sh

    r014f733 r59ef093  
    2020echo \* Read erf
    2121do_test ./test-format-parallel erf
    22 do_test ./test-decode erf
    2322
    2423echo \* Read pcap
    2524do_test ./test-format-parallel pcap
    26 do_test ./test-decode pcap
    2725
    2826echo \* Read pcapfile
    2927do_test ./test-format-parallel pcapfile
    30 do_test ./test-decode pcapfile
    3128
    3229echo \* Read pcapfilens
    3330do_test ./test-format-parallel pcapfilens
    34 do_test ./test-decode pcapfilens
    3531
    3632echo \* Read legacyatm
    3733do_test ./test-format-parallel legacyatm
    38 do_test ./test-decode legacyatm
    3934
    4035echo \* Read legacyeth
    4136do_test ./test-format-parallel legacyeth
    42 do_test ./test-decode legacyeth
    4337
    4438echo \* Read legacypos
    4539do_test ./test-format-parallel legacypos
    46 do_test ./test-decode legacypos
    4740
    4841echo \* Read tsh
    4942do_test ./test-format-parallel tsh
    50 do_test ./test-decode tsh
    5143
    5244echo \* Read rawerf
    5345do_test ./test-format-parallel rawerf
    54 do_test ./test-decode rawerf
    5546
     47echo \* Read testing hasher function
     48do_test ./test-format-parallel-hasher erf
     49
     50echo \* Read testing single-threaded datapath
     51do_test ./test-format-parallel-singlethreaded erf
     52
     53echo \* Read testing single-threaded hasher datapath
     54do_test ./test-format-parallel-singlethreaded-hasher erf
     55
     56echo \* Read stress testing with 100 threads
     57do_test ./test-format-parallel-stressthreads erf
    5658
    5759echo
  • test/test-format-parallel.c

    r014f733 r59ef093  
    115115
    116116        if (pkt) {
    117                 int a,*b,c;
     117                int a,*b,c=0;
    118118                assert(tls != NULL);
    119119                assert(!seen_stop_message);
Note: See TracChangeset for help on using the changeset viewer.