diff mbox series

[v4,20/46] tools/lib/traceevent: Man pages for tep_print_event(), tep_print_event_data(), tep_event_info(), tep_print_event_task() and tep_print_event_time()

Message ID 20190308133654.21264-21-tstoyanov@vmware.com (mailing list archive)
State Superseded
Headers show
Series Libtraceevent MAN pages | expand

Commit Message

Tzvetomir Stoyanov March 8, 2019, 1:36 p.m. UTC
Create man pages for tep_print_event(), tep_print_event_data(),
tep_event_info(), tep_print_event_task() and tep_print_event_time()
as part of the libtraceevent APIs.

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
---
 .../libtraceevent-event_print.txt             | 126 ++++++++++++++++++
 1 file changed, 126 insertions(+)
 create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt

Comments

Steven Rostedt March 13, 2019, 5:33 p.m. UTC | #1
On Fri,  8 Mar 2019 15:36:28 +0200
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> Create man pages for tep_print_event(), tep_print_event_data(),
> tep_event_info(), tep_print_event_task() and tep_print_event_time()
> as part of the libtraceevent APIs.
> 
> Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> ---
>  .../libtraceevent-event_print.txt             | 126 ++++++++++++++++++
>  1 file changed, 126 insertions(+)
>  create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt
> 
> diff --git a/tools/lib/traceevent/Documentation/libtraceevent-event_print.txt b/tools/lib/traceevent/Documentation/libtraceevent-event_print.txt
> new file mode 100644
> index 000000000000..8fea72705645
> --- /dev/null
> +++ b/tools/lib/traceevent/Documentation/libtraceevent-event_print.txt
> @@ -0,0 +1,126 @@
> +libtraceevent(3)
> +================
> +
> +NAME
> +----
> +tep_print_event,tep_print_event_data,tep_event_info,tep_print_event_task,tep_print_event_time - Parses the data into the print format.
> +
> +SYNOPSIS
> +--------
> +[verse]
> +--
> +*#include <event-parse.h>*
> +*#include <trace-seq.h>*
> +
> +void *tep_print_event_time*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]record, bool _use_trace_clock_);
> +void *tep_print_event_task*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_);
> +void *tep_event_info*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_);
> +void *tep_print_event_data*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_);
> +void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_, bool _use_trace_clock_);
> +--
> +
> +DESCRIPTION
> +-----------
> +The _tep_print_event_time()_ function prints the timestamp of the _record_ using
> +the given _event_ information as trace sequence in _s_.

The above should be worded different, as it sounds like it gets the
information from _s_.

Should say "writes the timestamp of the given _record_ into the trace
sequence _s_."


> The _tep_ argument is
> +trace event parser context. The _use_trace_clock_ argument indicates if
> +the tep->trace_clock should be used for parsing the timestamp.
> +
> +The _tep_print_event_task()_ function prints the task command, pid and CPU of
> +the _record_ using the given _event_ information as trace sequence in _s_.

Same here.

> +The _tep_ argument is trace event parser context.
> +
> +The _tep_event_info()_ function parses the raw data from the _record_ using
> +the given _event_ information and writes the print format as trace sequence in
> +_s_.

The above is correct and what the other two should look like.

> +
> +The _tep_print_event_data()_ function writes the _event_ name  as trace
> +sequence in _s_ and calls _tep_event_info()_ to parse and write the raw data
> +from the _record_. The _tep_ argument is trace event parser context.

The above needs to be fixed.

> +
> +The _tep_print_event()_ function prints the _record_ information as trace
> +sequence in _s_. It finds the corresponding event and calls

The above needs to be fixed.

-- Steve

> +_tep_print_event_task()_,_tep_print_event_time()_ and _tep_print_event_data()_
> +to parse and print the information.
> +The _tep_ argument is trace event parser context. The _use_trace_clock_
> +argument indicates if the tep->trace_clock should be used for parsing
> +the timestamp.
> +
diff mbox series

Patch

diff --git a/tools/lib/traceevent/Documentation/libtraceevent-event_print.txt b/tools/lib/traceevent/Documentation/libtraceevent-event_print.txt
new file mode 100644
index 000000000000..8fea72705645
--- /dev/null
+++ b/tools/lib/traceevent/Documentation/libtraceevent-event_print.txt
@@ -0,0 +1,126 @@ 
+libtraceevent(3)
+================
+
+NAME
+----
+tep_print_event,tep_print_event_data,tep_event_info,tep_print_event_task,tep_print_event_time - Parses the data into the print format.
+
+SYNOPSIS
+--------
+[verse]
+--
+*#include <event-parse.h>*
+*#include <trace-seq.h>*
+
+void *tep_print_event_time*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]record, bool _use_trace_clock_);
+void *tep_print_event_task*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_);
+void *tep_event_info*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_);
+void *tep_print_event_data*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_);
+void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_, bool _use_trace_clock_);
+--
+
+DESCRIPTION
+-----------
+The _tep_print_event_time()_ function prints the timestamp of the _record_ using
+the given _event_ information as trace sequence in _s_. The _tep_ argument is
+trace event parser context. The _use_trace_clock_ argument indicates if
+the tep->trace_clock should be used for parsing the timestamp.
+
+The _tep_print_event_task()_ function prints the task command, pid and CPU of
+the _record_ using the given _event_ information as trace sequence in _s_.
+The _tep_ argument is trace event parser context.
+
+The _tep_event_info()_ function parses the raw data from the _record_ using
+the given _event_ information and writes the print format as trace sequence in
+_s_.
+
+The _tep_print_event_data()_ function writes the _event_ name  as trace
+sequence in _s_ and calls _tep_event_info()_ to parse and write the raw data
+from the _record_. The _tep_ argument is trace event parser context.
+
+The _tep_print_event()_ function prints the _record_ information as trace
+sequence in _s_. It finds the corresponding event and calls
+_tep_print_event_task()_,_tep_print_event_time()_ and _tep_print_event_data()_
+to parse and print the information.
+The _tep_ argument is trace event parser context. The _use_trace_clock_
+argument indicates if the tep->trace_clock should be used for parsing
+the timestamp.
+
+EXAMPLE
+-------
+[source,c]
+--
+#include <event-parse.h>
+#include <trace-seq.h>
+...
+struct trace_seq seq;
+trace_seq_init(&seq);
+struct tep_handle *tep = tep_alloc();
+...
+void print_my_event(struct tep_record *record)
+{
+	struct tep_event *event;
+
+	/* print all event information */
+	trace_seq_reset(&seq);
+	tep_print_event(tep, &seq, record, TRUE);
+
+	event = tep_find_event_by_record(tep, record);
+
+	if (event != NULL) {
+		/* print event timestamp */
+		trace_seq_reset(&seq);
+		tep_print_event_time(tep, &seq, event, record, TRUE);
+
+		/* print event task information */
+		trace_seq_reset(&seq);
+		tep_print_event_task(tep, &seq, event, record);
+
+		/* print event name and raw data */
+		trace_seq_reset(&seq);
+		tep_print_event_data(tep, &seq, event, record);
+
+		/* print event raw data */
+		trace_seq_reset(&seq);
+		tep_event_info(&seq, event, record);
+	}
+}
+...
+--
+
+FILES
+-----
+[verse]
+--
+*event-parse.h*
+	Header file to include in order to have access to the library APIs.
+*trace-seq.h*
+	Header file to include in order to have access to trace sequences related APIs.
+	Trace sequences are used to allow a function to call several other functions
+	to create a string of data to use.
+*-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