Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158469
b: refs/heads/master
c: 57421db
h: refs/heads/master
i:
  158467: dbfec94
v: v3
  • Loading branch information
Jason Baron authored and Frederic Weisbecker committed Aug 26, 2009
1 parent a1861b6 commit 2a24d44
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 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: a5a2f8e2acb991327952c45a13f5441fc09dffd6
refs/heads/master: 57421dbbdc932d65f0e6a41ebb027a2bfe3d0669
8 changes: 4 additions & 4 deletions trunk/arch/x86/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ static struct syscall_metadata *find_syscall_meta(unsigned long *syscall)

struct syscall_metadata *syscall_nr_to_meta(int nr)
{
if (!syscalls_metadata || nr >= FTRACE_SYSCALL_MAX || nr < 0)
if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
return NULL;

return syscalls_metadata[nr];
Expand All @@ -507,7 +507,7 @@ int syscall_name_to_nr(char *name)
if (!syscalls_metadata)
return -1;

for (i = 0; i < FTRACE_SYSCALL_MAX; i++) {
for (i = 0; i < NR_syscalls; i++) {
if (syscalls_metadata[i]) {
if (!strcmp(syscalls_metadata[i]->name, name))
return i;
Expand All @@ -533,13 +533,13 @@ static int __init arch_init_ftrace_syscalls(void)
unsigned long **psys_syscall_table = &sys_call_table;

syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
FTRACE_SYSCALL_MAX, GFP_KERNEL);
NR_syscalls, GFP_KERNEL);
if (!syscalls_metadata) {
WARN_ON(1);
return -ENOMEM;
}

for (i = 0; i < FTRACE_SYSCALL_MAX; i++) {
for (i = 0; i < NR_syscalls; i++) {
meta = find_syscall_meta(psys_syscall_table[i]);
syscalls_metadata[i] = meta;
}
Expand Down
24 changes: 12 additions & 12 deletions trunk/kernel/trace/trace_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
static DEFINE_MUTEX(syscall_trace_lock);
static int sys_refcount_enter;
static int sys_refcount_exit;
static DECLARE_BITMAP(enabled_enter_syscalls, FTRACE_SYSCALL_MAX);
static DECLARE_BITMAP(enabled_exit_syscalls, FTRACE_SYSCALL_MAX);
static DECLARE_BITMAP(enabled_enter_syscalls, NR_syscalls);
static DECLARE_BITMAP(enabled_exit_syscalls, NR_syscalls);

enum print_line_t
print_syscall_enter(struct trace_iterator *iter, int flags)
Expand Down Expand Up @@ -289,7 +289,7 @@ int reg_event_syscall_enter(void *ptr)

name = (char *)ptr;
num = syscall_name_to_nr(name);
if (num < 0 || num >= FTRACE_SYSCALL_MAX)
if (num < 0 || num >= NR_syscalls)
return -ENOSYS;
mutex_lock(&syscall_trace_lock);
if (!sys_refcount_enter)
Expand All @@ -312,7 +312,7 @@ void unreg_event_syscall_enter(void *ptr)

name = (char *)ptr;
num = syscall_name_to_nr(name);
if (num < 0 || num >= FTRACE_SYSCALL_MAX)
if (num < 0 || num >= NR_syscalls)
return;
mutex_lock(&syscall_trace_lock);
sys_refcount_enter--;
Expand All @@ -330,7 +330,7 @@ int reg_event_syscall_exit(void *ptr)

name = (char *)ptr;
num = syscall_name_to_nr(name);
if (num < 0 || num >= FTRACE_SYSCALL_MAX)
if (num < 0 || num >= NR_syscalls)
return -ENOSYS;
mutex_lock(&syscall_trace_lock);
if (!sys_refcount_exit)
Expand All @@ -353,7 +353,7 @@ void unreg_event_syscall_exit(void *ptr)

name = (char *)ptr;
num = syscall_name_to_nr(name);
if (num < 0 || num >= FTRACE_SYSCALL_MAX)
if (num < 0 || num >= NR_syscalls)
return;
mutex_lock(&syscall_trace_lock);
sys_refcount_exit--;
Expand All @@ -373,8 +373,8 @@ struct trace_event event_syscall_exit = {

#ifdef CONFIG_EVENT_PROFILE

static DECLARE_BITMAP(enabled_prof_enter_syscalls, FTRACE_SYSCALL_MAX);
static DECLARE_BITMAP(enabled_prof_exit_syscalls, FTRACE_SYSCALL_MAX);
static DECLARE_BITMAP(enabled_prof_enter_syscalls, NR_syscalls);
static DECLARE_BITMAP(enabled_prof_exit_syscalls, NR_syscalls);
static int sys_prof_refcount_enter;
static int sys_prof_refcount_exit;

Expand Down Expand Up @@ -420,7 +420,7 @@ int reg_prof_syscall_enter(char *name)
int num;

num = syscall_name_to_nr(name);
if (num < 0 || num >= FTRACE_SYSCALL_MAX)
if (num < 0 || num >= NR_syscalls)
return -ENOSYS;

mutex_lock(&syscall_trace_lock);
Expand All @@ -442,7 +442,7 @@ void unreg_prof_syscall_enter(char *name)
int num;

num = syscall_name_to_nr(name);
if (num < 0 || num >= FTRACE_SYSCALL_MAX)
if (num < 0 || num >= NR_syscalls)
return;

mutex_lock(&syscall_trace_lock);
Expand Down Expand Up @@ -481,7 +481,7 @@ int reg_prof_syscall_exit(char *name)
int num;

num = syscall_name_to_nr(name);
if (num < 0 || num >= FTRACE_SYSCALL_MAX)
if (num < 0 || num >= NR_syscalls)
return -ENOSYS;

mutex_lock(&syscall_trace_lock);
Expand All @@ -503,7 +503,7 @@ void unreg_prof_syscall_exit(char *name)
int num;

num = syscall_name_to_nr(name);
if (num < 0 || num >= FTRACE_SYSCALL_MAX)
if (num < 0 || num >= NR_syscalls)
return;

mutex_lock(&syscall_trace_lock);
Expand Down

0 comments on commit 2a24d44

Please sign in to comment.