- Timestamp:
- 09/17/14 13:45:29 (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:
- 9e429e8
- Parents:
- 2498008
- Location:
- tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/traceanon/traceanon_parallel.c
r2498008 rd994324 1 1 #define _GNU_SOURCE 2 2 #include "libtrace.h" 3 #include "data-struct/vector.h" 4 #include "data-struct/message_queue.h" 5 #include "combiners.h" 3 6 #include <stdio.h> 4 7 #include <unistd.h> … … 11 14 #include <assert.h> 12 15 #include "ipenc.h" 13 #include <data-struct/vector.h>14 #include <data-struct/message_queue.h>15 16 #include <signal.h> 16 17 … … 155 156 static void* per_packet(libtrace_t *trace, libtrace_packet_t *pkt, libtrace_message_t *mesg, UNUSED libtrace_thread_t *t) 156 157 { 157 158 158 if (pkt) { 159 159 struct libtrace_ip *ipptr; … … 190 190 //libtrace_packet_t * packet_copy = trace_result_packet(trace, pkt); 191 191 //trace_publish_result(trace, trace_packet_get_order(pkt), pkt); 192 trace_publish_result(trace, t, trace_packet_get_order(pkt), pkt, RESULT_PACKET); 192 193 trace_publish_result(trace, t, trace_packet_get_order(pkt), (libtrace_generic_types_t){.pkt=pkt}, RESULT_PACKET); 193 194 //return ; 194 195 } … … 200 201 break; 201 202 case MESSAGE_TICK: 202 trace_publish_result(trace, t, mesg->additional.uint64, NULL, RESULT_TICK);203 trace_publish_result(trace, t, mesg->additional.uint64, (libtrace_generic_types_t){.pkt=NULL}, RESULT_TICK); 203 204 } 204 205 } … … 213 214 if (result) { 214 215 if (result->type == RESULT_PACKET) { 215 libtrace_packet_t *packet = (libtrace_packet_t*) libtrace_result_get_value(result) ;216 libtrace_packet_t *packet = (libtrace_packet_t*) libtrace_result_get_value(result).pkt; 216 217 assert(libtrace_result_get_key(result) == packet_count++); 217 218 if (trace_write_packet(writer,packet)==-1) { … … 422 423 423 424 int i = 1; 424 trace_ parallel_config(trace, TRACE_OPTION_ORDERED, &i);425 trace_set_combiner(trace, &combiner_ordered, (libtrace_generic_types_t){0}); 425 426 trace_parallel_config(trace, TRACE_OPTION_SET_CONFIG, &uc); 427 426 428 //trace_set_hasher(trace, HASHER_CUSTOM, rand_hash, NULL); 427 429 -
tools/tracertstats/tracertstats_parallel.c
r2498008 rd994324 59 59 #include "data-struct/vector.h" 60 60 #include "data-struct/message_queue.h" 61 #include "combiners.h" 61 62 62 63 #ifndef UINT32_MAX … … 144 145 result_t *res; 145 146 ts = libtrace_result_get_key(result); 146 res = libtrace_result_get_value(result) ;147 res = libtrace_result_get_value(result).ptr; 147 148 if (last_ts == 0) 148 149 last_ts = ts; … … 177 178 static __thread uint64_t last_ts = 0, ts = 0; 178 179 static __thread result_t * results = NULL; 179 180 180 // Unsure when we would hit this case but the old code had it, I 181 181 // guess we should keep it … … 189 189 // Publish and make a new one new 190 190 //fprintf(stderr, "Publishing result %"PRIu64"\n", last_ts); 191 trace_publish_result(trace, t, (uint64_t) last_ts, results, RESULT_NORMAL);191 trace_publish_result(trace, t, (uint64_t) last_ts, (libtrace_generic_types_t){.ptr = results}, RESULT_NORMAL); 192 192 trace_post_reporter(trace); 193 193 results = calloc(1, sizeof(result_t) + sizeof(statistic_t) * filter_count); … … 220 220 // Should we always post this? 221 221 if (results->total.count) { 222 trace_publish_result(trace, t, (uint64_t) last_ts, results, RESULT_NORMAL);222 trace_publish_result(trace, t, (uint64_t) last_ts, (libtrace_generic_types_t){.ptr = results}, RESULT_NORMAL); 223 223 trace_post_reporter(trace); 224 224 results = NULL; … … 240 240 if (next_update_time <= mesg->additional.uint64) { 241 241 //fprintf(stderr, "Got a tick and publishing early!!\n"); 242 trace_publish_result(trace, t, (uint64_t) last_ts, results, RESULT_NORMAL);242 trace_publish_result(trace, t, (uint64_t) last_ts, (libtrace_generic_types_t){.ptr = NULL}, RESULT_NORMAL); 243 243 trace_post_reporter(trace); 244 244 results = calloc(1, sizeof(result_t) + sizeof(statistic_t) * filter_count); … … 288 288 }*/ 289 289 int i = 1; 290 trace_ parallel_config(trace, TRACE_OPTION_ORDERED, &i);290 trace_set_combiner(trace, &combiner_ordered, (libtrace_generic_types_t){0}); 291 291 /* trace_parallel_config(trace, TRACE_OPTION_TRACETIME, &i); */ 292 292 //trace_set_hasher(trace, HASHER_CUSTOM, &bad_hash, NULL); -
tools/tracestats/tracestats_parallel.c
r2498008 rd994324 57 57 #include "data-struct/vector.h" 58 58 #include "data-struct/message_queue.h" 59 #include "combiners.h" 59 60 #include <pthread.h> 60 61 … … 130 131 switch (mesg->code) { 131 132 case MESSAGE_STOPPING: 132 trace_publish_result(trace, t, 0, results, RESULT_NORMAL); // Only ever using a single key 0133 trace_publish_result(trace, t, 0, (libtrace_generic_types_t){.ptr = results}, RESULT_NORMAL); // Only ever using a single key 0 133 134 fprintf(stderr, "Thread published resuslts WOWW\n"); 134 135 break; … … 158 159 /* Get the results from each core and sum 'em up */ 159 160 assert(libtrace_result_get_key(result) == 0); 160 statistics_t * res = libtrace_result_get_value(result) ;161 statistics_t * res = libtrace_result_get_value(result).ptr; 161 162 count += res[0].count; 162 163 bytes += res[0].bytes; … … 223 224 //option = 10000; 224 225 //trace_set_hasher(trace, HASHER_CUSTOM, &rand_hash, NULL); 225 option = 2;226 226 //trace_parallel_config(trace, TRACE_OPTION_SET_PERPKT_THREAD_COUNT, &option); 227 227 trace_parallel_config(trace, TRACE_OPTION_SET_CONFIG, &uc); 228 trace_ parallel_config(trace, TRACE_OPTION_ORDERED, &uc);228 trace_set_combiner(trace, &combiner_ordered, (libtrace_generic_types_t){0}); 229 229 230 230 //trace_parallel_config(trace, TRACE_OPTION_SET_MAPPER_BUFFER_SIZE, &option);
Note: See TracChangeset
for help on using the changeset viewer.