diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2009-05-08 04:25:35 -0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-08 04:25:35 -0400 |
| commit | cb3a86c89ebdf917b88665f70e06863986fbab5c (patch) | |
| tree | ca602230dcffab4a80656162d634cf889c74b1e9 /arch/sh/lib64 | |
| parent | 1af2fe45fec15bdba446c22b9b602699cdabfc9f (diff) | |
sh: Kill off sh64's hand-rolled syscall tracer.
This is no longer necessary, as there are now sufficient generic
alternatives available.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/lib64')
| -rw-r--r-- | arch/sh/lib64/.gitignore | 1 | ||||
| -rw-r--r-- | arch/sh/lib64/dbg.c | 134 |
2 files changed, 0 insertions, 135 deletions
diff --git a/arch/sh/lib64/.gitignore b/arch/sh/lib64/.gitignore deleted file mode 100644 index 3508c2cb23c..00000000000 --- a/arch/sh/lib64/.gitignore +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | syscalltab.h | ||
diff --git a/arch/sh/lib64/dbg.c b/arch/sh/lib64/dbg.c index 2fb8eaf6de6..25f2481bd89 100644 --- a/arch/sh/lib64/dbg.c +++ b/arch/sh/lib64/dbg.c | |||
| @@ -135,140 +135,6 @@ void print_itlb(void) | |||
| 135 | (" =============================================================\n"); | 135 | (" =============================================================\n"); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | /* ======================================================================= */ | ||
| 139 | |||
| 140 | #ifdef CONFIG_POOR_MANS_STRACE | ||
| 141 | |||
| 142 | #include "syscalltab.h" | ||
| 143 | |||
| 144 | struct ring_node { | ||
| 145 | int evt; | ||
| 146 | int ret_addr; | ||
| 147 | int event; | ||
| 148 | int tra; | ||
| 149 | int pid; | ||
| 150 | unsigned long sp; | ||
| 151 | unsigned long pc; | ||
| 152 | }; | ||
| 153 | |||
| 154 | static struct ring_node event_ring[16]; | ||
| 155 | static int event_ptr = 0; | ||
| 156 | |||
| 157 | struct stored_syscall_data { | ||
| 158 | int pid; | ||
| 159 | int syscall_number; | ||
| 160 | }; | ||
| 161 | |||
| 162 | #define N_STORED_SYSCALLS 16 | ||
| 163 | |||
| 164 | static struct stored_syscall_data stored_syscalls[N_STORED_SYSCALLS]; | ||
| 165 | static int syscall_next=0; | ||
| 166 | static int syscall_next_print=0; | ||
| 167 | |||
| 168 | void evt_debug(int evt, int ret_addr, int event, int tra, struct pt_regs *regs) | ||
| 169 | { | ||
| 170 | int syscallno = tra & 0xff; | ||
| 171 | unsigned long sp; | ||
| 172 | unsigned long stack_bottom; | ||
| 173 | int pid; | ||
| 174 | struct ring_node *rr; | ||
| 175 | |||
| 176 | pid = current->pid; | ||
| 177 | stack_bottom = (unsigned long) task_stack_page(current); | ||
| 178 | asm volatile("ori r15, 0, %0" : "=r" (sp)); | ||
| 179 | rr = event_ring + event_ptr; | ||
| 180 | rr->evt = evt; | ||
| 181 | rr->ret_addr = ret_addr; | ||
| 182 | rr->event = event; | ||
| 183 | rr->tra = tra; | ||
| 184 | rr->pid = pid; | ||
| 185 | rr->sp = sp; | ||
| 186 | rr->pc = regs->pc; | ||
| 187 | |||
| 188 | if (sp < stack_bottom + 3092) { | ||
| 189 | int i, j; | ||
| 190 | printk("evt_debug : stack underflow report\n"); | ||
| 191 | for (j=0, i = event_ptr; j<16; j++) { | ||
| 192 | rr = event_ring + i; | ||
| 193 | printk("evt=%08x event=%08x tra=%08x pid=%5d sp=%08lx pc=%08lx\n", | ||
| 194 | rr->evt, rr->event, rr->tra, rr->pid, rr->sp, rr->pc); | ||
| 195 | i--; | ||
| 196 | i &= 15; | ||
| 197 | } | ||
| 198 | panic("STACK UNDERFLOW\n"); | ||
| 199 | } | ||
| 200 | |||
| 201 | event_ptr = (event_ptr + 1) & 15; | ||
| 202 | |||
| 203 | if ((event == 2) && (evt == 0x160)) { | ||
| 204 | if (syscallno < NUM_SYSCALL_INFO_ENTRIES) { | ||
| 205 | /* Store the syscall information to print later. We | ||
| 206 | * can't print this now - currently we're running with | ||
| 207 | * SR.BL=1, so we can't take a tlbmiss (which could occur | ||
| 208 | * in the console drivers under printk). | ||
| 209 | * | ||
| 210 | * Just overwrite old entries on ring overflow - this | ||
| 211 | * is only for last-hope debugging. */ | ||
| 212 | stored_syscalls[syscall_next].pid = current->pid; | ||
| 213 | stored_syscalls[syscall_next].syscall_number = syscallno; | ||
| 214 | syscall_next++; | ||
| 215 | syscall_next &= (N_STORED_SYSCALLS - 1); | ||
| 216 | } | ||
| 217 | } | ||
| 218 | } | ||
| 219 | |||
| 220 | static void drain_syscalls(void) { | ||
| 221 | while (syscall_next_print != syscall_next) { | ||
| 222 | printk("Task %d: %s()\n", | ||
| 223 | stored_syscalls[syscall_next_print].pid, | ||
| 224 | syscall_info_table[stored_syscalls[syscall_next_print].syscall_number].name); | ||
| 225 | syscall_next_print++; | ||
| 226 | syscall_next_print &= (N_STORED_SYSCALLS - 1); | ||
| 227 | } | ||
| 228 | } | ||
| 229 | |||
| 230 | void evt_debug2(unsigned int ret) | ||
| 231 | { | ||
| 232 | drain_syscalls(); | ||
| 233 | printk("Task %d: syscall returns %08x\n", current->pid, ret); | ||
| 234 | } | ||
| 235 | |||
| 236 | void evt_debug_ret_from_irq(struct pt_regs *regs) | ||
| 237 | { | ||
| 238 | int pid; | ||
| 239 | struct ring_node *rr; | ||
| 240 | |||
| 241 | pid = current->pid; | ||
| 242 | rr = event_ring + event_ptr; | ||
| 243 | rr->evt = 0xffff; | ||
| 244 | rr->ret_addr = 0; | ||
| 245 | rr->event = 0; | ||
| 246 | rr->tra = 0; | ||
| 247 | rr->pid = pid; | ||
| 248 | rr->pc = regs->pc; | ||
| 249 | event_ptr = (event_ptr + 1) & 15; | ||
| 250 | } | ||
| 251 | |||
| 252 | void evt_debug_ret_from_exc(struct pt_regs *regs) | ||
| 253 | { | ||
| 254 | int pid; | ||
| 255 | struct ring_node *rr; | ||
| 256 | |||
| 257 | pid = current->pid; | ||
| 258 | rr = event_ring + event_ptr; | ||
| 259 | rr->evt = 0xfffe; | ||
| 260 | rr->ret_addr = 0; | ||
| 261 | rr->event = 0; | ||
| 262 | rr->tra = 0; | ||
| 263 | rr->pid = pid; | ||
| 264 | rr->pc = regs->pc; | ||
| 265 | event_ptr = (event_ptr + 1) & 15; | ||
| 266 | } | ||
| 267 | |||
| 268 | #endif /* CONFIG_POOR_MANS_STRACE */ | ||
| 269 | |||
| 270 | /* ======================================================================= */ | ||
| 271 | |||
| 272 | void show_excp_regs(char *from, int trapnr, int signr, struct pt_regs *regs) | 138 | void show_excp_regs(char *from, int trapnr, int signr, struct pt_regs *regs) |
| 273 | { | 139 | { |
| 274 | 140 | ||
