diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-10-13 12:45:08 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-13 12:45:08 +0900 |
commit | 5852b203ef1b85a8eacc1cc686ed9bac11ee31cc (patch) | |
tree | 2dbc4b445238161c0af03ca47bde811ae711584c /arch/sh | |
parent | 913df4453f85f1fe79b35ecf3c9a0c0b707d22a2 (diff) | |
parent | 99222622422ac3398a846645f190109e218c743c (diff) | |
download | linux-5852b203ef1b85a8eacc1cc686ed9bac11ee31cc.tar.bz2 |
Merge branch 'sh/stable-updates'
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/ftrace.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c index a3dcc6d5d253..2c48e267256e 100644 --- a/arch/sh/kernel/ftrace.c +++ b/arch/sh/kernel/ftrace.c @@ -291,31 +291,48 @@ struct syscall_metadata *syscall_nr_to_meta(int nr) return syscalls_metadata[nr]; } -void arch_init_ftrace_syscalls(void) +int syscall_name_to_nr(char *name) +{ + int i; + + if (!syscalls_metadata) + return -1; + for (i = 0; i < NR_syscalls; i++) + if (syscalls_metadata[i]) + if (!strcmp(syscalls_metadata[i]->name, name)) + return i; + return -1; +} + +void set_syscall_enter_id(int num, int id) +{ + syscalls_metadata[num]->enter_id = id; +} + +void set_syscall_exit_id(int num, int id) +{ + syscalls_metadata[num]->exit_id = id; +} + +static int __init arch_init_ftrace_syscalls(void) { int i; struct syscall_metadata *meta; unsigned long **psys_syscall_table = &sys_call_table; - static atomic_t refs; - - if (atomic_inc_return(&refs) != 1) - goto end; syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * FTRACE_SYSCALL_MAX, GFP_KERNEL); if (!syscalls_metadata) { WARN_ON(1); - return; + return -ENOMEM; } for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { meta = find_syscall_meta(psys_syscall_table[i]); syscalls_metadata[i] = meta; } - return; - /* Paranoid: avoid overflow */ -end: - atomic_dec(&refs); + return 0; } +arch_initcall(arch_init_ftrace_syscalls); #endif /* CONFIG_FTRACE_SYSCALLS */ |