Changeset 62b3c4e for test/test-format-parallel-singlethreaded-hasher.c
- Timestamp:
- 03/05/15 15:44:30 (6 years ago)
- 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:
- ab3fa18
- Parents:
- b023181
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/test-format-parallel-singlethreaded-hasher.c
r98dc1ba r62b3c4e 102 102 static int totalpkts = 0; 103 103 static int expected; 104 static void report_result(libtrace_t *trace, libtrace_result_t *result, libtrace_message_t *mesg) { 104 static void report_result(libtrace_t *trace UNUSED, int mesg, 105 libtrace_generic_t data, 106 libtrace_thread_t *sender UNUSED) { 105 107 static int totalthreads = 0; 106 if (result) { 107 assert(libtrace_result_get_key(result) == 0); 108 printf("%d,", libtrace_result_get_value(result).sint); 108 switch (mesg) { 109 case MESSAGE_RESULT: 110 assert(libtrace_result_get_key(data.res) == 0); 111 printf("%d,", libtrace_result_get_value(data.res).sint); 109 112 totalthreads++; 110 totalpkts += libtrace_result_get_value(result).sint; 111 } else { 112 switch(mesg->code) { 113 case MESSAGE_STARTING: 114 // Should have a single thread here 115 assert(libtrace_get_perpkt_count(trace) == 1); 116 printf("\tLooks like %d threads are being used!\n\tcounts(", libtrace_get_perpkt_count(trace)); 117 break; 118 case MESSAGE_STOPPING: 119 printf(")\n"); 120 assert(totalthreads == libtrace_get_perpkt_count(trace)); 121 break; 122 } 113 totalpkts += libtrace_result_get_value(data.res).sint; 114 break; 115 case MESSAGE_STARTING: 116 // Should have a single thread here 117 assert(libtrace_get_perpkt_count(trace) == 1); 118 printf("\tLooks like %d threads are being used!\n\tcounts(", libtrace_get_perpkt_count(trace)); 119 break; 120 case MESSAGE_STOPPING: 121 printf(")\n"); 122 assert(totalthreads == libtrace_get_perpkt_count(trace)); 123 break; 123 124 } 124 125 }
Note: See TracChangeset
for help on using the changeset viewer.