Changeset fac8c46 for tools/tracestats
- Timestamp:
- 05/20/14 03:25:13 (7 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:
- 82facc5
- Parents:
- a5662447
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracestats/tracestats_parallel.c
r5ce14a5 rfac8c46 59 59 #include <pthread.h> 60 60 61 struct libtrace_t *trace ;61 struct libtrace_t *trace = NULL; 62 62 63 63 static void cleanup_signal(int signal) 64 64 { 65 static int s = 0; 65 66 (void)signal; 66 // trace_interrupt();67 // trace_interrupt(); 67 68 // trace_pstop isn't really signal safe because its got lots of locks in it 68 trace_pstop(trace); 69 // trace_pstop(trace); 70 if (s == 0) { 71 if (trace_ppause(trace) == -1) 72 trace_perror(trace, "Pause failed"); 73 } 74 else { 75 if (trace_pstart(trace, NULL, NULL, NULL) == -1) 76 trace_perror(trace, "Start failed"); 77 } 78 s = !s; 69 79 } 70 80 … … 121 131 case MESSAGE_STOPPED: 122 132 trace_publish_result(trace, 0, results); // Only ever using a single key 0 123 fprintf(stderr, "Thread published resuslts WOWW 133 fprintf(stderr, "Thread published resuslts WOWW\n"); 124 134 break; 125 135 case MESSAGE_STARTED: 126 136 results = calloc(1, sizeof(statistics_t) * (filter_count + 1)); 127 137 break; 128 case MESSAGE_ PAUSE:138 case MESSAGE_DO_PAUSE: 129 139 fprintf(stderr, "GOT Asked to pause ahh\n"); 140 break; 141 case MESSAGE_PAUSING: 142 fprintf(stderr, "Thread is pausing\n"); 143 break; 144 case MESSAGE_PAUSED: 145 fprintf(stderr, "Thread has paused\n"); 130 146 break; 131 147 } … … 189 205 } 190 206 191 static uint64_t rand_hash(libtrace_packet_t * pkt ) {207 static uint64_t rand_hash(libtrace_packet_t * pkt, void *data) { 192 208 return rand(); 193 209 } 194 210 195 static uint64_t bad_hash(libtrace_packet_t * pkt ) {211 static uint64_t bad_hash(libtrace_packet_t * pkt, void *data) { 196 212 return 0; 197 213 } … … 212 228 int option = 2; 213 229 //option = 10000; 214 //trace_parallel_config(trace, TRACE_OPTION_USE_DEDICATED_HASHER, &option); 230 trace_parallel_config(trace, TRACE_OPTION_USE_DEDICATED_HASHER, &option); 231 trace_set_hasher(trace, HASHER_CUSTOM, &rand_hash, NULL); 215 232 //trace_parallel_config(trace, TRACE_OPTION_USE_SLIDING_WINDOW_BUFFER, &option); 216 233 option = 2;
Note: See TracChangeset
for help on using the changeset viewer.