Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / ktap / userspace / symbol.h
1 /*
2  * symbol.h - extract symbols from DSO.
3  *
4  * This file is part of ktap by Jovi Zhangwei.
5  *
6  * Copyright (C) 2013 Azat Khuzhin <a3at.mail@gmail.com>.
7  *
8  * ktap is free software; you can redistribute it and/or modify it
9  * under the terms and conditions of the GNU General Public License,
10  * version 2, as published by the Free Software Foundation.
11  *
12  * ktap is distributed in the hope it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22
23 #define FIND_SYMBOL 1
24 #define FIND_STAPSDT_NOTE 2
25
26 #ifndef NO_LIBELF
27
28 #include <gelf.h>
29 #include <sys/queue.h>
30
31 typedef GElf_Addr vaddr_t;
32 typedef int (*symbol_actor)(const char *name, vaddr_t addr, void *arg);
33
34 /**
35  * Parse all DSO symbols/sdt notes and all for every of them
36  * an actor.
37  *
38  * @exec - path to DSO
39  * @type - see FIND_*
40  * @symbol_actor - actor to call (callback)
41  * @arg - argument for @actor
42  *
43  * @return
44  * If there have errors, return negative value;
45  * No symbols found, return 0;
46  * Otherwise return number of dso symbols found
47  */
48 int
49 parse_dso_symbols(const char *exec, int type, symbol_actor actor, void *arg);
50 #endif