[2/2] tools/lib/traceevent: make few libtraceevent internal variables to be per thread
diff mbox series

Message ID 20181205092200.2291-3-tstoyanov@vmware.com
State New
Headers show
Series
  • convert traceevent into a thread safe library
Related show

Commit Message

Tzvetomir Stoyanov Dec. 5, 2018, 9:22 a.m. UTC
This patch continues the effort to transform libtraceevent
into a thread safe library. It converts input_buf, input_buf_ptr
and input_buf_siz internal variables to be thread specific. This
buffer is not related to a specific tep context. It is used
internally by the library during the parsing of various strings.

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
---
 lib/traceevent/event-parse.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index cacdcc4..1cab1a5 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -28,9 +28,9 @@ 
 #include "event-utils.h"
 #include "trace-seq.h"
 
-static const char *input_buf;
-static unsigned long long input_buf_ptr;
-static unsigned long long input_buf_siz;
+static __thread const char *input_buf;
+static __thread unsigned long long input_buf_ptr;
+static __thread unsigned long long input_buf_siz;
 
 static int is_flag_field;
 static int is_symbolic_field;