Changeset bab946c for tools/tracestats/tracestats.c
- Timestamp:
- 01/15/19 16:47:20 (2 years ago)
- Branches:
- develop
- Children:
- e9fe6ac
- Parents:
- edd0448
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracestats/tracestats.c
r02d13cb rbab946c 54 54 #include <pthread.h> 55 55 56 struct libtrace_t * trace = NULL;56 struct libtrace_t *inptrace = NULL; 57 57 58 58 static void cleanup_signal(int signal UNUSED) 59 59 { 60 if ( trace)61 trace_pstop( trace);60 if (inptrace) 61 trace_pstop(inptrace); 62 62 } 63 63 … … 196 196 libtrace_callback_set_t *pktcbs, *rescbs; 197 197 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"); 202 202 return; 203 203 } … … 214 214 215 215 if (threadcount != 0) 216 trace_set_perpkt_threads( trace, threadcount);216 trace_set_perpkt_threads(inptrace, threadcount); 217 217 218 218 /* 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"); 221 221 return; 222 222 } 223 223 224 224 /* 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); 231 231 trace_destroy_callback_set(pktcbs); 232 232 trace_destroy_callback_set(rescbs);
Note: See TracChangeset
for help on using the changeset viewer.