diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2008-01-30 07:31:20 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:20 -0500 |
commit | a95d67f87e1a5f1b4429be3ba3bf7b4051657908 (patch) | |
tree | 4a67994b901c5dfbf3c2ee752efd53dbce938c36 /include/asm-x86/ptrace-abi.h | |
parent | e4811f2568c55e595a7bf15a3b9aba863b31fb94 (diff) |
x86, ptrace: new ptrace BTS API
Here's the new ptrace BTS API that supports two different overflow handling mechanisms (wrap-around and buffer-full-signal) to support two different use cases (debugging and profiling).
It further combines buffer allocation and configuration.
Opens:
- memory rlimit
- overflow signal
What would be the right signal to use?
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/ptrace-abi.h')
-rw-r--r-- | include/asm-x86/ptrace-abi.h | 94 |
1 files changed, 48 insertions, 46 deletions
diff --git a/include/asm-x86/ptrace-abi.h b/include/asm-x86/ptrace-abi.h index b473ad45e9ca..cf2fe4633ee5 100644 --- a/include/asm-x86/ptrace-abi.h +++ b/include/asm-x86/ptrace-abi.h | |||
@@ -80,51 +80,53 @@ | |||
80 | 80 | ||
81 | #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ | 81 | #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ |
82 | 82 | ||
83 | /* Return maximal BTS buffer size in number of records, | 83 | /* configuration/status structure used in PTRACE_BTS_CONFIG and |
84 | if successuf; -1, otherwise. | 84 | PTRACE_BTS_STATUS commands. |
85 | EOPNOTSUPP...processor does not support bts tracing */ | 85 | */ |
86 | #define PTRACE_BTS_MAX_BUFFER_SIZE 40 | 86 | struct ptrace_bts_config { |
87 | 87 | /* requested or actual size of BTS buffer in bytes */ | |
88 | /* Allocate new bts buffer (free old one, if exists) of size DATA bts records; | 88 | unsigned long size; |
89 | parameter ADDR is ignored. | 89 | /* bitmask of below flags */ |
90 | Return 0, if successful; -1, otherwise. | 90 | unsigned long flags; |
91 | EOPNOTSUPP...processor does not support bts tracing | 91 | }; |
92 | EINVAL.......invalid size in records | 92 | |
93 | ENOMEM.......out of memory */ | 93 | #define PTRACE_BTS_O_TRACE 0x1 /* branch trace */ |
94 | #define PTRACE_BTS_ALLOCATE_BUFFER 41 | 94 | #define PTRACE_BTS_O_SCHED 0x2 /* scheduling events w/ jiffies */ |
95 | 95 | #define PTRACE_BTS_O_SIGNAL 0x4 /* send SIG? on buffer overflow | |
96 | /* Return the size of the bts buffer in number of bts records, | 96 | instead of wrapping around */ |
97 | if successful; -1, otherwise. | 97 | #define PTRACE_BTS_O_CUT_SIZE 0x8 /* cut requested size to max available |
98 | EOPNOTSUPP...processor does not support bts tracing | 98 | instead of failing */ |
99 | ENXIO........no buffer allocated */ | 99 | |
100 | #define PTRACE_BTS_GET_BUFFER_SIZE 42 | 100 | #define PTRACE_BTS_CONFIG 40 |
101 | 101 | /* Configure branch trace recording. | |
102 | /* Read the DATA'th bts record into a ptrace_bts_record buffer | 102 | DATA is ignored, ADDR points to a struct ptrace_bts_config. |
103 | provided in ADDR. | 103 | A new buffer is allocated, iff the size changes. |
104 | Records are ordered from newest to oldest. | 104 | */ |
105 | Return 0, if successful; -1, otherwise | 105 | #define PTRACE_BTS_STATUS 41 |
106 | EOPNOTSUPP...processor does not support bts tracing | 106 | /* Return the current configuration. |
107 | ENXIO........no buffer allocated | 107 | DATA is ignored, ADDR points to a struct ptrace_bts_config |
108 | EINVAL.......invalid index */ | 108 | that will contain the result. |
109 | #define PTRACE_BTS_READ_RECORD 43 | 109 | */ |
110 | 110 | #define PTRACE_BTS_SIZE 42 | |
111 | /* Configure last branch trace; the configuration is given as a bit-mask of | 111 | /* Return the number of available BTS records. |
112 | PTRACE_BTS_O_* options in DATA; parameter ADDR is ignored. | 112 | DATA and ADDR are ignored. |
113 | Return 0, if successful; -1, otherwise | 113 | */ |
114 | EOPNOTSUPP...processor does not support bts tracing | 114 | #define PTRACE_BTS_GET 43 |
115 | ENXIO........no buffer allocated */ | 115 | /* Get a single BTS record. |
116 | #define PTRACE_BTS_CONFIG 44 | 116 | DATA defines the index into the BTS array, where 0 is the newest |
117 | 117 | entry, and higher indices refer to older entries. | |
118 | /* Return the configuration as bit-mask of PTRACE_BTS_O_* options | 118 | ADDR is pointing to struct bts_struct (see asm/ds.h). |
119 | if successful; -1, otherwise. | 119 | */ |
120 | EOPNOTSUPP...processor does not support bts tracing | 120 | #define PTRACE_BTS_CLEAR 44 |
121 | ENXIO........no buffer allocated */ | 121 | /* Clear the BTS buffer. |
122 | #define PTRACE_BTS_STATUS 45 | 122 | DATA and ADDR are ignored. |
123 | 123 | */ | |
124 | /* Trace configuration options */ | 124 | #define PTRACE_BTS_DRAIN 45 |
125 | /* Collect last branch trace */ | 125 | /* Read all available BTS records and clear the buffer. |
126 | #define PTRACE_BTS_O_TRACE_TASK 0x1 | 126 | DATA is ignored. ADDR points to an array of struct bts_struct of |
127 | /* Take timestamps when the task arrives and departs */ | 127 | suitable size. |
128 | #define PTRACE_BTS_O_TIMESTAMPS 0x2 | 128 | BTS records are read from oldest to newest. |
129 | Returns number of BTS records drained. | ||
130 | */ | ||
129 | 131 | ||
130 | #endif | 132 | #endif |