From patchwork Tue Nov 6 13:20:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10759659 Return-Path: Received: from mail-eopbgr710048.outbound.protection.outlook.com ([40.107.71.48]:16352 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388466AbeKFWqD (ORCPT ); Tue, 6 Nov 2018 17:46:03 -0500 From: Tzvetomir Stoyanov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 1/7] tools/lib/traceevent: Implement libtraceevent man pages Date: Tue, 6 Nov 2018 13:20:50 +0000 Message-ID: <20181106132035.7692-2-tstoyanov@vmware.com> References: <20181106132035.7692-1-tstoyanov@vmware.com> In-Reply-To: <20181106132035.7692-1-tstoyanov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 3103 This patch implements a man page, which documents tep_get_header_page_size() libtraceevent API Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-header_size.txt | 73 +++++++++++++++++++ tools/lib/traceevent/event-parse-api.c | 4 +- 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_size.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-header_size.txt b/tools/lib/traceevent/Documentation/libtraceevent-header_size.txt new file mode 100644 index 000000000000..8edf49d2a709 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-header_size.txt @@ -0,0 +1,73 @@ +libtraceevent(3) +================ + +NAME +---- +tep_get_header_page_size - Get the size of a long integer, in kernel context. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_get_header_page_size*(struct tep_handle pass:[*]_tep_); + +-- +DESCRIPTION +----------- +The _tep_get_header_page_size()_ function returns the size of a long integer, +in kernel context. The _tep_ argument is trace event parser context. +This information is retrieved from /sys/kernel/debug/tracing/events/header_page, + "commit" field. + +RETURN VALUE +------------ +The _tep_get_header_page_size()_ function returns the size of a long integer, +in bytes + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + int lsize = tep_get_header_page_size(tep); + printf ("The size of a long in kernel context is %d bytes", lsize); +... +-- + +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 diff --git a/tools/lib/traceevent/event-parse-api.c b/tools/lib/traceevent/event-parse-api.c index 6a1899b378b1..39e0fca2d9a2 100644 --- a/tools/lib/traceevent/event-parse-api.c +++ b/tools/lib/traceevent/event-parse-api.c @@ -100,10 +100,10 @@ tep_data2host8(struct tep_handle *pevent, unsigned long long data) } /** - * tep_get_header_page_size - get size of the header page + * tep_get_header_page_size - get the size of a long integer, in kernel context * @pevent: a handle to the tep_handle * - * This returns size of the header page + * This returns the size of a long integer, in kernel context * If @pevent is NULL, 0 is returned. */ int tep_get_header_page_size(struct tep_handle *pevent) From patchwork Tue Nov 6 13:20:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10759661 Return-Path: Received: from mail-eopbgr710048.outbound.protection.outlook.com ([40.107.71.48]:16352 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388447AbeKFWqE (ORCPT ); Tue, 6 Nov 2018 17:46:04 -0500 From: Tzvetomir Stoyanov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 2/7] tools/lib/traceevent: Implement libtraceevent man pages Date: Tue, 6 Nov 2018 13:20:51 +0000 Message-ID: <20181106132035.7692-3-tstoyanov@vmware.com> References: <20181106132035.7692-1-tstoyanov@vmware.com> In-Reply-To: <20181106132035.7692-1-tstoyanov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 2500 This patch implements a man page, which documents tep_get_cpus() and tep_set_cpus() libtraceevent APIs Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-cpus.txt | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-cpus.txt b/tools/lib/traceevent/Documentation/libtraceevent-cpus.txt new file mode 100644 index 000000000000..f9ed0a02d653 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-cpus.txt @@ -0,0 +1,78 @@ +libtraceevent(3) +================ + +NAME +---- +tep_get_cpus,tep_set_cpus - Get / set the numbers of CPUs, which have tracing +data recorded. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_get_cpus*(struct tep_handle pass:[*]_tep_); +void *tep_set_cpus*(struct tep_handle pass:[*]_tep_, int _cpus_); +-- + +DESCRIPTION +----------- +The _tep_get_cpus()_ functions gets the number of CPUs, which have tracing +data recorded. The _tep_ argument is trace event parser context. + +The _tep_set_cpus()_ functions sets the number of CPUs, which have tracing +data recorded. The _tep_ argument is trace event parser context. The _cpu_ +argument is the number of CPUs with tracing data. This information is saved +in the trace.dat file. + +RETURN VALUE +------------ +The _tep_get_cpus()_ functions returns the number of CPUs, which have tracing +data recorded. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + tep_set_cpus(tep, 5); +... + printf("We have tracing data for %d CPUs", tep_get_cpus(tep)); +-- + +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 From patchwork Tue Nov 6 13:20:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10759663 Return-Path: Received: from mail-eopbgr710077.outbound.protection.outlook.com ([40.107.71.77]:38016 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388065AbeKFWqG (ORCPT ); Tue, 6 Nov 2018 17:46:06 -0500 From: Tzvetomir Stoyanov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 3/7] tools/lib/traceevent: Implement libtraceevent man pages Date: Tue, 6 Nov 2018 13:20:52 +0000 Message-ID: <20181106132035.7692-4-tstoyanov@vmware.com> References: <20181106132035.7692-1-tstoyanov@vmware.com> In-Reply-To: <20181106132035.7692-1-tstoyanov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 2817 This patch implements a man page, which documents tep_is_file_bigendian() and tep_set_file_bigendian() libtraceevent APIs Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-file_endian.txt | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt b/tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt new file mode 100644 index 000000000000..403db4e23b3f --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt @@ -0,0 +1,87 @@ +libtraceevent(3) +================ + +NAME +---- +tep_is_file_bigendian,tep_set_file_bigendian - Get / set the endianess of the +trace.dat file + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *tep_endian* { + TEP_LITTLE_ENDIAN = 0, + TEP_BIG_ENDIAN +}; + +int *tep_is_file_bigendian*(struct tep_handle pass:[*]_tep_); +void *tep_set_file_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_); + +-- +DESCRIPTION +----------- +The _tep_is_file_bigendian()_ function returns the endianess of the trace.dat file. +The _tep_ argument is trace event parser context. + +The _tep_set_file_bigendian()_ set the endianess of the trace.dat file. +The _tep_ argument is trace event parser context. The _endian_ argument is the endianess: + _TEP_LITTLE_ENDIAN_ - the file is in little endian format, + _TEP_BIG_ENDIAN_ - the file is in big endian format. +This information is saved in the trace.dat file. + +RETURN VALUE +------------ +The _tep_is_file_bigendian()_ function returns _TEP_LITTLE_ENDIAN_ or _TEP_BIG_ENDIAN_. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + tep_set_file_bigendian(tep, TEP_LITTLE_ENDIAN); +... + if (TEP_BIG_ENDIAN == tep_is_file_bigendian(tep)) { + /* The file is in big endian */ + } else { + /* The file is in little endian */ + } +-- + +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 From patchwork Tue Nov 6 13:20:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10759671 Return-Path: Received: from mail-eopbgr710077.outbound.protection.outlook.com ([40.107.71.77]:38016 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388094AbeKFWqG (ORCPT ); Tue, 6 Nov 2018 17:46:06 -0500 From: Tzvetomir Stoyanov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 4/7] tools/lib/traceevent: Implement libtraceevent man pages Date: Tue, 6 Nov 2018 13:20:53 +0000 Message-ID: <20181106132035.7692-5-tstoyanov@vmware.com> References: <20181106132035.7692-1-tstoyanov@vmware.com> In-Reply-To: <20181106132035.7692-1-tstoyanov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 2734 This patch implements a man page, which documents tep_is_host_bigendian() and tep_set_host_bigendian() libtraceevent APIs Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-host_endian.txt | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt b/tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt new file mode 100644 index 000000000000..23e085db8d54 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt @@ -0,0 +1,85 @@ +libtraceevent(3) +================ + +NAME +---- +tep_is_host_bigendian,tep_set_host_bigendian - Get / set the endianess of the local host. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +enum *tep_endian* { + TEP_LITTLE_ENDIAN = 0, + TEP_BIG_ENDIAN +}; + +int *tep_is_host_bigendian*(struct tep_handle pass:[*]_tep_); +void *tep_set_host_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_); +-- + +DESCRIPTION +----------- +The _tep_is_host_bigendian()_ function returns the endianess of the local host +The _tep_ argument is trace event parser context. + +The _tep_set_host_bigendian()_ set the endianess of the local host. +The _tep_ argument is trace event parser context. The _endian_ argument is the endianess: + _TEP_LITTLE_ENDIAN_ - the host is little endian, + _TEP_BIG_ENDIAN_ - the host is big endian. + +RETURN VALUE +------------ +The _tep_is_host_bigendian()_ function returns _TEP_LITTLE_ENDIAN_ or _TEP_BIG_ENDIAN_. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + tep_set_host_bigendian(tep, TEP_LITTLE_ENDIAN); +... + if (TEP_BIG_ENDIAN == tep_is_host_bigendian(tep)) { + /* The local host is big endian */ + } else { + /* The local host is little endian */ + } +-- + +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 From patchwork Tue Nov 6 13:20:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10759667 Return-Path: Received: from mail-eopbgr710057.outbound.protection.outlook.com ([40.107.71.57]:57353 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388116AbeKFWqI (ORCPT ); Tue, 6 Nov 2018 17:46:08 -0500 From: Tzvetomir Stoyanov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 5/7] tools/lib/traceevent: Implement libtraceevent man pages Date: Tue, 6 Nov 2018 13:20:54 +0000 Message-ID: <20181106132035.7692-6-tstoyanov@vmware.com> References: <20181106132035.7692-1-tstoyanov@vmware.com> In-Reply-To: <20181106132035.7692-1-tstoyanov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 3582 This patch implements a man page, which documents tep_is_latency_format() and tep_set_latency_format() libtraceevent APIs Signed-off-by: Tzvetomir Stoyanov --- .../libtraceevent-latency_format.txt | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-latency_format.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-latency_format.txt b/tools/lib/traceevent/Documentation/libtraceevent-latency_format.txt new file mode 100644 index 000000000000..a7eaed5d1a7e --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-latency_format.txt @@ -0,0 +1,98 @@ +libtraceevent(3) +================ + +NAME +---- +tep_set_latency_format,tep_is_latency_format - Get / set "latency output" format. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +void *tep_set_latency_format*(struct tep_handle pass:[*]_tep_, int _lat_); +int *tep_is_latency_format*(struct tep_handle pass:[*]_tep_); + +-- + +DESCRIPTION +----------- +"Latency output" format prints information about interrupts being disabled, +soft irq being disabled, the "need_resched" flag being set, preempt count, +and big kernel lock. This information is recorded with every event, but by +default is not printed. + +The _tep_set_latency_format()_ function enables the "latency output" printing. +The _tep_ argument is trace event parser context. The _lat_ argument can be zero, +for "latency output" disabled, or non zero for "latency output" enabled. +Information is displayed with 6 characters. When a field is zero, or N/A, a pass:['.'] +is printed. Example: +[verse] +-- + -0 0d.h1. 106467.859747: function: ktime_get <-- tick_check_idle +-- +The 0d.h1. denotes this information. The first character is never a pass:['.'] +and represents what CPU the trace was recorded on (CPU 0). The pass:['d'] denotes +that interrupts were disabled. The pass:['h'] means that this was called inside +an interrupt handler. The pass:['1'] is the preemption disabled (preempt_count) +was set to one. The two pass:['.']s are "need_resched" flag and kernel lock +counter. If the "need_resched" flag is set, then that character would be a pass:['N']. + +The _tep_is_latency_format()_ function returns if "latency output" is enabled. + +RETURN VALUE +------------ + +The _tep_is_latency_format()_ function returns non zero if "latency output" +is enabled, or zero if it is disabled. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + tep_set_latency_format(tep, 1); +... + if (tep_is_latency_format(tep)) { + /* latency output format is enabled */ + } else { + /* latency output format is disabled */ + } +-- + +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 From patchwork Tue Nov 6 13:20:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10759665 Return-Path: Received: from mail-eopbgr710057.outbound.protection.outlook.com ([40.107.71.57]:57353 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388105AbeKFWqJ (ORCPT ); Tue, 6 Nov 2018 17:46:09 -0500 From: Tzvetomir Stoyanov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 6/7] tools/lib/traceevent: Implement libtraceevent man pages Date: Tue, 6 Nov 2018 13:20:56 +0000 Message-ID: <20181106132035.7692-7-tstoyanov@vmware.com> References: <20181106132035.7692-1-tstoyanov@vmware.com> In-Reply-To: <20181106132035.7692-1-tstoyanov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 2697 This patch implements a man page, which documents tep_get_page_size() and tep_set_page_size() libtraceevent APIs Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-page_size.txt | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-page_size.txt b/tools/lib/traceevent/Documentation/libtraceevent-page_size.txt new file mode 100644 index 000000000000..d2bad8dca42d --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-page_size.txt @@ -0,0 +1,79 @@ +libtraceevent(3) +================ + +NAME +---- +tep_get_page_size,tep_set_page_size - Get / set the size of a memory page on the +machine, where the trace is generated + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_get_page_size*(struct tep_handle pass:[*]_tep_); +void *tep_set_page_size*(struct tep_handle pass:[*]_tep_, int _page_size_); +-- + +DESCRIPTION +----------- +The _tep_get_page_size()_ function returns the size of a memory page on +the machine, where the trace is generated. The _tep_ argument is trace event parser context. + +The _tep_set_page_size()_ function sets the size of a memory page on the machine, +where the trace is generated. The _tep_ argument is trace event parser context. +The _page_size_ argument is the size of a memory page, in bytes. +This information is saved in the trace.dat file. + +RETURN VALUE +------------ +The _tep_get_page_size()_ function returns size, in bytes, of the memory page. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... + int page_size = 4096; + tep_set_page_size(tep, page_size); + if ( 4096 != tep_get_page_size(tep)) { + /* Something wrong happened, page size is not set as expected */ + } +-- + +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 From patchwork Tue Nov 6 13:20:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10759669 Return-Path: Received: from mail-eopbgr710080.outbound.protection.outlook.com ([40.107.71.80]:26878 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388105AbeKFWqL (ORCPT ); Tue, 6 Nov 2018 17:46:11 -0500 From: Tzvetomir Stoyanov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 7/7] tools/lib/traceevent: Implement libtraceevent man pages Date: Tue, 6 Nov 2018 13:20:57 +0000 Message-ID: <20181106132035.7692-8-tstoyanov@vmware.com> References: <20181106132035.7692-1-tstoyanov@vmware.com> In-Reply-To: <20181106132035.7692-1-tstoyanov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 2833 This patch implements a man page, which documents tep_strerror() libtraceevent API Signed-off-by: Tzvetomir Stoyanov --- .../Documentation/libtraceevent-strerror.txt | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt diff --git a/tools/lib/traceevent/Documentation/libtraceevent-strerror.txt b/tools/lib/traceevent/Documentation/libtraceevent-strerror.txt new file mode 100644 index 000000000000..4ac1bb2abe80 --- /dev/null +++ b/tools/lib/traceevent/Documentation/libtraceevent-strerror.txt @@ -0,0 +1,82 @@ +libtraceevent(3) +================ + +NAME +---- +tep_strerror - Returns string describing regular errno and tep error number. + +SYNOPSIS +-------- +[verse] +-- +*#include * + +int *tep_strerror*(struct tep_handle pass:[*]_tep_, enum tep_errno _errnum_, char pass:[*]_buf_, size_t _buflen_); + +-- +DESCRIPTION +----------- +The _tep_strerror()_ function converts tep error number into a human readable string. +The _tep_ argument is trace event parser context. The _errnum_ is a regular errno, +defined in errno.h, or tep error number. The string, describing this error number +is copied in the _buf_ argument. The _buflen_ argument is the size of the _buf_. + +RETURN VALUE +------------ +The _tep_strerror()_ function returns 0, if a valid _errnum_ is passed and the +string is copied into _buf_. If _errnum_ is not a valid error number, -1 is returned +and _buf_ is not modified. + +EXAMPLE +------- +[source,c] +-- +#include +... +struct tep_handle *tep = tep_alloc(); +... +char buf[32]; +char *pool = calloc(1, 128); +if (NULL == tep) { + tep_strerror(tep, TEP_ERRNO__MEM_ALLOC_FAILED, buf, 32); + printf ("The pool is not initialized, %s", buf); +} +... +-- + +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* , 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