Changeset a330384


Ignore:
Timestamp:
03/25/15 14:22:27 (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:
f01c479
Parents:
e0be8382
Message:

Add const modifier to trace_get_first_packet

Plus some other doc fixes

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_parallel.h

    r6b98325 ra330384  
    594594 *
    595595 * @param[in] trace The parallel input trace
    596  * @param[in] interval The interval in milliseconds. If 0 this is disabled [default].
     596 * @param[in] millisec The interval in milliseconds. If 0 this is disabled [default].
    597597 * @return 0 if successful otherwise -1
    598598 *
     
    606606 * @see MESSAGE_TICK_INTERVAL, trace_set_tick_count()
    607607 */
    608 DLLEXPORT int trace_set_tick_interval(libtrace_t *trace, size_t interval);
     608DLLEXPORT int trace_set_tick_interval(libtrace_t *trace, size_t millisec);
    609609
    610610/** Set the count between tick messages.
     
    10081008
    10091009/** TODO WHAT TO DO WITH THIS ? */
    1010 DLLEXPORT uint64_t tv_to_usec(struct timeval *tv);
     1010DLLEXPORT uint64_t tv_to_usec(const struct timeval *tv);
    10111011
    10121012
     
    10241024 * -1 is returned if an error occurs, such as supplied a invalid thread.
    10251025 *
    1026  * The packet returned by this function is shared by all threads and remains
    1027  * valid until MESSAGE_PAUSING is received.
     1026 * The packet and timeval returned by this function is shared by all threads
     1027 * and remain valid until MESSAGE_PAUSING is received.
    10281028 */
    10291029DLLEXPORT int trace_get_first_packet(libtrace_t *libtrace,
    10301030                                     libtrace_thread_t *t,
    1031                                      libtrace_packet_t **packet,
    1032                                      struct timeval **tv);
     1031                                     const libtrace_packet_t **packet,
     1032                                     const struct timeval **tv);
    10331033
    10341034/** Makes a packet safe, a packet will become invalid after a
     
    10921092 *
    10931093 * @note a environment variable interface is provided by default to users via
    1094  * LIBTRACE_CONFIG, see Parallel Configuration for more information.
     1094 * LIBTRACE_CONF, see Parallel Configuration for more information.
    10951095 *
    10961096 * @note this interface is provided to allow a user to configure an application
  • lib/trace_parallel.c

    r773d5e2 ra330384  
    944944DLLEXPORT int trace_get_first_packet(libtrace_t *libtrace,
    945945                                     libtrace_thread_t *t,
    946                                      libtrace_packet_t **packet,
    947                                      struct timeval **tv)
     946                                     const libtrace_packet_t **packet,
     947                                     const struct timeval **tv)
    948948{
    949949        void * tmp;
     
    957957        /* Throw away these which we don't use */
    958958        if (!packet)
    959                 packet = (libtrace_packet_t **) &tmp;
     959                packet = (const libtrace_packet_t **) &tmp;
    960960        if (!tv)
    961                 tv = (struct timeval **) &tmp;
     961                tv = (const struct timeval **) &tmp;
    962962
    963963        ASSERT_RET(pthread_spin_lock(&libtrace->first_packets.lock), == 0);
     
    991991
    992992
    993 DLLEXPORT uint64_t tv_to_usec(struct timeval *tv)
     993DLLEXPORT uint64_t tv_to_usec(const struct timeval *tv)
    994994{
    995995        return (uint64_t) tv->tv_sec*1000000ull + (uint64_t) tv->tv_usec;
     
    11311131
    11321132        if (!t->tracetime_offset_usec) {
    1133                 libtrace_packet_t *first_pkt;
    1134                 struct timeval *sys_tv;
     1133                const libtrace_packet_t *first_pkt;
     1134                const struct timeval *sys_tv;
    11351135                int64_t initial_offset;
    11361136                int stable = trace_get_first_packet(libtrace, NULL, &first_pkt, &sys_tv);
     
    22052205}
    22062206
    2207 DLLEXPORT int trace_set_tick_interval(libtrace_t *trace, size_t interval) {
     2207DLLEXPORT int trace_set_tick_interval(libtrace_t *trace, size_t millisec) {
    22082208        if (!trace_is_configurable(trace)) return -1;
    22092209
    2210         trace->config.tick_interval = interval;
     2210        trace->config.tick_interval = millisec;
    22112211        return 0;
    22122212}
  • tools/tracertstats/tracertstats_parallel.c

    r6b98325 ra330384  
    236236                        int64_t offset;
    237237                        struct timeval *tv, tv_real;
    238                         libtrace_packet_t *first_packet = NULL;
     238                        const libtrace_packet_t *first_packet = NULL;
    239239                        trace_get_first_packet(trace, NULL, &first_packet, &tv);
    240240                        if (first_packet != NULL) {
Note: See TracChangeset for help on using the changeset viewer.