linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tzvetomir Stoyanov <tstoyanov@vmware.com>
To: "rostedt@goodmis.org" <rostedt@goodmis.org>
Cc: "linux-trace-devel@vger.kernel.org" <linux-trace-devel@vger.kernel.org>
Subject: [PATCH 2/2] tools/lib/traceevent: make few libtraceevent internal variables to be per thread
Date: Fri, 30 Nov 2018 13:13:09 +0000	[thread overview]
Message-ID: <20181130131254.32621-3-tstoyanov@vmware.com> (raw)
In-Reply-To: <20181130131254.32621-1-tstoyanov@vmware.com>

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>
---
 tools/lib/traceevent/event-parse.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 8f19dcdd06ec..f6c926467fa3 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -42,9 +42,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;
-- 
2.19.1

  parent reply	other threads:[~2018-12-01  0:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 13:13 [PATCH 0/2] convert traceevent into a thread safe library Tzvetomir Stoyanov
2018-11-30 13:13 ` [PATCH 1/2] tools/lib/traceevent: make libtraceevent thread safe Tzvetomir Stoyanov
2018-11-30 13:13 ` Tzvetomir Stoyanov [this message]
2018-11-30 16:47 ` [PATCH 0/2] convert traceevent into a thread safe library Steven Rostedt
2018-12-05  9:22 Tzvetomir Stoyanov
2018-12-05  9:22 ` [PATCH 2/2] tools/lib/traceevent: make few libtraceevent internal variables to be per thread Tzvetomir Stoyanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181130131254.32621-3-tstoyanov@vmware.com \
    --to=tstoyanov@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).