-
Notifications
You must be signed in to change notification settings - Fork 3
/
syms.h
75 lines (65 loc) · 1.96 KB
/
syms.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Copyright: 2013 Xilinx Inc
* Written by Edgar E. Iglesias <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; version 2.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef _SYMS_H
#define _SYMS_H
#include <stdint.h>
#include <stdlib.h>
/* A 64bit counter per 32bit word in the sym. */
struct sym_coverage {
uint64_t counter[0];
};
enum loc_flags {
LOC_F_INLINED = (1 << 0),
};
struct sym_src_loc {
struct sym_src_loc *next;
const char *filename;
unsigned int linenr;
uint32_t flags;
};
struct sym_linemap {
struct sym_src_loc locs[0];
};
struct sym
{
struct sym *next;
uint64_t addr;
uint64_t size;
int hits;
uint64_t total_time;
char *src_filename;
struct sym_linemap *linemap;
unsigned int maxline;
struct sym_coverage *cov;
/* For gcov, only counts entries no time. */
struct sym_coverage *cov_ent;
int namelen;
char name[128];
};
void sym_show_stats(void **store);
void sym_show(const char *prefix, const struct sym *s);
struct sym *sym_lookup_by_addr(void **rootp, uint64_t addr);
struct sym *sym_lookup_by_name(void **rootp, const char *name);
struct sym *sym_get_all(void **store, size_t *nr_syms);
struct sym *sym_get_unknown(void **store);
void sym_read_from_elf(void **rootp, char *nm, char *elf);
void sym_build_linemap(void **rootp, const char *dwarfdump, const char *elf);
void sym_update_cov(struct sym *sym, uint64_t start, uint64_t end,
uint32_t time);
#endif