- Timestamp:
- 09/15/15 11:24:14 (5 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:
- 5765044
- Parents:
- ebb54a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/traceanon/traceanon.cc
rebb54a5 raafdc55 48 48 " compression algorithm\n" 49 49 "-t --threads=max Use this number of threads for packet processing\n" 50 "-f --filter=expr Discard all packets that do not match the\n" 51 " provided BPF expression\n" 50 52 ,argv0); 51 53 exit(1); … … 286 288 libtrace_callback_set_t *repcbs = NULL; 287 289 int exitcode = 0; 290 char *filterstring = NULL; 291 libtrace_filter_t *filter = NULL; 288 292 289 293 if (argc<2) … … 299 303 { "prefix", 1, 0, 'p' }, 300 304 { "threads", 1, 0, 't' }, 305 { "filter", 1, 0, 'f' }, 301 306 { "compress-level", 1, 0, 'z' }, 302 307 { "compress-type", 1, 0, 'Z' }, … … 305 310 }; 306 311 307 int c=getopt_long(argc, argv, "Z:z:sc:f:dp:ht: ",312 int c=getopt_long(argc, argv, "Z:z:sc:f:dp:ht:f:", 308 313 long_options, &option_index); 309 314 … … 344 349 break; 345 350 } 351 case 'f': 352 filterstring = optarg; 353 break; 346 354 case 'p': 347 355 if (key!=NULL) { … … 431 439 trace_set_perpkt_threads(trace, maxthreads); 432 440 441 if (filterstring) { 442 filter = trace_create_filter(filterstring); 443 } 444 445 if (filter && trace_config(trace, TRACE_OPTION_FILTER, filter) == -1) 446 { 447 trace_perror(trace, "Configuring input filter"); 448 exitcode = 1; 449 goto exitanon; 450 } 451 433 452 if (trace_pstart(trace, output, pktcbs, repcbs)==-1) { 434 453 trace_perror(trace,"trace_start");
Note: See TracChangeset
for help on using the changeset viewer.