Changeset 0cdd231


Ignore:
Timestamp:
10/31/16 17:26:57 (4 years ago)
Author:
EaseTheWorld <easetheworld@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
d0a067f
Parents:
4145a78
Message:

Add trace_clear_statistics api.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    ra984307 r0cdd231  
    16621662
    16631663/**
     1664 * Clear all fields of given statistic.
     1665 * This api doesn't verify the magic field unlike other stat apis.
     1666 *
     1667 * @param s The statistic structure to clear
     1668 */
     1669DLLEXPORT
     1670void trace_clear_statistics(libtrace_stat_t *s);
     1671
     1672/**
    16641673 * Performs the operation c=a-b accounting for valid fields.
    16651674 * c is allowed to be a or b.
  • lib/trace.c

    r903f64d r0cdd231  
    22142214}
    22152215
     2216void trace_clear_statistics(libtrace_stat_t *s) {
     2217        memset(s, 0, sizeof(libtrace_stat_t));
     2218        s->magic = LIBTRACE_STAT_MAGIC;
     2219}
     2220
    22162221void trace_subtract_statistics(const libtrace_stat_t *a, const libtrace_stat_t *b,
    22172222                         libtrace_stat_t *c) {
Note: See TracChangeset for help on using the changeset viewer.