aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/probe-finder.h')
-rw-r--r--tools/perf/util/probe-finder.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index a4086aaddb73..972b386116f1 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -1,6 +1,8 @@
1#ifndef _PROBE_FINDER_H 1#ifndef _PROBE_FINDER_H
2#define _PROBE_FINDER_H 2#define _PROBE_FINDER_H
3 3
4#include "util.h"
5
4#define MAX_PATH_LEN 256 6#define MAX_PATH_LEN 256
5#define MAX_PROBE_BUFFER 1024 7#define MAX_PROBE_BUFFER 1024
6#define MAX_PROBES 128 8#define MAX_PROBES 128
@@ -32,8 +34,26 @@ struct probe_point {
32 char *probes[MAX_PROBES]; /* Output buffers (will be allocated)*/ 34 char *probes[MAX_PROBES]; /* Output buffers (will be allocated)*/
33}; 35};
34 36
37/* Line number container */
38struct line_node {
39 struct list_head list;
40 unsigned int line;
41};
42
43/* Line range */
44struct line_range {
45 char *file; /* File name */
46 char *function; /* Function name */
47 unsigned int start; /* Start line number */
48 unsigned int end; /* End line number */
49 unsigned int offset; /* Start line offset */
50 char *path; /* Real path name */
51 struct list_head line_list; /* Visible lines */
52};
53
35#ifndef NO_LIBDWARF 54#ifndef NO_LIBDWARF
36extern int find_probepoint(int fd, struct probe_point *pp); 55extern int find_probepoint(int fd, struct probe_point *pp);
56extern int find_line_range(int fd, struct line_range *lr);
37 57
38/* Workaround for undefined _MIPS_SZLONG bug in libdwarf.h: */ 58/* Workaround for undefined _MIPS_SZLONG bug in libdwarf.h: */
39#ifndef _MIPS_SZLONG 59#ifndef _MIPS_SZLONG
@@ -60,6 +80,19 @@ struct probe_finder {
60 char *buf; /* Current output buffer */ 80 char *buf; /* Current output buffer */
61 int len; /* Length of output buffer */ 81 int len; /* Length of output buffer */
62}; 82};
83
84struct line_finder {
85 struct line_range *lr; /* Target line range */
86
87 Dwarf_Unsigned fno; /* File number */
88 Dwarf_Unsigned lno_s; /* Start line number */
89 Dwarf_Unsigned lno_e; /* End line number */
90 Dwarf_Addr addr_s; /* Start address */
91 Dwarf_Addr addr_e; /* End address */
92 Dwarf_Die cu_die; /* Current CU */
93 int found;
94};
95
63#endif /* NO_LIBDWARF */ 96#endif /* NO_LIBDWARF */
64 97
65#endif /*_PROBE_FINDER_H */ 98#endif /*_PROBE_FINDER_H */