linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Tzvetomir Stoyanov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org,
	tglx@linutronix.de, jolsa@redhat.com, namhyung@kernel.org,
	rostedt@goodmis.org, akpm@linux-foundation.org, hpa@zytor.com,
	tstoyanov@vmware.com, mingo@kernel.org
Subject: [tip:perf/core] tools lib traceevent: Implement new API tep_get_ref()
Date: Fri, 14 Dec 2018 12:34:16 -0800	[thread overview]
Message-ID: <tip-c1f71ed8f5d1bb8d048c54c509ee9b08878900c6@git.kernel.org> (raw)
In-Reply-To: <20181130154646.890615385@goodmis.org>

Commit-ID:  c1f71ed8f5d1bb8d048c54c509ee9b08878900c6
Gitweb:     https://git.kernel.org/tip/c1f71ed8f5d1bb8d048c54c509ee9b08878900c6
Author:     Tzvetomir Stoyanov <tstoyanov@vmware.com>
AuthorDate: Fri, 30 Nov 2018 10:44:04 -0500
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 30 Nov 2018 17:14:52 -0300

tools lib traceevent: Implement new API tep_get_ref()

This patch implements a new API of the tracevent library:

  int tep_get_ref(struct tep_handle *tep);

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>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20181130154646.890615385@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 2b5cb33046ce..d1e6ee3d43cf 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -6730,6 +6730,13 @@ void tep_ref(struct tep_handle *pevent)
 	pevent->ref_count++;
 }
 
+int tep_get_ref(struct tep_handle *tep)
+{
+	if (tep)
+		return tep->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 16bf4c890b6f..44ec26c72c2e 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -581,6 +581,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_get_ref(struct tep_handle *tep);
 
 /* access to the internal parser */
 void tep_buffer_init(const char *buf, unsigned long long size);

  reply	other threads:[~2018-12-14 20:34 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 15:44 [PATCH 0/9] tools/lib/traceevent: More udpates to make libtraceevent into a library Steven Rostedt
2018-11-30 15:44 ` [PATCH 1/9] tools/lib/traceevent: Implemented new API tep_get_ref() Steven Rostedt
2018-12-14 20:34   ` tip-bot for Tzvetomir Stoyanov [this message]
2018-12-18 14:01   ` [tip:perf/core] tools lib traceevent: Implement " tip-bot for Tzvetomir Stoyanov
2018-11-30 15:44 ` [PATCH 2/9] tools/lib/traceevent: Added support for pkg-config Steven Rostedt
2018-12-04  7:32   ` Namhyung Kim
2018-12-04  8:51     ` Tzvetomir Stoyanov
2018-12-04 17:27     ` Steven Rostedt
2018-12-14 20:34   ` [tip:perf/core] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov
2018-12-18 14:01   ` tip-bot for Tzvetomir Stoyanov
2018-11-30 15:44 ` [PATCH 3/9] tools/lib/traceevent: Install trace-seq.h API header file Steven Rostedt
2018-12-04  7:47   ` Namhyung Kim
2018-12-04 19:41     ` Steven Rostedt
2018-12-05 12:25       ` Jiri Olsa
2018-12-05 17:03         ` Steven Rostedt
2018-12-05 17:22           ` Jiri Olsa
2018-12-14 20:35   ` [tip:perf/core] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov
2018-12-18 14:02   ` tip-bot for Tzvetomir Stoyanov
2018-11-30 15:44 ` [PATCH 4/9] tools/lib/traceevent, tools/perf: Rename struct tep_event_format to struct tep_event Steven Rostedt
2018-12-14 20:36   ` [tip:perf/core] tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' tip-bot for Tzvetomir Stoyanov
2018-12-18 14:02   ` tip-bot for Tzvetomir Stoyanov
2018-11-30 15:44 ` [PATCH 5/9] tools/lib/traceevent: Rename tep_free_format() to tep_free_event() Steven Rostedt
2018-12-14 20:36   ` [tip:perf/core] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov
2018-12-18 14:03   ` tip-bot for Tzvetomir Stoyanov
2018-11-30 15:44 ` [PATCH 6/9] tools/perf: traceevent API cleanup, remove __tep_data2host*() Steven Rostedt
2018-12-14 20:37   ` [tip:perf/core] perf tools: " tip-bot for Tzvetomir Stoyanov
2018-12-18 14:04   ` tip-bot for Tzvetomir Stoyanov
2018-11-30 15:44 ` [PATCH 7/9] tools/lib/traceevent: traceevent API cleanup Steven Rostedt
2018-11-30 19:18   ` Arnaldo Carvalho de Melo
2018-11-30 19:37     ` Steven Rostedt
2018-11-30 19:55       ` Arnaldo Carvalho de Melo
2018-11-30 19:57       ` Steven Rostedt
2018-11-30 20:09     ` Steven Rostedt
2018-11-30 20:16       ` Arnaldo Carvalho de Melo
2018-12-03 10:42         ` Arnaldo Carvalho de Melo
2018-12-14 20:37   ` [tip:perf/core] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov
2018-12-18 14:04   ` tip-bot for Tzvetomir Stoyanov
2018-11-30 15:44 ` [PATCH 8/9] tools/lib/traceevent: Introduce new libtracevent API: tep_override_comm() Steven Rostedt
2019-01-08 13:35   ` Arnaldo Carvalho de Melo
2019-01-09  7:12   ` [tip:perf/urgent] tools lib traceevent: " tip-bot for Tzvetomir Stoyanov
2018-11-30 15:44 ` [PATCH 9/9] tools/lib/traceevent: Add sanity check to is_timestamp_in_us() Steven Rostedt

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=tip-c1f71ed8f5d1bb8d048c54c509ee9b08878900c6@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --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).