Changeset be3f75b for lib/trace.c


Ignore:
Timestamp:
07/30/14 19:17:14 (7 years ago)
Author:
Richard Sanger <rsangerarj@…>
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:
f9a70ca
Parents:
a49a9eb
Message:

Fixs statistic counters for parallel traces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    ra49a9eb rbe3f75b  
    286286        libtrace->first_packets.count = 0;
    287287        libtrace->first_packets.packets = NULL;
     288        libtrace->dropped_packets = UINT64_MAX;
     289        libtrace->accepted_packets = UINT64_MAX;
    288290
    289291        /* Parse the URI to determine what sort of trace we are dealing with */
     
    19401942{
    19411943        assert(trace);
     1944        uint64_t ret;
     1945
    19421946        if (trace->format->get_received_packets) {
    1943                 return trace->format->get_received_packets(trace);
    1944         }
    1945         return (uint64_t)-1;
     1947                if ((ret = trace->format->get_received_packets(trace)) != UINT64_MAX)
     1948                        return ret;
     1949        }
     1950        // Read this cached value taken before the trace was closed
     1951        return trace->received_packets;
    19461952}
    19471953
     
    19671973{
    19681974        assert(trace);
     1975        uint64_t ret;
     1976
    19691977        if (trace->format->get_dropped_packets) {
    1970                 return trace->format->get_dropped_packets(trace);
    1971         }
    1972         return (uint64_t)-1;
     1978                if ((ret = trace->format->get_dropped_packets(trace)) != UINT64_MAX)
     1979                        return ret;
     1980        }
     1981        // Read this cached value taken before the trace was closed
     1982        return trace->dropped_packets;
    19731983}
    19741984
     
    19761986{
    19771987        assert(trace);
    1978         return trace->accepted_packets;
     1988        int i = 0;
     1989        uint64_t ret = trace->accepted_packets;
     1990        for (i = 0; i < trace->perpkt_thread_count; i++) {
     1991                ret += trace->perpkt_threads[i].accepted_packets;
     1992        }
     1993        return ret;
    19791994}
    19801995
Note: See TracChangeset for help on using the changeset viewer.