diff mbox series

[03/34] tools/lib/traceevent: Man pages for tep_register_function() and tep_register_print_string()

Message ID 20181119125357.19449-4-tstoyanov@vmware.com (mailing list archive)
State Superseded
Headers show
Series A lot of libtraceevent man pages | expand

Commit Message

Tzvetomir Stoyanov Nov. 19, 2018, 12:54 p.m. UTC
Create man pages for tep_register_function() and tep_register_print_string()
as part of the libtraceevent APIs.

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

Patch

diff --git a/tools/lib/traceevent/Documentation/libtraceevent-reg_funcstr.txt b/tools/lib/traceevent/Documentation/libtraceevent-reg_funcstr.txt
new file mode 100644
index 000000000000..b0e196a1e47b
--- /dev/null
+++ b/tools/lib/traceevent/Documentation/libtraceevent-reg_funcstr.txt
@@ -0,0 +1,89 @@ 
+libtraceevent(3)
+================
+
+NAME
+----
+tep_register_function, tep_register_print_string - Registers a function / string 
+with a given address.
+
+SYNOPSIS
+--------
+[verse]
+--
+*#include <event-parse.h>*
+
+int *tep_register_function*(struct tep_handle pass:[*]_tep_, char pass:[*]_name_, unsigned long long _addr_, char pass:[*]_mod_);
+int *tep_register_print_string*(struct tep_handle pass:[*]_tep_, const char pass:[*]_fmt_, unsigned long long _addr_);
+--
+
+DESCRIPTION
+-----------
+The _tep_register_function()_ function registers a function name with an 
+address and module. The _tep_ argument is the trace event parser context. The 
+_name_ is the name of the function, the string is copied internally. The _addr_ 
+is the start address of the function. The _mod_ is the kernel module 
+the function may be in (NULL for none). 
+
+The _tep_register_print_string()_ function  registers a string by the address 
+it was stored in the kernel. The _tep_ argument is the trace event parser 
+context. The _fmt_ is the string to register, it is copied internally. The _addr_ 
+is the address the string was located at.
+
+RETURN VALUE
+------------
+The _tep_register_function()_ function returns 0 in case of success. In case of 
+an error -1 is returned, and errno is set to the appropriate error number.
+
+The _tep_register_print_string()_ function returns 0 in case of success. In case 
+of an error -1 is returned, and errno is set to the appropriate error number.
+
+EXAMPLE
+-------
+[source,c]
+--
+#include <event-parse.h>
+...
+struct tep_handle *tep = tep_alloc();
+...
+	if (tep_register_function(tep, "my_custom_func",
+			  	 (unsigned long long) 0x12345678, NULL) != 0) {
+		/* Failed to register my_custom_func address mapping */
+	}
+...
+	if (tep_register_print_string(tep, "print string",
+			  	 (unsigned long long) 0x87654321, NULL) != 0) {
+		/* Failed to register "print string" address mapping */
+	}
+--
+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