Changeset d994324 for test


Ignore:
Timestamp:
09/17/14 13:45:29 (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:
9e429e8
Parents:
2498008
Message:

Remove anything to do with the combiner from set configuration and removes any options/storage related to these such as the next expected packet.

Instead this is done using trace_set_combiner now, and the for the built-in combiners.h header. This is a lot more flexible and allows the users to specify there own combiner, and any number of options for it.

Location:
test
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • test/test-format-parallel-hasher.c

    r2498008 rd994324  
    9191}
    9292
    93 
    9493struct TLS {
    9594        bool seen_start_message;
     
    106105        if (result) {
    107106                assert(libtrace_result_get_key(result) == 0);
    108                 printf("%d,", (int) libtrace_result_get_value(result));
     107                printf("%d,", libtrace_result_get_value(result).sint);
    109108                totalthreads++;
    110                 totalpkts += (int) libtrace_result_get_value(result);
    111                 assert(libtrace_result_get_value(result) == 25 ||
    112                         libtrace_result_get_value(result) == expected - 25);
     109                totalpkts += libtrace_result_get_value(result).sint;
     110                assert(libtrace_result_get_value(result).sint == 25 ||
     111                        libtrace_result_get_value(result).sint == expected - 25);
    113112        } else {
    114113                switch(mesg->code) {
     
    165164
    166165                        // All threads publish to verify the thread count
    167                         trace_publish_result(trace, t, (uint64_t) 0, (void *) tls->count, RESULT_NORMAL);
     166                        trace_publish_result(trace, t, (uint64_t) 0, (libtrace_generic_types_t){.sint=tls->count}, RESULT_NORMAL);
    168167                        trace_post_reporter(trace);
    169168                        free(tls);
  • test/test-format-parallel-reporter.c

    rf051c1b rd994324  
    5151#include "libtrace.h"
    5252#include "data-struct/vector.h"
     53#include "combiners.h"
    5354
    5455void iferr(libtrace_t *trace,const char *msg)
     
    9394int globalcount = 0;
    9495
    95 static void* reporter(libtrace_t *libtrace, libtrace_result_t *res, libtrace_message_t *mesg) {
     96static void reporter(libtrace_t *libtrace, libtrace_result_t *res, libtrace_message_t *mesg) {
    9697        static uint64_t last = -1;
    9798        static int pktcount = 0;
    9899        if (res) {
    99                 libtrace_packet_t *packet =  (libtrace_packet_t *) libtrace_result_get_value(res);
     100                libtrace_packet_t *packet = libtrace_result_get_value(res).pkt;
    100101                assert(libtrace_result_get_key(res) == trace_packet_get_order(packet));
    101102                if(last == (uint64_t)-1) {
     
    116117                }
    117118        }
    118         return NULL;
    119119}
    120120
     
    131131                }
    132132                x = c;
    133                 trace_publish_result(trace, t, trace_packet_get_order(pkt), pkt, RESULT_PACKET);
     133                trace_publish_result(trace, t, trace_packet_get_order(pkt), (libtrace_generic_types_t){.pkt=pkt}, RESULT_PACKET);
    134134                return NULL;
    135135        }
     
    160160        if (strcmp(argv[1],"rtclient")==0) expected=101;
    161161
    162         int i = 1;
    163         trace_parallel_config(trace, TRACE_OPTION_SEQUENTIAL, &i);
     162        trace_set_combiner(trace, &combiner_ordered, (libtrace_generic_types_t){0});
    164163
    165164        trace_pstart(trace, NULL, per_packet, reporter);
  • test/test-format-parallel-singlethreaded-hasher.c

    r2498008 rd994324  
    106106        if (result) {
    107107                assert(libtrace_result_get_key(result) == 0);
    108                 printf("%d,", (int) libtrace_result_get_value(result));
     108                printf("%d,", libtrace_result_get_value(result).sint);
    109109                totalthreads++;
    110                 totalpkts += (int) libtrace_result_get_value(result);
     110                totalpkts += libtrace_result_get_value(result).sint;
    111111        } else {
    112112                switch(mesg->code) {
     
    163163
    164164                        // All threads publish to verify the thread count
    165                         trace_publish_result(trace, t, (uint64_t) 0, (void *) tls->count, RESULT_NORMAL);
     165                        trace_publish_result(trace, t, (uint64_t) 0, (libtrace_generic_types_t){.sint=tls->count}, RESULT_NORMAL);
    166166                        trace_post_reporter(trace);
    167167                        free(tls);
  • test/test-format-parallel-singlethreaded.c

    r2498008 rd994324  
    105105        if (result) {
    106106                assert(libtrace_result_get_key(result) == 0);
    107                 printf("%d,", (int) libtrace_result_get_value(result));
     107                printf("%d,", libtrace_result_get_value(result).sint);
    108108                totalthreads++;
    109                 totalpkts += (int) libtrace_result_get_value(result);
     109                totalpkts += libtrace_result_get_value(result).sint;
    110110        } else {
    111111                switch(mesg->code) {
     
    162162
    163163                        // All threads publish to verify the thread count
    164                         trace_publish_result(trace, t, (uint64_t) 0, (void *) tls->count, RESULT_NORMAL);
     164                        trace_publish_result(trace, t, (uint64_t) 0, (libtrace_generic_types_t){.sint=tls->count}, RESULT_NORMAL);
    165165                        trace_post_reporter(trace);
    166166                        free(tls);
  • test/test-format-parallel-stressthreads.c

    r2498008 rd994324  
    105105        if (result) {
    106106                assert(libtrace_result_get_key(result) == 0);
    107                 printf("%d,", (int) libtrace_result_get_value(result));
     107                printf("%d,", libtrace_result_get_value(result).sint);
    108108                totalthreads++;
    109                 totalpkts += (int) libtrace_result_get_value(result);
     109                totalpkts += libtrace_result_get_value(result).sint;
    110110        } else {
    111111                switch(mesg->code) {
     
    162162
    163163                        // All threads publish to verify the thread count
    164                         trace_publish_result(trace, t, (uint64_t) 0, (void *) tls->count, RESULT_NORMAL);
     164                        trace_publish_result(trace, t, (uint64_t) 0, (libtrace_generic_types_t){.sint=tls->count}, RESULT_NORMAL);
    165165                        trace_post_reporter(trace);
    166166                        free(tls);
  • test/test-format-parallel.c

    r2498008 rd994324  
    104104        if (result) {
    105105                assert(libtrace_result_get_key(result) == 0);
    106                 printf("%d,", (int) libtrace_result_get_value(result));
     106                printf("%d,", libtrace_result_get_value(result).sint);
    107107                totalthreads++;
    108                 totalpkts += (int) libtrace_result_get_value(result);
     108                totalpkts += libtrace_result_get_value(result).sint;
    109109        } else {
    110110                switch(mesg->code) {
     
    172172
    173173                        // All threads publish to verify the thread count
    174                         trace_publish_result(trace, t, (uint64_t) 0, (void *) count, RESULT_NORMAL);
     174                        trace_publish_result(trace, t, (uint64_t) 0, (libtrace_generic_types_t){.sint = count}, RESULT_NORMAL);
    175175                        trace_post_reporter(trace);
    176176                        break;
Note: See TracChangeset for help on using the changeset viewer.