Merge tag 'for-linus-20190524' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / tools / lib / traceevent / Documentation / libtraceevent-func_find.txt
1 libtraceevent(3)
2 ================
3
4 NAME
5 ----
6 tep_find_function,tep_find_function_address - Find function name / start address.
7
8 SYNOPSIS
9 --------
10 [verse]
11 --
12 *#include <event-parse.h>*
13
14 const char pass:[*]*tep_find_function*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_);
15 unsigned long long *tep_find_function_address*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_);
16 --
17
18 DESCRIPTION
19 -----------
20 These functions can be used to find function name and start address, by given
21 address. The given address does not have to be exact, it will select the function
22 that would contain it.
23
24 The _tep_find_function()_ function returns the function name, which contains the
25 given address _addr_. The _tep_ argument is the trace event parser context.
26
27 The _tep_find_function_address()_ function returns the function start address,
28 by given address _addr_. The _addr_ does not have to be exact, it will select the
29 function that would contain it. The _tep_ argument is the trace event parser context.
30
31 RETURN VALUE
32 ------------
33 The _tep_find_function()_ function returns the function name, or NULL in case
34 it cannot be found.
35
36 The _tep_find_function_address()_ function returns the function start address,
37 or 0 in case it cannot be found.
38
39 EXAMPLE
40 -------
41 [source,c]
42 --
43 #include <event-parse.h>
44 ...
45 struct tep_handle *tep = tep_alloc();
46 ...
47 void show_function( unsigned long long addr)
48 {
49         const char *fname = tep_find_function(tep, addr);
50         unsigned long long fstart = tep_find_function_address(tep, addr);
51
52         /* addr is in function named fname, starting at fstart address, at offset (addr - fstart) */
53 }
54 ...
55 --
56
57 FILES
58 -----
59 [verse]
60 --
61 *event-parse.h*
62         Header file to include in order to have access to the library APIs.
63 *-ltraceevent*
64         Linker switch to add when building a program that uses the library.
65 --
66
67 SEE ALSO
68 --------
69 _libtraceevent(3)_, _trace-cmd(1)_
70
71 AUTHOR
72 ------
73 [verse]
74 --
75 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
76 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
77 --
78 REPORTING BUGS
79 --------------
80 Report bugs to  <linux-trace-devel@vger.kernel.org>
81
82 LICENSE
83 -------
84 libtraceevent is Free Software licensed under the GNU LGPL 2.1
85
86 RESOURCES
87 ---------
88 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git