From patchwork Tue Nov 27 15:42:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10759929 Return-Path: Received: from mail-eopbgr730072.outbound.protection.outlook.com ([40.107.73.72]:22643 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729309AbeK1Ckz (ORCPT ); Tue, 27 Nov 2018 21:40:55 -0500 From: Tzvetomir Stoyanov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH v3 15/46] tools/lib/traceevent: Man pages for tep_register_function() and tep_register_print_string() Date: Tue, 27 Nov 2018 15:42:25 +0000 Message-ID: <20181127154153.11315-16-tstoyanov@vmware.com> References: <20181127154153.11315-1-tstoyanov@vmware.com> In-Reply-To: <20181127154153.11315-1-tstoyanov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 3417 Create man pages for tep_register_function() and tep_register_print_string() as part of the libtraceevent APIs. Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-reg_funcstr.txt | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_funcstr.txt 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 * + +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 +... +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* , author of *libtraceevent*. +*Tzvetomir Stoyanov* , author of this man page. +-- +REPORTING BUGS +-------------- +Report bugs to + +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