Changeset 9e48735


Ignore:
Timestamp:
09/10/15 14:16:59 (5 years ago)
Author:
Shane Alcock <salcock@…>
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:
c3cb9f9
Parents:
49b0537
Message:

Add max threads option to parallel tracertstats

Default is 4 threads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracertstats/tracertstats_parallel.c

    r49b0537 r9e48735  
    6767
    6868int merge_inputs = 0;
     69int threadcount = 4;
    6970
    7071struct filter_t {
     
    262263        trace_set_combiner(trace, &combiner_ordered, (libtrace_generic_t){0});
    263264        trace_set_tracetime(trace, true);
     265        trace_set_perpkt_threads(trace, threadcount);
    264266
    265267        //trace_set_hasher(trace, HASHER_CUSTOM, &bad_hash, NULL);
     
    299301        "-i --interval=seconds  Duration of reporting interval in seconds\n"
    300302        "-c --count=packets     Exit after count packets received\n"
     303        "-t --threads=max       Create 'max' processing threads (default: 4)\n"
    301304        "-o --output-format=txt|csv|html|png Reporting output format\n"
    302305        "-f --filter=bpf        Apply BPF filter. Can be specified multiple times\n"
     
    319322                        { "libtrace-help",      0, 0, 'H' },
    320323                        { "merge-inputs",       0, 0, 'm' },
     324                        { "threads",            1, 0, 't' },
    321325                        { NULL,                 0, 0, 0   },
    322326                };
    323327
    324                 int c=getopt_long(argc, argv, "c:f:i:o:Hm",
     328                int c=getopt_long(argc, argv, "c:f:i:o:t:Hm",
    325329                                long_options, &option_index);
    326330
     
    337341                                filters[filter_count-1].bytes=0;
    338342                                break;
     343                        case 't':
     344                                threadcount = atoi(optarg);
     345                                if (threadcount <= 0)
     346                                        threadcount = 1;
     347                                break;
    339348                        case 'i':
    340349                                packet_interval=atof(optarg);
Note: See TracChangeset for help on using the changeset viewer.