linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tzvetomir Stoyanov <tstoyanov@vmware.com>
Subject: [PATCH 08/27] tools/lib/traceevent: Man page for host endian APIs
Date: Fri, 10 May 2019 15:56:14 -0400	[thread overview]
Message-ID: <20190510200107.063709363@goodmis.org> (raw)
In-Reply-To: 20190510195606.537643615@goodmis.org

From: Tzvetomir Stoyanov <tstoyanov@vmware.com>

Create man pages for libtraceevent APIs:
  tep_is_bigendian(),
  tep_is_local_bigendian(),
  tep_set_local_bigendian()

Link: http://lore.kernel.org/linux-trace-devel/20190503091119.23399-8-tstoyanov@vmware.com

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 .../libtraceevent-host_endian.txt             | 104 ++++++++++++++++++
 1 file changed, 104 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..d5d375eb8d1e
--- /dev/null
+++ b/tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt
@@ -0,0 +1,104 @@
+libtraceevent(3)
+================
+
+NAME
+----
+tep_is_bigendian, tep_is_local_bigendian, tep_set_local_bigendian - Get / set
+the endianness of the local machine.
+
+SYNOPSIS
+--------
+[verse]
+--
+*#include <event-parse.h>*
+
+enum *tep_endian* {
+	TEP_LITTLE_ENDIAN = 0,
+	TEP_BIG_ENDIAN
+};
+
+int *tep_is_bigendian*(void);
+bool *tep_is_local_bigendian*(struct tep_handle pass:[*]_tep_);
+void *tep_set_local_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_);
+--
+
+DESCRIPTION
+-----------
+
+The _tep_is_bigendian()_ gets the endianness of the machine, executing
+the function.
+
+The _tep_is_local_bigendian()_ function gets the endianness of the local
+machine, saved in the _tep_ handler. The _tep_ argument is the trace event
+parser context. This API is a bit faster than _tep_is_bigendian()_, as it
+returns cached endianness of the local machine instead of checking it each time.
+
+The _tep_set_local_bigendian()_ function sets the endianness of the local
+machine in the _tep_ handler. The _tep_ argument is trace event parser context.
+The _endian_ argument is the endianness:
+[verse]
+--
+	_TEP_LITTLE_ENDIAN_ - the machine is little endian,
+	_TEP_BIG_ENDIAN_ - the machine is big endian.
+--
+
+RETURN VALUE
+------------
+The _tep_is_bigendian()_ function returns non zero if the endianness of the
+machine, executing the code, is big endian and zero otherwise.
+
+The _tep_is_local_bigendian()_ function returns true, if the endianness of the
+local machine, saved in the _tep_ handler, is big endian, or false otherwise.
+
+EXAMPLE
+-------
+[source,c]
+--
+#include <event-parse.h>
+...
+struct tep_handle *tep = tep_alloc();
+...
+	if (tep_is_bigendian())
+		tep_set_local_bigendian(tep, TEP_BIG_ENDIAN);
+	else
+		tep_set_local_bigendian(tep, TEP_LITTLE_ENDIAN);
+...
+	if (tep_is_local_bigendian(tep))
+		printf("This machine you are running on is bigendian\n");
+	else
+		printf("This machine you are running on is little endian\n");
+
+--
+
+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
-- 
2.20.1



  parent reply	other threads:[~2019-05-10 20:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 19:56 [PATCH 00/27] tools/lib/traceevent: Add man pages for most libtraceevent functions Steven Rostedt
2019-05-10 19:56 ` [PATCH 01/27] tools lib traceevent: Remove hard coded install paths from pkg-config file Steven Rostedt
2019-05-10 20:11   ` Steven Rostedt
2019-05-10 21:25     ` Arnaldo Carvalho de Melo
2019-05-14 15:05       ` Arnaldo Carvalho de Melo
2019-05-14 15:49         ` Steven Rostedt
2019-05-10 19:56 ` [PATCH 02/27] tools/lib/traceevent: Implement libtraceevent man pages Steven Rostedt
2019-05-10 19:56 ` [PATCH 03/27] tools/lib/traceevent: Add support for man pages with multiple names Steven Rostedt
2019-05-10 19:56 ` [PATCH 04/27] tools/lib/traceevent: libtraceevent man pages for tep_handler related APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 05/27] tools/lib/traceevent: Man page for header_page APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 06/27] tools/lib/traceevent: Man page for get/set cpus APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 07/27] tools/lib/traceevent: Man page for file endian APIs Steven Rostedt
2019-05-10 19:56 ` Steven Rostedt [this message]
2019-05-10 19:56 ` [PATCH 09/27] tools/lib/traceevent: Man page for page size APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 10/27] tools/lib/traceevent: Man page for tep_strerror() Steven Rostedt
2019-05-10 19:56 ` [PATCH 11/27] tools/lib/traceevent: Man pages for event handler APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 12/27] tools/lib/traceevent: Man pages for function related libtraceevent APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 13/27] tools/lib/traceevent: Man pages for registering print function Steven Rostedt
2019-05-10 19:56 ` [PATCH 14/27] tools/lib/traceevent: Man page for tep_read_number() Steven Rostedt
2019-05-10 19:56 ` [PATCH 15/27] tools/lib/traceevent: Man pages for event find APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 16/27] tools/lib/traceevent: Man page for list events APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 17/27] tools/lib/traceevent: Man pages for libtraceevent event get APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 18/27] tools/lib/traceevent: Man pages find field APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 19/27] tools/lib/traceevent: Man pages get field value APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 20/27] tools/lib/traceevent: Man pages for print field APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 21/27] tools/lib/traceevent: Man page for tep_read_number_field() Steven Rostedt
2019-05-10 19:56 ` [PATCH 22/27] tools/lib/traceevent: Man pages for event fields APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 23/27] tools/lib/traceevent: Man pages for event filter APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 24/27] tools/lib/traceevent: Man pages for parse event APIs Steven Rostedt
2019-05-10 19:56 ` [PATCH 25/27] tools/lib/traceevent: Man page for tep_parse_header_page() Steven Rostedt
2019-05-10 19:56 ` [PATCH 26/27] tools/lib/traceevent: Man pages for APIs, used to extract common fields from a record Steven Rostedt
2019-05-10 19:56 ` [PATCH 27/27] tools/lib/traceevent: Man pages for trace sequences APIs Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190510200107.063709363@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tstoyanov@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).