From patchwork Fri Nov 30 13:13:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10760079 Return-Path: Received: from mail-eopbgr720049.outbound.protection.outlook.com ([40.107.72.49]:20658 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726070AbeLAAWn (ORCPT ); Fri, 30 Nov 2018 19:22:43 -0500 From: Tzvetomir Stoyanov To: "rostedt@goodmis.org" CC: "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 Message-ID: <20181130131254.32621-3-tstoyanov@vmware.com> References: <20181130131254.32621-1-tstoyanov@vmware.com> In-Reply-To: <20181130131254.32621-1-tstoyanov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 1086 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 --- 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;