linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: "linux-trace-devel@vger.kernel.org" <linux-trace-devel@vger.kernel.org>
Subject: Re: [POC][PATCH v4] tools/lib/traceevent: make libtraceevent thread safe
Date: Thu, 29 Nov 2018 11:05:49 -0500	[thread overview]
Message-ID: <20181129110549.5039c7ce@gandalf.local.home> (raw)
In-Reply-To: <20181129122330.22500-1-tstoyanov@vmware.com>

On Thu, 29 Nov 2018 12:23:42 +0000
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> This patch is a PoC about transforming libtraceevent
> into a thread safe library. It implements per thread local
> storage and internal APIs to access it. It covers only
> tep->last_event cache, but easily can be extended with all
> library's thread sensitive data.
> 
> Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> ---
> v2: Added local thread data per tep context
> v3: Implemented APIs to access specific tread local data,
>     instead of the whole struct tep_thread_data.
> v4: Simplify the implementation to keep cache only for the last
>     used tep context in current thread, instead to track
>     cache for all tep contexts. Remove "tep_" prefix of functions,
>     as these are internal APIs and are not going to be exposed to
>     the library users.
> ---
>  tools/lib/traceevent/event-parse-local.h  | 16 ++++--
>  tools/lib/traceevent/event-parse-thread.c | 62 +++++++++++++++++++++++
>  tools/lib/traceevent/event-parse.c        | 21 ++++----
>  3 files changed, 87 insertions(+), 12 deletions(-)
>  create mode 100644 tools/lib/traceevent/event-parse-thread.c
> 
> diff --git a/tools/lib/traceevent/event-parse-local.h b/tools/lib/traceevent/event-parse-local.h
> index 9a092dd4a86d..bf3f810ce02f 100644
> --- a/tools/lib/traceevent/event-parse-local.h
> +++ b/tools/lib/traceevent/event-parse-local.h
> @@ -14,6 +14,13 @@ struct func_list;
>  struct event_handler;
>  struct func_resolver;
>  
> +/* cache */
> +struct tep_thread_data {
> +	struct tep_handle *tep;
> +
> +	struct tep_event *last_event;

Small nit. The space between tep and last_event isn't needed.

> +};
> +

The rest looks good. Care to send a non POC patch?

Thanks!

-- Steve

      reply	other threads:[~2018-11-30  3:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 12:23 [POC][PATCH v4] tools/lib/traceevent: make libtraceevent thread safe Tzvetomir Stoyanov
2018-11-29 16:05 ` Steven Rostedt [this message]

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=20181129110549.5039c7ce@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tstoyanov@vmware.com \
    /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).