Changeset d0a067f


Ignore:
Timestamp:
11/01/16 18:36:00 (4 years ago)
Author:
GitHub <noreply@…>
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:
6463f32, f7f7015
Parents:
4145a78 (diff), 0cdd231 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Richard Sanger <rsangerarj@…> (11/01/16 18:36:00)
git-committer:
GitHub <noreply@…> (11/01/16 18:36:00)
Message:

Merge pull request #35 from EaseTheWorld?/add_trace_clear_feature

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.