1 /* Linux-dependent part of branch trace support for GDB, and GDBserver.
3 Copyright (C) 2013 Free Software Foundation, Inc.
5 Contributed by Intel Corp. <markus.t.metzger@intel.com>
7 This file is part of GDB.
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.
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.
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/>. */
22 #ifndef LINUX_BTRACE_H
23 #define LINUX_BTRACE_H
25 #include "btrace-common.h"
32 #if HAVE_LINUX_PERF_EVENT_H
33 # include <linux/perf_event.h>
36 /* Branch trace target information per thread. */
37 struct btrace_target_info
39 #if HAVE_LINUX_PERF_EVENT_H
40 /* The Linux perf_event configuration for collecting the branch trace. */
41 struct perf_event_attr attr
;
43 /* The ptid of this thread. */
46 /* The mmap configuration mapping the branch trace perf_event buffer.
48 file .. the file descriptor
49 buffer .. the mmapped memory buffer
50 size .. the buffer's size in pages without the configuration page
51 data_head .. the data head from the last read */
55 unsigned long data_head
;
56 #endif /* HAVE_LINUX_PERF_EVENT_H */
58 /* The size of a pointer in bits for this thread.
59 The information is used to identify kernel addresses in order to skip
60 records from/to kernel space. */
64 /* Check whether branch tracing is supported. */
65 extern int linux_supports_btrace (void);
67 /* Enable branch tracing for @ptid. */
68 extern struct btrace_target_info
*linux_enable_btrace (ptid_t ptid
);
70 /* Disable branch tracing and deallocate @tinfo. */
71 extern int linux_disable_btrace (struct btrace_target_info
*tinfo
);
73 /* Read branch trace data. */
74 extern VEC (btrace_block_s
) *linux_read_btrace (struct btrace_target_info
*,
75 enum btrace_read_type
);
77 #endif /* LINUX_BTRACE_H */
This page took 0.031451 seconds and 4 git commands to generate.