linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Tzvetomir Stoyanov <tstoyanov@vmware.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jiri Olsa <jolsa@redhat.com>,
	linux-trace-devel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 34/73] tools lib traceevent: Man pages for event find APIs
Date: Fri, 17 May 2019 16:35:32 -0300	[thread overview]
Message-ID: <20190517193611.4974-35-acme@kernel.org> (raw)
In-Reply-To: <20190517193611.4974-1-acme@kernel.org>

From: Tzvetomir Stoyanov <tstoyanov@vmware.com>

Create man pages for libtraceevent APIs:

  tep_find_event()
  tep_find_event_by_name()
  tep_find_event_by_record()

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>
Cc: linux-trace-devel@vger.kernel.org
Link: http://lore.kernel.org/linux-trace-devel/20190503091119.23399-15-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190510200108.197407057@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 .../libtraceevent-event_find.txt              | 103 ++++++++++++++++++
 1 file changed, 103 insertions(+)
 create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt

diff --git a/tools/lib/traceevent/Documentation/libtraceevent-event_find.txt b/tools/lib/traceevent/Documentation/libtraceevent-event_find.txt
new file mode 100644
index 000000000000..7bc062c9f76f
--- /dev/null
+++ b/tools/lib/traceevent/Documentation/libtraceevent-event_find.txt
@@ -0,0 +1,103 @@
+libtraceevent(3)
+================
+
+NAME
+----
+tep_find_event,tep_find_event_by_name,tep_find_event_by_record -
+Find events by given key.
+
+SYNOPSIS
+--------
+[verse]
+--
+*#include <event-parse.h>*
+
+struct tep_event pass:[*]*tep_find_event*(struct tep_handle pass:[*]_tep_, int _id_);
+struct tep_event pass:[*]*tep_find_event_by_name*(struct tep_handle pass:[*]_tep_, const char pass:[*]_sys_, const char pass:[*]_name_);
+struct tep_event pass:[*]*tep_find_event_by_record*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_record_);
+--
+
+DESCRIPTION
+-----------
+This set of functions can be used to search for an event, based on a given
+criteria. All functions require a pointer to a _tep_, trace event parser
+context.
+
+The _tep_find_event()_ function searches for an event by given event _id_. The
+event ID is assigned dynamically and can be viewed in event's format file,
+"ID" field.
+
+The tep_find_event_by_name()_ function searches for an event by given
+event _name_, under the system _sys_. If the _sys_ is NULL (not specified),
+the first event with _name_ is returned.
+
+The tep_find_event_by_record()_ function searches for an event from a given
+_record_.
+
+RETURN VALUE
+------------
+All these functions return a pointer to the found event, or NULL if there is no
+such event.
+
+EXAMPLE
+-------
+[source,c]
+--
+#include <event-parse.h>
+...
+struct tep_handle *tep = tep_alloc();
+...
+struct tep_event *event;
+
+event = tep_find_event(tep, 1857);
+if (event == NULL) {
+	/* There is no event with ID 1857 */
+}
+
+event = tep_find_event_by_name(tep, "kvm", "kvm_exit");
+if (event == NULL) {
+	/* There is no kvm_exit event, from kvm system */
+}
+
+void event_from_record(struct tep_record *record)
+{
+ struct tep_event *event = tep_find_event_by_record(tep, record);
+	if (event == NULL) {
+		/* There is no event from given record */
+	}
+}
+...
+--
+
+FILES
+-----
+[verse]
+--
+*event-parse.h*
+	Header file to include in order to have access to the library APIs.
+*-ltraceevent*
+	Linker switch to add when building a program that uses the library.
+--
+
+SEE ALSO
+--------
+_libtraceevent(3)_, _trace-cmd(1)_
+
+AUTHOR
+------
+[verse]
+--
+*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
+*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
+--
+REPORTING BUGS
+--------------
+Report bugs to  <linux-trace-devel@vger.kernel.org>
+
+LICENSE
+-------
+libtraceevent is Free Software licensed under the GNU LGPL 2.1
+
+RESOURCES
+---------
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
-- 
2.20.1


  parent reply	other threads:[~2019-05-17 19:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190517193611.4974-1-acme@kernel.org>
2019-05-17 19:35 ` [PATCH 21/73] tools lib traceevent: Introduce man pages Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 22/73] tools lib traceevent: Add support for man pages with multiple names Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 23/73] tools lib traceevent: Man pages for tep_handler related APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 24/73] tools lib traceevent: Man page for header_page APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 25/73] tools lib traceevent: Man page for get/set cpus APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 26/73] tools lib traceevent: Man page for file endian APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 27/73] tools lib traceevent: Man page for host " Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 28/73] tools lib traceevent: Man page for page size APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 29/73] tools lib traceevent: Man page for tep_strerror() Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 30/73] tools lib traceevent: Man pages for event handler APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 31/73] tools lib traceevent: Man pages for function related libtraceevent APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 32/73] tools lib traceevent: Man pages for registering print function Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 33/73] tools lib traceevent: Man page for tep_read_number() Arnaldo Carvalho de Melo
2019-05-17 19:35 ` Arnaldo Carvalho de Melo [this message]
2019-05-17 19:35 ` [PATCH 35/73] tools lib traceevent: Man page for list events APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 36/73] tools lib traceevent: Man pages for libtraceevent event get APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 37/73] tools lib traceevent: Man pages for find field APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 38/73] tools lib traceevent: Man pages for get field value APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 39/73] tools lib traceevent: Man pages for print field APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 40/73] tools lib traceevent: Man page for tep_read_number_field() Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 41/73] tools lib traceevent: Man pages for event fields APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 42/73] tools lib traceevent: Man pages for event filter APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 43/73] tools lib traceevent: Man pages for parse event APIs Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 44/73] tools lib traceevent: Man page for tep_parse_header_page() Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 45/73] tools lib traceevent: Man pages for APIs used to extract common fields from a record Arnaldo Carvalho de Melo
2019-05-17 19:35 ` [PATCH 46/73] tools lib traceevent: Man pages for trace sequences APIs Arnaldo Carvalho de Melo

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=20190517193611.4974-35-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tstoyanov@vmware.com \
    --cc=williams@redhat.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).