Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121108
b: refs/heads/master
c: 62d59d1
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Nov 12, 2008
1 parent b12c889 commit 16a43a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 41 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: 68f96c0c889b55bf62eee98e859cb686f8850188
refs/heads/master: 62d59d17a5f98edb48b171742dfa531488802f07
43 changes: 5 additions & 38 deletions trunk/arch/x86/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,62 +44,37 @@ void ftrace_nmi_exit(void)
atomic_dec(&in_nmi);
}

/*
* Synchronize accesses to return adresses stack with
* interrupts.
*/
static raw_spinlock_t ret_stack_lock;

/* Add a function return address to the trace stack on thread info.*/
static int push_return_trace(unsigned long ret, unsigned long long time,
unsigned long func)
{
int index;
struct thread_info *ti;
unsigned long flags;
int err = 0;

raw_local_irq_save(flags);
__raw_spin_lock(&ret_stack_lock);
struct thread_info *ti = current_thread_info();

ti = current_thread_info();
/* The return trace stack is full */
if (ti->curr_ret_stack == FTRACE_RET_STACK_SIZE - 1) {
err = -EBUSY;
goto out;
}
if (ti->curr_ret_stack == FTRACE_RET_STACK_SIZE - 1)
return -EBUSY;

index = ++ti->curr_ret_stack;
ti->ret_stack[index].ret = ret;
ti->ret_stack[index].func = func;
ti->ret_stack[index].calltime = time;

out:
__raw_spin_unlock(&ret_stack_lock);
raw_local_irq_restore(flags);
return err;
return 0;
}

/* Retrieve a function return address to the trace stack on thread info.*/
static void pop_return_trace(unsigned long *ret, unsigned long long *time,
unsigned long *func)
{
struct thread_info *ti;
int index;
unsigned long flags;

raw_local_irq_save(flags);
__raw_spin_lock(&ret_stack_lock);

ti = current_thread_info();
struct thread_info *ti = current_thread_info();
index = ti->curr_ret_stack;
*ret = ti->ret_stack[index].ret;
*func = ti->ret_stack[index].func;
*time = ti->ret_stack[index].calltime;
ti->curr_ret_stack--;

__raw_spin_unlock(&ret_stack_lock);
raw_local_irq_restore(flags);
}

/*
Expand Down Expand Up @@ -175,14 +150,6 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
*parent = old;
}

static int __init init_ftrace_function_return(void)
{
ret_stack_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
return 0;
}
device_initcall(init_ftrace_function_return);


#endif

#ifdef CONFIG_DYNAMIC_FTRACE
Expand Down
4 changes: 2 additions & 2 deletions trunk/scripts/bootgraph.pl
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
my %rows;
my $rowscount = 1;
my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);

foreach my $key (@initcalls) {
my $key;
foreach $key (@initcalls) {
my $duration = $end{$key} - $start{$key};

if ($duration >= $threshold) {
Expand Down

0 comments on commit 16a43a9

Please sign in to comment.