0001 libtraceevent(3)
0002 ================
0003
0004 NAME
0005 ----
0006 tep_read_number_field - Reads a number from raw data.
0007
0008 SYNOPSIS
0009 --------
0010 [verse]
0011 --
0012 *#include <event-parse.h>*
0013
0014 int *tep_read_number_field*(struct tep_format_field pass:[*]_field_, const void pass:[*]_data_, unsigned long long pass:[*]_value_);
0015 --
0016
0017 DESCRIPTION
0018 -----------
0019 The _tep_read_number_field()_ function reads the value of the _field_ from the
0020 raw _data_ and stores it in the _value_. The function sets the _value_ according
0021 to the endianness of the raw data and the current machine and stores it in
0022 _value_.
0023
0024 RETURN VALUE
0025 ------------
0026 The _tep_read_number_field()_ function retunrs 0 in case of success, or -1 in
0027 case of an error.
0028
0029 EXAMPLE
0030 -------
0031 [source,c]
0032 --
0033 #include <event-parse.h>
0034 ...
0035 struct tep_handle *tep = tep_alloc();
0036 ...
0037 struct tep_event *event = tep_find_event_by_name(tep, "timer", "hrtimer_start");
0038 ...
0039 void process_record(struct tep_record *record)
0040 {
0041 unsigned long long pid;
0042 struct tep_format_field *field_pid = tep_find_common_field(event, "common_pid");
0043
0044 if (tep_read_number_field(field_pid, record->data, &pid) != 0) {
0045 /* Failed to get "common_pid" value */
0046 }
0047 }
0048 ...
0049 --
0050 FILES
0051 -----
0052 [verse]
0053 --
0054 *event-parse.h*
0055 Header file to include in order to have access to the library APIs.
0056 *-ltraceevent*
0057 Linker switch to add when building a program that uses the library.
0058 --
0059
0060 SEE ALSO
0061 --------
0062 _libtraceevent(3)_, _trace-cmd(1)_
0063
0064 AUTHOR
0065 ------
0066 [verse]
0067 --
0068 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
0069 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
0070 --
0071 REPORTING BUGS
0072 --------------
0073 Report bugs to <linux-trace-devel@vger.kernel.org>
0074
0075 LICENSE
0076 -------
0077 libtraceevent is Free Software licensed under the GNU LGPL 2.1
0078
0079 RESOURCES
0080 ---------
0081 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git