- Timestamp:
- 03/12/15 17:14:42 (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:
- a978dec
- Parents:
- b54e2da
- Location:
- tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/traceanon/traceanon_parallel.c
r6a082f8 r6a6e6a8 161 161 libtrace_udp_t *udp = NULL; 162 162 libtrace_tcp_t *tcp = NULL; 163 163 libtrace_stat_t *stats = NULL; 164 164 switch (mesg) { 165 165 case MESSAGE_PACKET: … … 199 199 enc_init(enc_type,key); 200 200 break; 201 case MESSAGE_TICK: 202 trace_publish_result(trace, t, data.uint64, (libtrace_generic_t){0}, RESULT_TICK); 201 case MESSAGE_TICK_INTERVAL: 202 trace_publish_result(trace, t, data.uint64, (libtrace_generic_t){0}, RESULT_TICK_INTERVAL); 203 break; 204 case MESSAGE_TICK_COUNT: 205 trace_publish_result(trace, t, data.uint64, (libtrace_generic_t){0}, RESULT_TICK_COUNT); 206 break; 207 case MESSAGE_STOPPING: 208 stats = trace_create_statistics(); 209 trace_get_thread_statistics(trace, t, stats); 210 trace_print_statistics(stats, stderr, NULL); 211 free(stats); 212 stats = trace_get_statistics(trace, NULL); 213 trace_print_statistics(stats, stderr, NULL); 214 //fprintf(stderr, "tracestats_parallel:\t Stopping thread - publishing results\n"); 203 215 break; 204 216 } … … 216 228 case MESSAGE_RESULT: 217 229 if (data.res->type == RESULT_PACKET) { 218 libtrace_packet_t *packet = (libtrace_packet_t*) libtrace_result_get_value(data.res).pkt; 219 assert(libtrace_result_get_key(data.res) == packet_count++); 230 libtrace_packet_t *packet = (libtrace_packet_t*) data.res->value.pkt; 231 assert(data.res->key >= packet_count); 232 packet_count = data.res->key; 220 233 if (trace_write_packet(writer,packet)==-1) { 221 234 trace_perror_output(writer,"writer"); 222 235 trace_interrupt(); 223 236 } 224 trace_free_ result_packet(trace, packet);237 trace_free_packet(trace, packet); 225 238 226 239 } else { 227 assert(data.res->type == RESULT_TICK );240 assert(data.res->type == RESULT_TICK_COUNT || data.res->type == RESULT_TICK_INTERVAL); 228 241 // Ignore it 229 242 } -
tools/tracertstats/tracertstats_parallel.c
r6a082f8 r6a6e6a8 147 147 switch (mesg) { 148 148 case MESSAGE_RESULT: 149 ts = libtrace_result_get_key(data.res);150 res = libtrace_result_get_value(data.res).ptr;149 ts = data.res->key; 150 res = data.res->value.ptr; 151 151 if (last_ts == 0) 152 152 last_ts = ts; … … 195 195 // Publish and make a new one new 196 196 //fprintf(stderr, "Publishing result %"PRIu64"\n", last_ts); 197 trace_publish_result(trace, t, (uint64_t) last_ts, tmp, RESULT_ NORMAL);197 trace_publish_result(trace, t, (uint64_t) last_ts, tmp, RESULT_USER); 198 198 trace_post_reporter(trace); 199 199 results = calloc(1, sizeof(result_t) + sizeof(statistic_t) * filter_count); … … 225 225 if (results->total.count) { 226 226 libtrace_generic_t tmp = {.ptr = results}; 227 trace_publish_result(trace, t, (uint64_t) last_ts, tmp, RESULT_ NORMAL);227 trace_publish_result(trace, t, (uint64_t) last_ts, tmp, RESULT_USER); 228 228 trace_post_reporter(trace); 229 229 results = NULL; … … 231 231 break; 232 232 233 case MESSAGE_TICK: 233 case MESSAGE_TICK_INTERVAL: 234 case MESSAGE_TICK_COUNT: 234 235 { 235 236 int64_t offset; 236 237 struct timeval *tv, tv_real; 237 238 libtrace_packet_t *first_packet = NULL; 238 retrive_first_packet(trace, &first_packet, &tv);239 trace_get_first_packet(trace, NULL, &first_packet, &tv); 239 240 if (first_packet != NULL) { 240 241 // So figure out our running offset … … 247 248 libtrace_generic_t tmp = {.ptr = results}; 248 249 //fprintf(stderr, "Got a tick and publishing early!!\n"); 249 trace_publish_result(trace, t, (uint64_t) last_ts, tmp, RESULT_ NORMAL);250 trace_publish_result(trace, t, (uint64_t) last_ts, tmp, RESULT_USER); 250 251 trace_post_reporter(trace); 251 252 results = calloc(1, sizeof(result_t) + sizeof(statistic_t) * filter_count); -
tools/tracestats/tracestats_parallel.c
r6a082f8 r6a6e6a8 139 139 trace_print_statistics(stats, stderr, NULL); 140 140 free(stats); 141 trace_publish_result(trace, t, 0, (libtrace_generic_t){.ptr = results}, RESULT_ NORMAL); // Only ever using a single key 0141 trace_publish_result(trace, t, 0, (libtrace_generic_t){.ptr = results}, RESULT_USER); // Only ever using a single key 0 142 142 //fprintf(stderr, "tracestats_parallel:\t Stopping thread - publishing results\n"); 143 143 break; … … 168 168 case MESSAGE_RESULT: 169 169 /* Get the results from each core and sum 'em up */ 170 assert( libtrace_result_get_key(data.res)== 0);171 statistics_t * res = libtrace_result_get_value(data.res).ptr;170 assert(data.res->key == 0); 171 statistics_t * res = data.res->value.ptr; 172 172 count += res[0].count; 173 173 bytes += res[0].bytes;
Note: See TracChangeset
for help on using the changeset viewer.