Ignore:
Timestamp:
01/15/19 16:47:20 (22 months ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop
Children:
e9fe6ac
Parents:
edd0448
Message:

Fix clashes between global and local variable names in tools.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracestats/tracestats.c

    r02d13cb rbab946c  
    5454#include <pthread.h>
    5555
    56 struct libtrace_t *trace = NULL;
     56struct libtrace_t *inptrace = NULL;
    5757
    5858static void cleanup_signal(int signal UNUSED)
    5959{
    60         if (trace)
    61                 trace_pstop(trace);
     60        if (inptrace)
     61                trace_pstop(inptrace);
    6262}
    6363
     
    196196        libtrace_callback_set_t *pktcbs, *rescbs;
    197197
    198         trace = trace_create(uri);
    199 
    200         if (trace_is_err(trace)) {
    201                 trace_perror(trace,"Failed to create trace");
     198        inptrace = trace_create(uri);
     199
     200        if (trace_is_err(inptrace)) {
     201                trace_perror(inptrace,"Failed to create trace");
    202202                return;
    203203        }
     
    214214
    215215        if (threadcount != 0)
    216                 trace_set_perpkt_threads(trace, threadcount);
     216                trace_set_perpkt_threads(inptrace, threadcount);
    217217
    218218        /* Start the trace as a parallel trace */
    219         if (trace_pstart(trace, NULL, pktcbs, rescbs)==-1) {
    220                 trace_perror(trace,"Failed to start trace");
     219        if (trace_pstart(inptrace, NULL, pktcbs, rescbs)==-1) {
     220                trace_perror(inptrace,"Failed to start trace");
    221221                return;
    222222        }
    223223
    224224        /* Wait for all threads to stop */
    225         trace_join(trace);
    226 
    227         if (trace_is_err(trace))
    228                 trace_perror(trace,"%s",uri);
    229 
    230         trace_destroy(trace);
     225        trace_join(inptrace);
     226
     227        if (trace_is_err(inptrace))
     228                trace_perror(inptrace,"%s",uri);
     229
     230        trace_destroy(inptrace);
    231231        trace_destroy_callback_set(pktcbs);
    232232        trace_destroy_callback_set(rescbs);
Note: See TracChangeset for help on using the changeset viewer.