Ignore:
Timestamp:
02/18/15 17:41:48 (6 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:
e4f27d1
Parents:
8bcc925
Message:

Deprecate trace_get_filtered/accepted/recevied/dropped() in favour of a single function

Adds the single trace_get_statistics function. This allows the structure to be filled
at a point in time, rather than making multiple calls to the library during which state
might have changed.

This has been designed such that the structure can be added to in the future without
breaking old code.

The old internal get_captured_packets was removed from the formats as it was never used.
Eventually we should completely remove get_filtered and received from the formats and replace
them with get_statistics.

In additon some extra fields have added, such as error and captured and the pre-existing
fields are better defined.

The linux formats have been updated to use this new API, which combined with reading
/proc/net/dev returns a full set of statistics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_int.c

    r6cf3ca0 r5ab626a  
    508508        linuxnative_set_capture_length, /* set_capture_length */
    509509        NULL,                           /* get_received_packets */
    510         linuxcommon_get_filtered_packets,/* get_filtered_packets */
    511         linuxcommon_get_dropped_packets,/* get_dropped_packets */
    512         linuxcommon_get_captured_packets,/* get_captured_packets */
     510        NULL,                           /* get_filtered_packets */
     511        NULL,                           /* get_dropped_packets */
     512        linuxcommon_get_statistics,     /* get_statistics */
    513513        linuxcommon_get_fd,             /* get_fd */
    514514        trace_event_device,             /* trace_event */
    515515        linuxnative_help,               /* help */
    516         NULL,                                   /* next pointer */
    517         {true, -1},              /* Live, no thread limit */
    518         linuxnative_pstart_input,                       /* pstart_input */
    519         linuxnative_pread_packets,                      /* pread_packets */
    520         linuxcommon_pause_input,                        /* ppause */
    521         linuxcommon_fin_input,                          /* p_fin */
    522         linuxcommon_pconfig_input,                      /* pconfig input */
    523         linuxcommon_pregister_thread,
    524         NULL
     516        NULL,                           /* next pointer */
     517        {true, -1},                     /* Live, no thread limit */
     518        linuxnative_pstart_input,       /* pstart_input */
     519        linuxnative_pread_packets,      /* pread_packets */
     520        linuxcommon_pause_input,        /* ppause */
     521        linuxcommon_fin_input,          /* p_fin */
     522        linuxcommon_pconfig_input,      /* pconfig input */
     523        linuxcommon_pregister_thread,   /* register thread */
     524        NULL,                           /* unregister thread */
     525        NULL                            /* get thread stats */
    525526};
    526527#else
     
    564565        linuxnative_set_capture_length, /* set_capture_length */
    565566        NULL,                           /* get_received_packets */
    566         linuxnative_get_filtered_packets,/* get_filtered_packets */
    567         linuxnative_get_dropped_packets,/* get_dropped_packets */
    568         linuxnative_get_captured_packets,/* get_captured_packets */
     567        NULL,                           /* get_filtered_packets */
     568        NULL,                           /* get_dropped_packets */
     569        linuxcommon_get_statistics,     /* get_statistics */
    569570        linuxnative_get_fd,             /* get_fd */
    570571        trace_event_device,             /* trace_event */
Note: See TracChangeset for help on using the changeset viewer.