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
Subject: Re: [PATCH 1/3] tools/lib/traceevent: Implemented new API tep_ref_get()
Date: Mon, 19 Nov 2018 22:54:04 -0500	[thread overview]
Message-ID: <20181119225404.6a10fe56@vmware.local.home> (raw)
In-Reply-To: <20180928071940.29810-2-tstoyanov@vmware.com>

On Fri, 28 Sep 2018 10:19:38 +0300
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> This patch implements new API of the tracevent library:
> int tep_ref_get(struct tep_handle *pevent);
> The API returns the reference counter "ref_count" of the tep handler.
> As "struct tep_handle" is internal only, its members cannot be accessed
> by the library users, the API is used to get the reference counter.
> 
> Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> ---
>  tools/lib/traceevent/event-parse.c | 7 +++++++
>  tools/lib/traceevent/event-parse.h | 1 +
>  2 files changed, 8 insertions(+)
> 
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index f327c990dedc..aa26d0e7c074 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -6774,6 +6774,13 @@ void tep_ref(struct tep_handle *pevent)
>  	pevent->ref_count++;
>  }
>  
> +int tep_ref_get(struct tep_handle *pevent)

Hmm, I'm thinking we should call this "tep_get_ref" as that fits more
the naming convention of the Linux kernel.

-- Steve


> +{
> +	if (pevent)
> +		return pevent->ref_count;
> +	return 0;
> +}
> +
>  void tep_free_format_field(struct tep_format_field *field)
>  {
>  	free(field->type);
> diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
> index 100b0b7b29fc..cda21a67160e 100644
> --- a/tools/lib/traceevent/event-parse.h
> +++ b/tools/lib/traceevent/event-parse.h
> @@ -577,6 +577,7 @@ struct tep_handle *tep_alloc(void);
>  void tep_free(struct tep_handle *pevent);
>  void tep_ref(struct tep_handle *pevent);
>  void tep_unref(struct tep_handle *pevent);
> +int tep_ref_get(struct tep_handle *pevent);
>  
>  /* access to the internal parser */
>  void tep_buffer_init(const char *buf, unsigned long long size);

  reply	other threads:[~2018-11-20 14:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28  7:19 [PATCH 0/3] libtraceevent: Added support for pkg-config and few other fixes related to transfoming traceevent into a library Tzvetomir Stoyanov
2018-09-28  7:19 ` [PATCH 1/3] tools/lib/traceevent: Implemented new API tep_ref_get() Tzvetomir Stoyanov
2018-11-20  3:54   ` Steven Rostedt [this message]
2018-11-20  8:05     ` Tzvetomir Stoyanov
2018-09-28  7:19 ` [PATCH 2/3] tools/lib/traceevent: Added support for pkg-config Tzvetomir Stoyanov
2018-09-28  8:11   ` Slavomir Kaslev
2018-11-20  4:01   ` Steven Rostedt
2018-09-28  7:19 ` [PATCH 3/3] tools/lib/traceevent: Install trace-seq.h API header file 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=20181119225404.6a10fe56@vmware.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).