Changeset 59ef093 for lib


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

Location:
lib
Files:
2 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        }
Note: See TracChangeset for help on using the changeset viewer.