Add set/show debug dwarf-line.
[deliverable/binutils-gdb.git] / gdb / nat / linux-btrace.h
1 /* Linux-dependent part of branch trace support for GDB, and GDBserver.
2
3 Copyright (C) 2013-2015 Free Software Foundation, Inc.
4
5 Contributed by Intel Corp. <markus.t.metzger@intel.com>
6
7 This file is part of GDB.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21
22 #ifndef LINUX_BTRACE_H
23 #define LINUX_BTRACE_H
24
25 #include "btrace-common.h"
26 #include "vec.h"
27 #include <stdint.h>
28
29 #if HAVE_LINUX_PERF_EVENT_H
30 # include <linux/perf_event.h>
31 #endif
32
33 struct target_ops;
34
35 #if HAVE_LINUX_PERF_EVENT_H
36 /* A Linux perf event buffer. */
37 struct perf_event_buffer
38 {
39 /* The mapped memory. */
40 const uint8_t *mem;
41
42 /* The size of the mapped memory in bytes. */
43 unsigned long long size;
44
45 /* A pointer to the data_head field for this buffer. */
46 volatile unsigned long long *data_head;
47
48 /* The data_head value from the last read. */
49 unsigned long long last_head;
50 };
51
52 /* Branch trace target information for BTS tracing. */
53 struct btrace_tinfo_bts
54 {
55 /* The Linux perf_event configuration for collecting the branch trace. */
56 struct perf_event_attr attr;
57
58 /* The perf event file. */
59 int file;
60
61 /* The perf event configuration page. */
62 volatile struct perf_event_mmap_page *header;
63
64 /* The BTS perf event buffer. */
65 struct perf_event_buffer bts;
66 };
67 #endif /* HAVE_LINUX_PERF_EVENT_H */
68
69 /* Branch trace target information per thread. */
70 struct btrace_target_info
71 {
72 /* The ptid of this thread. */
73 ptid_t ptid;
74
75 /* The obtained branch trace configuration. */
76 struct btrace_config conf;
77
78 #if HAVE_LINUX_PERF_EVENT_H
79 /* The branch tracing format specific information. */
80 union
81 {
82 /* CONF.FORMAT == BTRACE_FORMAT_BTS. */
83 struct btrace_tinfo_bts bts;
84 } variant;
85 #endif /* HAVE_LINUX_PERF_EVENT_H */
86
87 /* The size of a pointer in bits for this thread.
88 The information is used to identify kernel addresses in order to skip
89 records from/to kernel space. */
90 int ptr_bits;
91 };
92
93 /* See to_supports_btrace in target.h. */
94 extern int linux_supports_btrace (struct target_ops *, enum btrace_format);
95
96 /* See to_enable_btrace in target.h. */
97 extern struct btrace_target_info *
98 linux_enable_btrace (ptid_t ptid, const struct btrace_config *conf);
99
100 /* See to_disable_btrace in target.h. */
101 extern enum btrace_error linux_disable_btrace (struct btrace_target_info *ti);
102
103 /* See to_read_btrace in target.h. */
104 extern enum btrace_error linux_read_btrace (struct btrace_data *btrace,
105 struct btrace_target_info *btinfo,
106 enum btrace_read_type type);
107
108 /* See to_btrace_conf in target.h. */
109 extern const struct btrace_config *
110 linux_btrace_conf (const struct btrace_target_info *);
111
112 #endif /* LINUX_BTRACE_H */
This page took 0.032208 seconds and 4 git commands to generate.