Changeset 963b13b
- Timestamp:
- 03/18/15 16:33:17 (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:
- 6b98325
- Parents:
- 1407294
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace_parallel.c
r1407294 r963b13b 1274 1274 static int trace_prestart(libtrace_t * libtrace, void *global_blob, 1275 1275 fn_per_pkt per_pkt, fn_reporter reporter) { 1276 int err = 0;1276 int i, err = 0; 1277 1277 if (libtrace->state != STATE_PAUSED) { 1278 1278 trace_set_err(libtrace, TRACE_ERR_BAD_STATE, … … 1282 1282 } 1283 1283 1284 assert(libtrace_parallel); 1285 assert(!libtrace->perpkt_thread_states[THREAD_RUNNING]); 1286 1287 /* Reset first packets */ 1288 pthread_spin_lock(&libtrace->first_packets.lock); 1289 for (i = 0; i < libtrace->perpkt_thread_count; ++i) { 1290 assert(!!libtrace->perpkt_threads[i].recorded_first == !!libtrace->first_packets.packets[i].packet); 1291 if (libtrace->first_packets.packets[i].packet) { 1292 trace_destroy_packet(libtrace->first_packets.packets[i].packet); 1293 libtrace->first_packets.packets[i].packet = NULL; 1294 libtrace->first_packets.packets[i].tv.tv_sec = 0; 1295 libtrace->first_packets.packets[i].tv.tv_usec = 0; 1296 libtrace->first_packets.count--; 1297 libtrace->perpkt_threads[i].recorded_first = false; 1298 } 1299 } 1300 assert(libtrace->first_packets.count == 0); 1301 libtrace->first_packets.first = 0; 1302 pthread_spin_unlock(&libtrace->first_packets.lock); 1303 1304 /* Reset delay */ 1305 for (i = 0; i < libtrace->perpkt_thread_count; ++i) { 1306 libtrace->perpkt_threads[i].tracetime_offset_usec = 0; 1307 } 1308 1309 /* Reset statistics */ 1310 for (i = 0; i < libtrace->perpkt_thread_count; ++i) { 1311 libtrace->perpkt_threads[i].accepted_packets = 0; 1312 libtrace->perpkt_threads[i].filtered_packets = 0; 1313 } 1314 libtrace->accepted_packets = 0; 1315 libtrace->filtered_packets = 0; 1316 1284 1317 /* Update functions if requested */ 1285 1318 if (per_pkt) 1286 1319 libtrace->per_pkt = per_pkt; 1320 assert(libtrace->per_pkt); 1287 1321 if (reporter) 1288 1322 libtrace->reporter = reporter; 1289 1323 if(global_blob) 1290 1324 libtrace->global_blob = global_blob; 1291 1292 assert(libtrace_parallel);1293 assert(!libtrace->perpkt_thread_states[THREAD_RUNNING]);1294 assert(libtrace->per_pkt);1295 1325 1296 1326 if (libtrace->perpkt_thread_count > 1 &&
Note: See TracChangeset
for help on using the changeset viewer.