2 * symbol.h - extract symbols from DSO.
4 * This file is part of ktap by Jovi Zhangwei.
6 * Copyright (C) 2013 Azat Khuzhin <a3at.mail@gmail.com>.
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.
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
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.
24 #define FIND_STAPSDT_NOTE 2
29 #include <sys/queue.h>
31 typedef GElf_Addr vaddr_t;
32 typedef int (*symbol_actor)(const char *name, vaddr_t addr, void *arg);
35 * Parse all DSO symbols/sdt notes and all for every of them
40 * @symbol_actor - actor to call (callback)
41 * @arg - argument for @actor
44 * If there have errors, return negative value;
45 * No symbols found, return 0;
46 * Otherwise return number of dso symbols found
49 parse_dso_symbols(const char *exec, int type, symbol_actor actor, void *arg);