Changeset b13b939


Ignore:
Timestamp:
06/18/14 16:12:46 (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:
85e87b5
Parents:
82facc5
Message:

Adds a configuration option for the tick messages.
Adds the trace_information structure which contains information about traces.
Updates trace_rt_stats to use both of these.

Replaced libtrace_t->joined internally with a state

Files:
18 edited

Legend:

Unmodified
Added
Removed
  • lib/format_atmhdr.c

    r29bbef0 rb13b939  
    231231        trace_event_trace,              /* trace_event */
    232232        NULL,                           /* help */
    233         NULL, /* pstart_input */
    234         NULL, /* pread_packet */
    235         NULL, /* ppause_input */
    236         NULL, /* pfin_input */
    237         NULL, /* pconfig_input */
    238         NULL                            /* next pointer */
     233        NULL,                            /* next pointer */
     234        NON_PARALLEL(false)
    239235};
    240236       
  • lib/format_bpf.c

    r29bbef0 rb13b939  
    599599        trace_event_device,     /* trace_event */
    600600        bpf_help,               /* help */
    601         NULL
     601        NULL,                   /* next pointer */
     602        NON_PARALLEL(false)
    602603};
    603604#else   /* HAVE_DECL_BIOCSETIF */
     
    648649        NULL,                   /* trace_event */
    649650        bpf_help,               /* help */
    650         NULL, /* pstart_input */
    651         NULL, /* pread_packet */
    652         NULL, /* ppause_input */
    653         NULL, /* pfin_input */
    654         NULL, /* pconfig_input */
    655         NULL
     651        NULL,                   /* next pointer */
     652        NON_PARALLEL(false)
    656653};
    657654#endif  /* HAVE_DECL_BIOCSETIF */
  • lib/format_dag24.c

    r29bbef0 rb13b939  
    557557        trace_event_dag,                /* trace_event */
    558558        dag_help,                       /* help */
    559         NULL, /* pstart_input */
    560         NULL, /* pread_packet */
    561         NULL, /* ppause_input */
    562         NULL, /* pfin_input */
    563         NULL, /* pconfig_input */
    564         NULL                            /* next pointer */
     559        NULL,                            /* next pointer */
     560    NON_PARALLEL(true)
    565561};
    566562
  • lib/format_dag25.c

    r29bbef0 rb13b939  
    12151215        NULL, /* pfin_input */
    12161216        NULL, /* pconfig_input */
    1217         NULL                            /* next pointer */
     1217        NULL,                            /* next pointer */
     1218        NON_PARALLEL(true)
    12181219};
    12191220
  • lib/format_dpdk.c

    r17a3dff rb13b939  
    15951595}
    15961596
    1597  static struct libtrace_format_t dpdk = {
     1597static struct libtrace_format_t dpdk = {
    15981598        "dpdk",
    15991599        "$Id: format_dpdk.c 1805 2013-03-08 02:01:35Z salcock $",
     
    16351635        dpdk_trace_event,               /* trace_event */
    16361636    dpdk_help,              /* help */
     1637    NULL,                   /* next pointer */
     1638    {true, 8},              /* Live, NICs typically have 8 threads */
    16371639    dpdk_pstart_input, /* pstart_input */
    16381640        dpdk_pread_packet, /* pread_packet */
    16391641        dpdk_pause_input, /* ppause */
    16401642        dpdk_fin_input, /* p_fin */
    1641         dpdk_pconfig_input, /* pconfig_input */
    1642         NULL
     1643        dpdk_pconfig_input /* pconfig_input */
    16431644};
    16441645
  • lib/format_duck.c

    r29bbef0 rb13b939  
    360360        NULL,                           /* trace_event */
    361361        duck_help,                      /* help */
    362         NULL, /* pstart_input */
    363         NULL, /* pread_packet */
    364         NULL, /* ppause_input */
    365         NULL, /* pfin_input */
    366         NULL, /* pconfig_input */
    367         NULL                            /* next pointer */
     362        NULL,                            /* next pointer */
     363        NON_PARALLEL(false)
    368364};
    369365
  • lib/format_erf.c

    r29bbef0 rb13b939  
    828828        erf_event,                      /* trace_event */
    829829        erf_help,                       /* help */
    830         NULL, /* pstart_input */
    831         NULL, /* pread_packet */
    832         NULL, /* ppause_input */
    833         NULL, /* pfin_input */
    834         NULL, /* pconfig_input */
    835         NULL                            /* next pointer */
     830        NULL,                           /* next pointer */
     831        NON_PARALLEL(false)
    836832};
    837833
     
    876872        erf_event,                      /* trace_event */
    877873        erf_help,                       /* help */
    878         NULL, /* pstart_input */
    879         NULL, /* pread_packet */
    880         NULL, /* ppause_input */
    881         NULL, /* pfin_input */
    882         NULL, /* pconfig_input */
    883         NULL                            /* next pointer */
     874        NULL,                           /* next pointer */
     875        NON_PARALLEL(false)
    884876};
    885877
  • lib/format_legacy.c

    r29bbef0 rb13b939  
    552552        trace_event_trace,              /* trace_event */
    553553        legacyatm_help,                 /* help */
    554         NULL                            /* next pointer */
     554        NULL,                           /* next pointer */
     555        NON_PARALLEL(false)
    555556};
    556557
     
    595596        trace_event_trace,              /* trace_event */
    596597        legacyeth_help,                 /* help */
    597         NULL                            /* next pointer */
     598        NULL,                           /* next pointer */
     599        NON_PARALLEL(false)
    598600};
    599601
     
    639641        legacypos_help,                 /* help */
    640642        NULL,                           /* next pointer */
     643        NON_PARALLEL(false)
    641644};
    642645
     
    681684        trace_event_trace,              /* trace_event */
    682685        legacynzix_help,                /* help */
    683         NULL, /* pstart_input */
    684         NULL, /* pread_packet */
    685         NULL, /* ppause_input */
    686         NULL, /* pfin_input */
    687         NULL, /* pconfig_input */
    688686        NULL,                           /* next pointer */
     687        NON_PARALLEL(false)
    689688};
    690689       
  • lib/format_linux.c

    r82facc5 rb13b939  
    18281828        trace_event_device,             /* trace_event */
    18291829        linuxnative_help,               /* help */
     1830        NULL,                                   /* next pointer */
     1831        {true, -1},              /* Live, no thread limit */
    18301832        linuxnative_pstart_input,                       /* pstart_input */
    18311833        linuxnative_pread_packet,                       /* pread_packet */
    18321834        linuxnative_ppause_input,                       /* ppause */
    18331835        linuxnative_fin_input,                          /* p_fin */
    1834         linuxnative_pconfig_input,                      /* pconfig input */ //int (*pconfig_input)(libtrace_t *libtrace,trace_option_t option,void *value);
    1835         NULL
     1836        linuxnative_pconfig_input                       /* pconfig input */
    18361837};
    18371838
     
    18761877        linuxring_event,                /* trace_event */
    18771878        linuxring_help,         /* help */
     1879        NULL,                           /* next pointer */
     1880        {true, -1},              /* Live, no thread limit */
    18781881        linuxnative_pstart_input,                       /* pstart_input */
    18791882        linuxring_pread_packet,                 /* pread_packet */
    18801883        linuxnative_ppause_input,                       /* ppause */
    18811884        linuxnative_fin_input,                          /* p_fin */
    1882         linuxnative_pconfig_input,
    1883         NULL
     1885        linuxnative_pconfig_input
     1886       
    18841887};
    18851888#else
     
    19331936        trace_event_device,             /* trace_event */
    19341937        linuxnative_help,               /* help */
    1935         NULL,                   /* pstart_input */
    1936         NULL,                   /* pread_packet */
    1937         NULL
     1938        NULL,                   /* next pointer */
     1939        NON_PARALLEL(true)
    19381940};
    19391941
     
    19781980        NULL,                           /* trace_event */
    19791981        linuxring_help,                 /* help */
    1980         NULL,                   /* pstart_input */
    1981         NULL,                   /* pread_packet */
    1982         NULL
     1982        NULL,                   /* next pointer */
     1983        NON_PARALLEL(true)
    19831984};
    19841985
  • lib/format_pcap.c

    r29bbef0 rb13b939  
    801801        trace_event_trace,              /* trace_event */
    802802        pcap_help,                      /* help */
    803         NULL, /* pstart_input */
    804         NULL, /* pread_packet */
    805         NULL, /* ppause_input */
    806         NULL, /* pfin_input */
    807         NULL, /* pconfig_input */
    808         NULL                            /* next pointer */
     803        NULL,                   /* next pointer */
     804        NON_PARALLEL(false)
    809805};
    810806
     
    849845        trace_event_device,             /* trace_event */
    850846        pcapint_help,                   /* help */
    851         NULL, /* pstart_input */
    852         NULL, /* pread_packet */
    853         NULL, /* ppause_input */
    854         NULL, /* pfin_input */
    855         NULL, /* pconfig_input */
    856         NULL                            /* next pointer */
     847        NULL,                   /* next pointer */
     848        NON_PARALLEL(true)
    857849};
    858850
  • lib/format_pcapfile.c

    r29bbef0 rb13b939  
    774774        pcapfile_event,         /* trace_event */
    775775        pcapfile_help,                  /* help */
    776         NULL, /* pstart_input */
    777         NULL, /* pread_packet */
    778         NULL, /* ppause_input */
    779         NULL, /* pfin_input */
    780         NULL, /* pconfig_input */
    781         NULL                            /* next pointer */
     776        NULL,                   /* next pointer */
     777        NON_PARALLEL(false)
    782778};
    783779
  • lib/format_rt.c

    r29bbef0 rb13b939  
    858858        trace_event_rt,             /* trace_event */
    859859        rt_help,                        /* help */
    860         NULL, /* pstart_input */
    861         NULL, /* pread_packet */
    862         NULL, /* ppause_input */
    863         NULL, /* pfin_input */
    864         NULL, /* pconfig_input */
    865         NULL                            /* next pointer */
     860        NULL,                   /* next pointer */
     861        NON_PARALLEL(true) /* This is normally live */
    866862};
    867863
  • lib/format_tsh.c

    r29bbef0 rb13b939  
    269269        trace_event_trace,              /* trace_event */
    270270        tsh_help,                       /* help */
    271         NULL, /* pstart_input */
    272         NULL, /* pread_packet */
    273         NULL, /* ppause_input */
    274         NULL, /* pfin_input */
    275         NULL, /* pconfig_input */
    276         NULL                            /* next pointer */
     271        NULL,                   /* next pointer */
     272        NON_PARALLEL(false)
    277273};
    278274
     
    322318        trace_event_trace,              /* trace_event */
    323319        tsh_help,                       /* help */
    324         NULL, /* pstart_input */
    325         NULL, /* pread_packet */
    326         NULL, /* ppause_input */
    327         NULL, /* pfin_input */
    328         NULL, /* pconfig_input */
    329         NULL                            /* next pointer */
     320        NULL,                   /* next pointer */
     321        NON_PARALLEL(false)
    330322};
    331323
  • lib/libtrace.h.in

    r82facc5 rb13b939  
    32373237          TRACE_OPTION_USE_DEDICATED_HASHER,
    32383238          TRACE_OPTION_USE_SLIDING_WINDOW_BUFFER,
    3239           TRACE_OPTION_TRACETIME
     3239
     3240          /**
     3241           * Delays packets so they are played back in trace-time rather than as fast
     3242           * as possible.
     3243           */
     3244          TRACE_OPTION_TRACETIME,
     3245
     3246          /**
     3247           * Specifies the interval between tick packets in milliseconds, if 0
     3248           * or less this is ignored.
     3249           */
     3250          TRACE_OPTION_TICK_INTERVAL
    32403251} trace_parallel_option_t;
    32413252
     
    32593270
    32603271enum hasher_types {
    3261         HASHER_BALANCE, /** Balance load across CPUs best as possible this is basically to say don't care about hash, but this might still might be implemented using a hash or round robin etc.. */
    3262         HASHER_BIDIRECTIONAL, /** Use a hash which is uni-directional for TCP flows (IP src dest,TCP port src dest), non TCP
    3263                                                         Will be sent to the same place, with the exception of UDP which may or may not be sent to separate cores */
    3264         HASHER_UNIDIRECTIONAL, /** Use a hash which is uni-directional across TCP flow */
    3265         HASHER_CUSTOM, /** Always use the user supplied hasher */
    3266         HASHER_HARDWARE, /** Set by the format if the hashing is going to be done in hardware */
     3272        /**
     3273         * Balance load across CPUs best as possible, this is basically to say do
     3274         * not care about hash. This might still might be implemented
     3275         * using a hash or round robin etc. under the hood depending on the format
     3276         */
     3277        HASHER_BALANCE,
     3278
     3279        /** Use a hash which is bi-directional for TCP flows, that is packets with
     3280         * the same hash are sent to the same thread. All non TCP packets will be
     3281         * sent to the same thread. UDP may or may not be sent to separate
     3282         * threads like TCP, this depends on the format support.
     3283         */
     3284        HASHER_BIDIRECTIONAL,
     3285       
     3286        /**
     3287         * Use a hash which is uni-directional across TCP flows, that means the
     3288         * opposite directions of the same 5 tuple might end up on separate cores.
     3289         * Otherwise is identical to HASHER_BIDIRECTIONAL
     3290         */
     3291        HASHER_UNIDIRECTIONAL,
     3292
     3293        /**
     3294         * Always use the user supplied hasher, this currently disables native
     3295         * support and is likely significantly slower.
     3296         */
     3297        HASHER_CUSTOM,
     3298
     3299        /**
     3300         * This is not a valid option, used internally only!!! TODO remove
     3301         * Set by the format if the hashing is going to be done in hardware
     3302         */
     3303        HASHER_HARDWARE
    32673304};
     3305
     3306typedef struct libtrace_info_t {
     3307        /**
     3308         * True if a live format (i.e. packets have to be tracetime).
     3309         * Otherwise false, indicating packets can be read as fast
     3310         * as possible from the format.
     3311         */
     3312        bool live;
     3313
     3314        /**
     3315         * The maximum number of threads supported by a parallel trace. 1
     3316         * if parallel support is not native (in this case libtrace will simulate
     3317         * an unlimited number of threads), -1 means unlimited and 0 unknown.
     3318         */
     3319        int max_threads;
     3320
     3321        /* TODO hash fn supported list */
     3322
     3323        /* TODO consider time/clock details?? */
     3324} libtrace_info_t;
    32683325
    32693326DLLEXPORT int trace_parallel_config(libtrace_t *libtrace, trace_parallel_option_t option, void *value);
    32703327DLLEXPORT libtrace_packet_t* trace_result_packet(libtrace_t * libtrace, libtrace_packet_t * packet);
    32713328DLLEXPORT void trace_free_result_packet(libtrace_t * libtrace, libtrace_packet_t * packet);
    3272 enum hasher_types;
    32733329DLLEXPORT int trace_set_hasher(libtrace_t *trace, enum hasher_types type, fn_hasher hasher, void *data);
     3330DLLEXPORT libtrace_info_t *trace_get_information(libtrace_t * libtrace);
    32743331
    32753332#ifdef __cplusplus
  • lib/libtrace_int.h

    r82facc5 rb13b939  
    250250        X(STATE_FINSHED) \
    251251        X(STATE_DESTROYED) \
    252         X(STATE_ERROR) // Currently unused
     252        X(STATE_JOINED) \
     253        X(STATE_ERROR)
    253254
    254255#define X(a) a,
     
    323324        /** The reducer flags */
    324325        int reducer_flags;
     326        /** The tick interval - in milliseconds (0 or -ve==disabled) */
     327        int tick_interval;
    325328        /** Used to track the next expected key */
    326329        uint64_t expected_key;
     
    460463} PACKED libtrace_pflog_header_t;
    461464
    462 
    463 
    464465/** A libtrace capture format module */
    465466/* All functions should return -1, or NULL on failure */
     
    892893        void (*help)(void);
    893894       
     895        /** Next pointer, should always be NULL - used by the format module
     896         * manager. */
     897        struct libtrace_format_t *next;
     898
     899        /** Holds information about the trace format */
     900        struct libtrace_info_t info;
     901
    894902        /** Starts or unpauses an input trace in parallel mode - note that
    895903         * this function is often the one that opens the file or device for
     
    909917        int (*pread_packet)(libtrace_t *trace, libtrace_packet_t *packet);
    910918       
    911         /** Pause a parallel trace */
     919        /** Pause a parallel trace
     920         *
     921         * @param libtrace      The input trace to be paused
     922         */
    912923        int (*ppause_input)(libtrace_t *trace);
    913924       
    914         /** Called after all threads have been paused, Finish (close) a parallel trace */
     925        /** Called after all threads have been paused, Finish (close) a parallel trace
     926     *
     927         * @param libtrace      The input trace to be stopped
     928         */
    915929        int (*pfin_input)(libtrace_t *trace);
    916930       
     
    925939         */
    926940        int (*pconfig_input)(libtrace_t *libtrace,trace_parallel_option_t option,void *value);
    927        
    928         /** Next pointer, should always be NULL - used by the format module
    929          * manager. */
    930         struct libtrace_format_t *next;
     941               
    931942};
     943
     944/** Macro to zero out a single thread format */
     945#define NON_PARALLEL(live) \
     946{live, 1},              /* trace info */ \
     947NULL,                   /* pstart_input */ \
     948NULL,                   /* pread_packet */ \
     949NULL,                   /* ppause_input */ \
     950NULL,                   /* pfin_input */ \
     951NULL,                   /* pconfig_input */
    932952
    933953/** The list of registered capture formats */
  • lib/trace.c

    r82facc5 rb13b939  
    268268        libtrace->perpkts_finishing = -1;
    269269        libtrace->reducer_flags = 0;
    270         libtrace->joined = false;
    271270        libtrace->global_blob = NULL;
    272271        libtrace->per_pkt = NULL;
     
    285284        libtrace->perpkt_threads = NULL;
    286285        libtrace->tracetime = 0;
     286        libtrace->tick_interval = 0;
    287287
    288288        /* Parse the URI to determine what sort of trace we are dealing with */
     
    389389        libtrace->perpkts_finishing = -1;
    390390        libtrace->reducer_flags = 0;
    391         libtrace->joined = false;
    392391        libtrace->global_blob = NULL;
    393392        libtrace->per_pkt = NULL;
     
    406405        libtrace->perpkt_threads = NULL;
    407406        libtrace->tracetime = 0;
     407        libtrace->tick_interval = 0;
    408408       
    409409        for(tmp=formats_list;tmp;tmp=tmp->next) {
  • lib/trace_parallel.c

    r82facc5 rb13b939  
    492492        // Doing this inside the lock ensures the first packet is always
    493493        // recorded first
    494         store_first_packet(libtrace, *packet, t);
     494        if ((*packet)->error > 0)
     495                store_first_packet(libtrace, *packet, t);
    495496
    496497        assert(pthread_mutex_unlock(&libtrace->libtrace_lock) == 0);
     
    912913        libtrace_message_t message = {0};
    913914        libtrace_t *trace = (libtrace_t *)data;
    914         int delay_usec = 1000000; // ! second hard coded !!
    915915        uint64_t next_release;
    916916        fprintf(stderr, "keepalive thread is starting\n");
    917         // TODO mark this thread as running against the libtrace object
     917
    918918        gettimeofday(&prev, NULL);
    919919        message.code = MESSAGE_TICK;
    920920        while (trace->state != STATE_FINSHED) {
    921921                fd_set rfds;
    922                 next_release = tv_to_usec(&prev) + delay_usec;
     922                next_release = tv_to_usec(&prev) + (trace->tick_interval * 1000);
    923923                gettimeofday(&next, NULL);
    924924                if (next_release > tv_to_usec(&next)) {
     
    11651165
    11661166        // If we are using a hasher start it
    1167         if (libtrace->hasher && libtrace->hasher_thread.type == THREAD_HASHER) {
     1167        if (libtrace->hasher || libtrace->hasher_thread.type == THREAD_HASHER) {
    11681168                libtrace_thread_t *t = &libtrace->hasher_thread;
    11691169                t->trace = libtrace;
     
    12331233                threads_started = trace_start_perpkt_threads(libtrace);
    12341234
    1235         libtrace->keepalive_thread.type = THREAD_KEEPALIVE;
    1236         libtrace->keepalive_thread.state = THREAD_RUNNING;
    1237         libtrace_message_queue_init(&libtrace->keepalive_thread.messages, sizeof(libtrace_message_t));
    1238         assert(pthread_create(&libtrace->keepalive_thread.tid, NULL, keepalive_entry, (void *) libtrace) == 0);
     1235        if (libtrace->tick_interval > 0) {
     1236                libtrace->keepalive_thread.type = THREAD_KEEPALIVE;
     1237                libtrace->keepalive_thread.state = THREAD_RUNNING;
     1238                libtrace_message_queue_init(&libtrace->keepalive_thread.messages, sizeof(libtrace_message_t));
     1239                assert(pthread_create(&libtrace->keepalive_thread.tid, NULL, keepalive_entry, (void *) libtrace) == 0);
     1240        }
    12391241
    12401242        // Revert back - Allow signals again
     
    15101512        }
    15111513        libtrace->state = STATE_FINSHED;
    1512         // Wait for the ticker thread
    15131514       
    1514         if (libtrace->keepalive_thread.state != THREAD_FINISHED) {
     1515        // Wait for the tick (keepalive) thread if its been started
     1516        if (libtrace->keepalive_thread.type == THREAD_KEEPALIVE && libtrace->keepalive_thread.state == THREAD_RUNNING) {
    15151517                libtrace_message_t msg = {0};
    15161518                msg.code = MESSAGE_DO_STOP;
     
    15181520                trace_send_message_to_thread(libtrace, &libtrace->keepalive_thread, &msg);
    15191521                pthread_join(libtrace->keepalive_thread.tid, NULL);
    1520         }
    1521         fprintf(stderr, "Joined with with the keepalive\n");
    1522        
    1523 
     1522                fprintf(stderr, "Joined with with the keepalive\n");
     1523        }
    15241524        // Lets mark this as done for now
    1525         libtrace->joined = true;
     1525        libtrace->state = STATE_JOINED;
    15261526}
    15271527
     
    17721772                while ((live_count == libtrace->perpkt_thread_count) || (live_count &&
    17731773                                ((flags & REDUCE_SEQUENTIAL && min_key == libtrace->expected_key) ||
    1774                                 libtrace->joined))) {
     1774                                libtrace->state == STATE_JOINED))) {
    17751775                        /* Get the minimum queue and then do stuff */
    17761776                        libtrace_result_t r;
     
    18581858        UNUSED int ret = -1;
    18591859        switch (option) {
     1860                case TRACE_OPTION_TICK_INTERVAL:
     1861                        libtrace->tick_interval = *((int *) value);
     1862                        return 1;
    18601863                case TRACE_OPTION_SET_HASHER:
    18611864                        return trace_set_hasher(libtrace, (enum hasher_types) *((int *) value), NULL, NULL);
     
    19291932        }
    19301933}
     1934
     1935DLLEXPORT libtrace_info_t *trace_get_information(libtrace_t * libtrace) {
     1936        if (libtrace->format)
     1937                return &libtrace->format->info;
     1938        else
     1939                return NULL;
     1940}
  • tools/tracertstats/tracertstats_parallel.c

    r82facc5 rb13b939  
    158158                result_t * res = libtrace_result_get_value(&result);
    159159                static result_t *  last_res = NULL;
     160                // Memory manager might falsely trigger this
    160161                assert(res != last_res);
    161162                last_res = res;
     
    207208                while (packet_interval != UINT64_MAX && last_ts<ts) {
    208209                        // Publish and make a new one new
    209                         fprintf(stderr, "Publishing result %"PRIu64"\n", last_ts);
     210                        //fprintf(stderr, "Publishing result %"PRIu64"\n", last_ts);
    210211                        trace_publish_result(trace, (uint64_t) last_ts, results);
    211212                        trace_post_reduce(trace);
     
    258259                                        next_update_time = (last_ts*packet_interval + packet_interval) * 1000000 + offset;
    259260                                        if (next_update_time <= mesg->additional.uint64) {
    260                                                 fprintf(stderr, "Got a tick and publishing early!!\n");
     261                                                //fprintf(stderr, "Got a tick and publishing early!!\n");
    261262                                                trace_publish_result(trace, (uint64_t) last_ts, results);
    262263                                                trace_post_reduce(trace);
     
    264265                                                last_ts++;
    265266                                        } else {
    266                                                 fprintf(stderr, "Got a tick but no publish ...\n");
     267                                                //fprintf(stderr, "Got a tick but no publish ...\n");
    267268                                        }
    268269                                } else {
    269                                         fprintf(stderr, "Got a tick but no packets seen yet!!!\n");
     270                                        //fprintf(stderr, "Got a tick but no packets seen yet!!!\n");
    270271                                }
    271272                        }
     
    309310        int i = 1;
    310311        trace_parallel_config(trace, TRACE_OPTION_ORDERED, &i);
    311         trace_parallel_config(trace, TRACE_OPTION_TRACETIME, &i);
    312         trace_set_hasher(trace, HASHER_CUSTOM, &bad_hash, NULL);
    313 #if TRACE_TIME
    314         if (trace_pstart(trace, NULL, &per_packet_tracetime, NULL)==-1) {
    315 #else
     312        /* trace_parallel_config(trace, TRACE_OPTION_TRACETIME, &i); */
     313        //trace_set_hasher(trace, HASHER_CUSTOM, &bad_hash, NULL);
     314
     315        if (trace_get_information(trace)->live) {
     316                i = (int) (packet_interval * 1000); // Every interval send a tick
     317                trace_parallel_config(trace, TRACE_OPTION_TICK_INTERVAL, &i);
     318        }
     319
    316320        if (trace_pstart(trace, NULL, &per_packet, NULL)==-1) {
    317 #endif
    318321                trace_perror(trace,"Failed to start trace");
    319322                trace_destroy(trace);
     
    462465
    463466
    464         return 0;
    465 }
     467        return 0;
     468}
Note: See TracChangeset for help on using the changeset viewer.