diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-07-10 07:45:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-10 16:24:24 -0400 |
commit | 469226a431f553a7b3ec17d87ce3c2d1c6c25fb2 (patch) | |
tree | 4fa99835c10b4bc70e259c5b42e07ade4388fb26 | |
parent | 29ac1c2142346e1e0e072f41df31688fc42ff540 (diff) |
[PATCH] uml: remove syscall debugging
Eliminate an unused debug option.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/um/Kconfig.debug | 9 | ||||
-rw-r--r-- | arch/um/defconfig | 1 | ||||
-rw-r--r-- | arch/um/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/um/kernel/skas/syscall.c | 7 | ||||
-rw-r--r-- | arch/um/kernel/syscall.c | 36 | ||||
-rw-r--r-- | arch/um/kernel/tt/syscall_kern.c | 12 | ||||
-rw-r--r-- | arch/um/kernel/tt/tracer.c | 22 |
7 files changed, 2 insertions, 86 deletions
diff --git a/arch/um/Kconfig.debug b/arch/um/Kconfig.debug index bab51d619173..09c1aca6339f 100644 --- a/arch/um/Kconfig.debug +++ b/arch/um/Kconfig.debug | |||
@@ -47,13 +47,4 @@ config GCOV | |||
47 | If you're involved in UML kernel development and want to use gcov, | 47 | If you're involved in UML kernel development and want to use gcov, |
48 | say Y. If you're unsure, say N. | 48 | say Y. If you're unsure, say N. |
49 | 49 | ||
50 | config SYSCALL_DEBUG | ||
51 | bool "Enable system call debugging" | ||
52 | depends on DEBUG_INFO | ||
53 | help | ||
54 | This adds some system debugging to UML, including keeping a ring buffer | ||
55 | with recent system calls and some global and per-task statistics. | ||
56 | |||
57 | If unsure, say N | ||
58 | |||
59 | endmenu | 50 | endmenu |
diff --git a/arch/um/defconfig b/arch/um/defconfig index 402a74dc5026..780cc0a4a128 100644 --- a/arch/um/defconfig +++ b/arch/um/defconfig | |||
@@ -526,4 +526,3 @@ CONFIG_FORCED_INLINING=y | |||
526 | # CONFIG_RCU_TORTURE_TEST is not set | 526 | # CONFIG_RCU_TORTURE_TEST is not set |
527 | # CONFIG_GPROF is not set | 527 | # CONFIG_GPROF is not set |
528 | # CONFIG_GCOV is not set | 528 | # CONFIG_GCOV is not set |
529 | # CONFIG_SYSCALL_DEBUG is not set | ||
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile index fe08971b64cf..82b435897256 100644 --- a/arch/um/kernel/Makefile +++ b/arch/um/kernel/Makefile | |||
@@ -15,7 +15,6 @@ obj-y = config.o exec_kern.o exitcode.o \ | |||
15 | obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o | 15 | obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o |
16 | obj-$(CONFIG_GPROF) += gprof_syms.o | 16 | obj-$(CONFIG_GPROF) += gprof_syms.o |
17 | obj-$(CONFIG_GCOV) += gmon_syms.o | 17 | obj-$(CONFIG_GCOV) += gmon_syms.o |
18 | obj-$(CONFIG_SYSCALL_DEBUG) += syscall.o | ||
19 | 18 | ||
20 | obj-$(CONFIG_MODE_TT) += tt/ | 19 | obj-$(CONFIG_MODE_TT) += tt/ |
21 | obj-$(CONFIG_MODE_SKAS) += skas/ | 20 | obj-$(CONFIG_MODE_SKAS) += skas/ |
diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c index 51fb94076fcf..0ae4eea21be4 100644 --- a/arch/um/kernel/skas/syscall.c +++ b/arch/um/kernel/skas/syscall.c | |||
@@ -18,11 +18,7 @@ void handle_syscall(union uml_pt_regs *r) | |||
18 | struct pt_regs *regs = container_of(r, struct pt_regs, regs); | 18 | struct pt_regs *regs = container_of(r, struct pt_regs, regs); |
19 | long result; | 19 | long result; |
20 | int syscall; | 20 | int syscall; |
21 | #ifdef UML_CONFIG_SYSCALL_DEBUG | ||
22 | int index; | ||
23 | 21 | ||
24 | index = record_syscall_start(UPT_SYSCALL_NR(r)); | ||
25 | #endif | ||
26 | syscall_trace(r, 0); | 22 | syscall_trace(r, 0); |
27 | 23 | ||
28 | current->thread.nsyscalls++; | 24 | current->thread.nsyscalls++; |
@@ -44,7 +40,4 @@ void handle_syscall(union uml_pt_regs *r) | |||
44 | REGS_SET_SYSCALL_RETURN(r->skas.regs, result); | 40 | REGS_SET_SYSCALL_RETURN(r->skas.regs, result); |
45 | 41 | ||
46 | syscall_trace(r, 1); | 42 | syscall_trace(r, 1); |
47 | #ifdef UML_CONFIG_SYSCALL_DEBUG | ||
48 | record_syscall_end(index, result); | ||
49 | #endif | ||
50 | } | 43 | } |
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c deleted file mode 100644 index 1731d90e6850..000000000000 --- a/arch/um/kernel/syscall.c +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #include "kern_util.h" | ||
7 | #include "syscall.h" | ||
8 | #include "os.h" | ||
9 | |||
10 | struct { | ||
11 | int syscall; | ||
12 | int pid; | ||
13 | long result; | ||
14 | unsigned long long start; | ||
15 | unsigned long long end; | ||
16 | } syscall_record[1024]; | ||
17 | |||
18 | int record_syscall_start(int syscall) | ||
19 | { | ||
20 | int max, index; | ||
21 | |||
22 | max = sizeof(syscall_record)/sizeof(syscall_record[0]); | ||
23 | index = next_syscall_index(max); | ||
24 | |||
25 | syscall_record[index].syscall = syscall; | ||
26 | syscall_record[index].pid = current_pid(); | ||
27 | syscall_record[index].result = 0xdeadbeef; | ||
28 | syscall_record[index].start = os_nsecs(); | ||
29 | return(index); | ||
30 | } | ||
31 | |||
32 | void record_syscall_end(int index, long result) | ||
33 | { | ||
34 | syscall_record[index].result = result; | ||
35 | syscall_record[index].end = os_nsecs(); | ||
36 | } | ||
diff --git a/arch/um/kernel/tt/syscall_kern.c b/arch/um/kernel/tt/syscall_kern.c index 3fda9a03c59a..293caa6d0c2d 100644 --- a/arch/um/kernel/tt/syscall_kern.c +++ b/arch/um/kernel/tt/syscall_kern.c | |||
@@ -21,18 +21,11 @@ void syscall_handler_tt(int sig, struct pt_regs *regs) | |||
21 | void *sc; | 21 | void *sc; |
22 | long result; | 22 | long result; |
23 | int syscall; | 23 | int syscall; |
24 | #ifdef CONFIG_SYSCALL_DEBUG | 24 | |
25 | int index; | ||
26 | #endif | ||
27 | sc = UPT_SC(®s->regs); | 25 | sc = UPT_SC(®s->regs); |
28 | SC_START_SYSCALL(sc); | 26 | SC_START_SYSCALL(sc); |
29 | 27 | ||
30 | syscall = UPT_SYSCALL_NR(®s->regs); | 28 | syscall = UPT_SYSCALL_NR(®s->regs); |
31 | |||
32 | #ifdef CONFIG_SYSCALL_DEBUG | ||
33 | index = record_syscall_start(syscall); | ||
34 | #endif | ||
35 | |||
36 | syscall_trace(®s->regs, 0); | 29 | syscall_trace(®s->regs, 0); |
37 | 30 | ||
38 | current->thread.nsyscalls++; | 31 | current->thread.nsyscalls++; |
@@ -50,7 +43,4 @@ void syscall_handler_tt(int sig, struct pt_regs *regs) | |||
50 | SC_SET_SYSCALL_RETURN(sc, result); | 43 | SC_SET_SYSCALL_RETURN(sc, result); |
51 | 44 | ||
52 | syscall_trace(®s->regs, 1); | 45 | syscall_trace(®s->regs, 1); |
53 | #ifdef CONFIG_SYSCALL_DEBUG | ||
54 | record_syscall_end(index, result); | ||
55 | #endif | ||
56 | } | 46 | } |
diff --git a/arch/um/kernel/tt/tracer.c b/arch/um/kernel/tt/tracer.c index 71daae24e48a..9882342206ec 100644 --- a/arch/um/kernel/tt/tracer.c +++ b/arch/um/kernel/tt/tracer.c | |||
@@ -188,10 +188,7 @@ int tracer(int (*init_proc)(void *), void *sp) | |||
188 | int status, pid = 0, sig = 0, cont_type, tracing = 0, op = 0; | 188 | int status, pid = 0, sig = 0, cont_type, tracing = 0, op = 0; |
189 | int proc_id = 0, n, err, old_tracing = 0, strace = 0; | 189 | int proc_id = 0, n, err, old_tracing = 0, strace = 0; |
190 | int local_using_sysemu = 0; | 190 | int local_using_sysemu = 0; |
191 | #ifdef UML_CONFIG_SYSCALL_DEBUG | 191 | |
192 | unsigned long eip = 0; | ||
193 | int last_index; | ||
194 | #endif | ||
195 | signal(SIGPIPE, SIG_IGN); | 192 | signal(SIGPIPE, SIG_IGN); |
196 | setup_tracer_winch(); | 193 | setup_tracer_winch(); |
197 | tracing_pid = os_getpid(); | 194 | tracing_pid = os_getpid(); |
@@ -282,23 +279,6 @@ int tracer(int (*init_proc)(void *), void *sp) | |||
282 | else if(WIFSTOPPED(status)){ | 279 | else if(WIFSTOPPED(status)){ |
283 | proc_id = pid_to_processor_id(pid); | 280 | proc_id = pid_to_processor_id(pid); |
284 | sig = WSTOPSIG(status); | 281 | sig = WSTOPSIG(status); |
285 | #ifdef UML_CONFIG_SYSCALL_DEBUG | ||
286 | if(signal_index[proc_id] == 1024){ | ||
287 | signal_index[proc_id] = 0; | ||
288 | last_index = 1023; | ||
289 | } | ||
290 | else last_index = signal_index[proc_id] - 1; | ||
291 | if(((sig == SIGPROF) || (sig == SIGVTALRM) || | ||
292 | (sig == SIGALRM)) && | ||
293 | (signal_record[proc_id][last_index].signal == sig)&& | ||
294 | (signal_record[proc_id][last_index].pid == pid)) | ||
295 | signal_index[proc_id] = last_index; | ||
296 | signal_record[proc_id][signal_index[proc_id]].pid = pid; | ||
297 | gettimeofday(&signal_record[proc_id][signal_index[proc_id]].time, NULL); | ||
298 | eip = ptrace(PTRACE_PEEKUSR, pid, PT_IP_OFFSET, 0); | ||
299 | signal_record[proc_id][signal_index[proc_id]].addr = eip; | ||
300 | signal_record[proc_id][signal_index[proc_id]++].signal = sig; | ||
301 | #endif | ||
302 | if(proc_id == -1){ | 282 | if(proc_id == -1){ |
303 | sleeping_process_signal(pid, sig); | 283 | sleeping_process_signal(pid, sig); |
304 | continue; | 284 | continue; |