diff mbox series

[v4,45/46] tools/lib/traceevent: Man pages for trace_seq_putc() and trace_seq_puts()

Message ID 20190308133654.21264-46-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 trace_seq_putc() and trace_seq_puts()
as part of the libtraceevent APIs.

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

Comments

Steven Rostedt March 14, 2019, 2:58 a.m. UTC | #1
On Fri,  8 Mar 2019 15:36:53 +0200
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> Create man pages for trace_seq_putc() and trace_seq_puts()
> as part of the libtraceevent APIs.
> 

I think all the trace_seq_* functions can be put in the same man pages,
and given a nice example on how to use them.

-- Steve
diff mbox series

Patch

diff --git a/tools/lib/traceevent/Documentation/libtraceevent-tseq_put.txt b/tools/lib/traceevent/Documentation/libtraceevent-tseq_put.txt
new file mode 100644
index 000000000000..d14d7791d0ef
--- /dev/null
+++ b/tools/lib/traceevent/Documentation/libtraceevent-tseq_put.txt
@@ -0,0 +1,89 @@ 
+libtraceevent(3)
+================
+
+NAME
+----
+trace_seq_putc,trace_seq_puts - Put string / character in  a trace sequence.
+
+SYNOPSIS
+--------
+[verse]
+--
+*#include <event-parse.h>*
+*#include <trace-seq.h>*
+
+int *trace_seq_putc*(struct trace_seq pass:[*]_s_, unsigned char _c_);
+int *trace_seq_puts*(struct trace_seq pass:[*]_s_, const char pass:[*]_str_);
+--
+
+DESCRIPTION
+-----------
+Trace sequences are used to allow a function to call several other functions
+to create a string of data to use.
+
+The _trace_seq_putc()_ function puts a single character _c_ in the trace
+sequence _s_.
+
+The _trace_seq_puts()_ function puts a NULL terminated string _str_ in the
+trace sequence _s_.
+
+RETURN VALUE
+------------
+Both _trace_seq_putc()_ and _trace_seq_puts()_ functions return the number of
+characters put in the trace sequence, or 0 in case of an error.
+
+EXAMPLE
+-------
+[source,c]
+--
+#include <event-parse.h>
+#include <trace-seq.h>
+...
+struct trace_seq seq;
+trace_seq_init(&seq);
+...
+if (trace_seq_putc(&seq, ';') != 1) {
+	/* Failed to put ';' in the trace sequence */
+}
+...
+char *str = " foo ";
+if (trace_seq_puts(&seq, str) != strlen(str)) {
+	/* Failed to put " foo " in the trace sequence */
+}
+...
+--
+
+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.
+*-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