Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173399
b: refs/heads/master
c: 5852b20
h: refs/heads/master
i:
  173397: 0b33827
  173395: 54d8c0e
  173391: 4247626
v: v3
  • Loading branch information
Paul Mundt committed Oct 13, 2009
1 parent 1d6b880 commit bbfdaf6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 913df4453f85f1fe79b35ecf3c9a0c0b707d22a2
refs/heads/master: 5852b203ef1b85a8eacc1cc686ed9bac11ee31cc
37 changes: 27 additions & 10 deletions trunk/arch/sh/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit bbfdaf6

Please sign in to comment.