18c2ecf20Sopenharmony_cilibtraceevent(3)
28c2ecf20Sopenharmony_ci================
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciNAME
58c2ecf20Sopenharmony_ci----
68c2ecf20Sopenharmony_citep_find_function,tep_find_function_address - Find function name / start address.
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciSYNOPSIS
98c2ecf20Sopenharmony_ci--------
108c2ecf20Sopenharmony_ci[verse]
118c2ecf20Sopenharmony_ci--
128c2ecf20Sopenharmony_ci*#include <event-parse.h>*
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciconst char pass:[*]*tep_find_function*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_);
158c2ecf20Sopenharmony_ciunsigned long long *tep_find_function_address*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_);
168c2ecf20Sopenharmony_ci--
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciDESCRIPTION
198c2ecf20Sopenharmony_ci-----------
208c2ecf20Sopenharmony_ciThese functions can be used to find function name and start address, by given
218c2ecf20Sopenharmony_ciaddress. The given address does not have to be exact, it will select the function
228c2ecf20Sopenharmony_cithat would contain it.
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciThe _tep_find_function()_ function returns the function name, which contains the
258c2ecf20Sopenharmony_cigiven address _addr_. The _tep_ argument is the trace event parser context.
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciThe _tep_find_function_address()_ function returns the function start address,
288c2ecf20Sopenharmony_ciby given address _addr_. The _addr_ does not have to be exact, it will select the
298c2ecf20Sopenharmony_cifunction that would contain it. The _tep_ argument is the trace event parser context.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciRETURN VALUE
328c2ecf20Sopenharmony_ci------------
338c2ecf20Sopenharmony_ciThe _tep_find_function()_ function returns the function name, or NULL in case
348c2ecf20Sopenharmony_ciit cannot be found.
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciThe _tep_find_function_address()_ function returns the function start address,
378c2ecf20Sopenharmony_cior 0 in case it cannot be found.
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ciEXAMPLE
408c2ecf20Sopenharmony_ci-------
418c2ecf20Sopenharmony_ci[source,c]
428c2ecf20Sopenharmony_ci--
438c2ecf20Sopenharmony_ci#include <event-parse.h>
448c2ecf20Sopenharmony_ci...
458c2ecf20Sopenharmony_cistruct tep_handle *tep = tep_alloc();
468c2ecf20Sopenharmony_ci...
478c2ecf20Sopenharmony_civoid show_function( unsigned long long addr)
488c2ecf20Sopenharmony_ci{
498c2ecf20Sopenharmony_ci	const char *fname = tep_find_function(tep, addr);
508c2ecf20Sopenharmony_ci	unsigned long long fstart = tep_find_function_address(tep, addr);
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci	/* addr is in function named fname, starting at fstart address, at offset (addr - fstart) */
538c2ecf20Sopenharmony_ci}
548c2ecf20Sopenharmony_ci...
558c2ecf20Sopenharmony_ci--
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ciFILES
588c2ecf20Sopenharmony_ci-----
598c2ecf20Sopenharmony_ci[verse]
608c2ecf20Sopenharmony_ci--
618c2ecf20Sopenharmony_ci*event-parse.h*
628c2ecf20Sopenharmony_ci	Header file to include in order to have access to the library APIs.
638c2ecf20Sopenharmony_ci*-ltraceevent*
648c2ecf20Sopenharmony_ci	Linker switch to add when building a program that uses the library.
658c2ecf20Sopenharmony_ci--
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ciSEE ALSO
688c2ecf20Sopenharmony_ci--------
698c2ecf20Sopenharmony_ci_libtraceevent(3)_, _trace-cmd(1)_
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ciAUTHOR
728c2ecf20Sopenharmony_ci------
738c2ecf20Sopenharmony_ci[verse]
748c2ecf20Sopenharmony_ci--
758c2ecf20Sopenharmony_ci*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
768c2ecf20Sopenharmony_ci*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
778c2ecf20Sopenharmony_ci--
788c2ecf20Sopenharmony_ciREPORTING BUGS
798c2ecf20Sopenharmony_ci--------------
808c2ecf20Sopenharmony_ciReport bugs to  <linux-trace-devel@vger.kernel.org>
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ciLICENSE
838c2ecf20Sopenharmony_ci-------
848c2ecf20Sopenharmony_cilibtraceevent is Free Software licensed under the GNU LGPL 2.1
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ciRESOURCES
878c2ecf20Sopenharmony_ci---------
888c2ecf20Sopenharmony_cihttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
89