Changeset 2e9df89 for tools


Ignore:
Timestamp:
10/01/15 16:14:08 (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:
135e3f6
Parents:
259c314
Message:

Add -N option to tracertstats

This will set the trace burst size to 1, so that libtrace will not block
waiting for a full packet buffer before processing packets or ticks. This
is useful when using an interface with very little traffic as input, as
otherwise the output is quite bursty rather than the intended "real time".

Location:
tools/tracertstats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tools/tracertstats/tracertstats.1

    rd2df7c4 r2e9df89  
    1010[ -o | --output-format csv,txt,png,html ]
    1111[ -m | --merge-inputs ]
     12[ -N | --nobuffer ]
    1213inputuri...
    1314.P
     
    6061than an output for each input. Works best with traces that are consecutive to
    6162create a single CSV, for instance.
     63
     64.TP
     65.PD 0
     66.BI \-N
     67.TP
     68.PD
     69.BI \-\^\-nobuffer
     70Disable internal packet buffering in libtrace. If the packet rate is very low
     71(i.e. < 10 packets per interval), set this to ensure that tracertstats is more
     72likely to print results in time with the interval rather than producing bursts
     73of output for multiple intervals at a time.
    6274
    6375.TP
  • tools/tracertstats/tracertstats.c

    r80e834f r2e9df89  
    6767int threadcount = 4;
    6868int filter_count=0;
     69int burstsize=10;
    6970
    7071struct filter_t {
     
    194195        if ((key >> 32) >= (td->last_key >> 32) + packet_interval) {
    195196                libtrace_generic_t tmp = {.ptr = td->results};
    196                 trace_publish_result(trace, t, key,
     197                trace_publish_result(trace, t, key,
    197198                                tmp, RESULT_USER);
    198199                trace_post_reporter(trace);
     
    230231        thread_data_t *td = (thread_data_t *)tls;
    231232        if (order > td->last_key) {
    232                 libtrace_generic_t tmp = {.ptr = td->results};
     233                libtrace_generic_t tmp = {.ptr = td->results};
    233234                trace_publish_result(trace, t, order, tmp, RESULT_USER);
    234235                trace_post_reporter(trace);
     
    262263        trace_set_tracetime(trace, true);
    263264        trace_set_perpkt_threads(trace, threadcount);
     265        trace_set_burst_size(trace, burstsize);
    264266
    265267        if (trace_get_information(trace)->live) {
     
    316318        "-f --filter=bpf        Apply BPF filter. Can be specified multiple times\n"
    317319        "-m --merge-inputs      Do not create separate outputs for each input trace\n"
     320        "-N --nobuffer          Disable packet buffering within libtrace to force faster\n"
     321        "                       updates at very low traffic rates\n"
    318322        "-h --help      Print this usage statement\n"
    319323        ,argv0);
     
    334338                        { "merge-inputs",       0, 0, 'm' },
    335339                        { "threads",            1, 0, 't' },
     340                        { "nobuffer",           0, 0, 'N' },
    336341                        { NULL,                 0, 0, 0   },
    337342                };
    338343
    339                 int c=getopt_long(argc, argv, "c:f:i:o:t:hm",
     344                int c=getopt_long(argc, argv, "c:f:i:o:t:hmN",
    340345                                long_options, &option_index);
    341346
     
    344349
    345350                switch (c) {
     351                        case 'N':
     352                                burstsize = 1;
     353                                break;
    346354                        case 'f':
    347355                                ++filter_count;
Note: See TracChangeset for help on using the changeset viewer.