Merge branches 'tracing/branch-tracer', 'tracing/fastboot', 'tracing/function-return-tracer' and 'tracing/urgent' into tracing/core
This commit is contained in:
@@ -1217,12 +1217,9 @@ trace_return:
|
|||||||
pushl %eax
|
pushl %eax
|
||||||
pushl %ecx
|
pushl %ecx
|
||||||
pushl %edx
|
pushl %edx
|
||||||
movl 0xc(%esp), %eax
|
movl 0xc(%esp), %edx
|
||||||
pushl %eax
|
|
||||||
lea 0x4(%ebp), %eax
|
lea 0x4(%ebp), %eax
|
||||||
pushl %eax
|
|
||||||
call prepare_ftrace_return
|
call prepare_ftrace_return
|
||||||
addl $8, %esp
|
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %ecx
|
popl %ecx
|
||||||
popl %eax
|
popl %eax
|
||||||
|
@@ -44,62 +44,37 @@ void ftrace_nmi_exit(void)
|
|||||||
atomic_dec(&in_nmi);
|
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.*/
|
/* Add a function return address to the trace stack on thread info.*/
|
||||||
static int push_return_trace(unsigned long ret, unsigned long long time,
|
static int push_return_trace(unsigned long ret, unsigned long long time,
|
||||||
unsigned long func)
|
unsigned long func)
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
struct thread_info *ti;
|
struct thread_info *ti = current_thread_info();
|
||||||
unsigned long flags;
|
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
raw_local_irq_save(flags);
|
|
||||||
__raw_spin_lock(&ret_stack_lock);
|
|
||||||
|
|
||||||
ti = current_thread_info();
|
|
||||||
/* The return trace stack is full */
|
/* The return trace stack is full */
|
||||||
if (ti->curr_ret_stack == FTRACE_RET_STACK_SIZE - 1) {
|
if (ti->curr_ret_stack == FTRACE_RET_STACK_SIZE - 1)
|
||||||
err = -EBUSY;
|
return -EBUSY;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
index = ++ti->curr_ret_stack;
|
index = ++ti->curr_ret_stack;
|
||||||
ti->ret_stack[index].ret = ret;
|
ti->ret_stack[index].ret = ret;
|
||||||
ti->ret_stack[index].func = func;
|
ti->ret_stack[index].func = func;
|
||||||
ti->ret_stack[index].calltime = time;
|
ti->ret_stack[index].calltime = time;
|
||||||
|
|
||||||
out:
|
return 0;
|
||||||
__raw_spin_unlock(&ret_stack_lock);
|
|
||||||
raw_local_irq_restore(flags);
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Retrieve a function return address to the trace stack on thread info.*/
|
/* Retrieve a function return address to the trace stack on thread info.*/
|
||||||
static void pop_return_trace(unsigned long *ret, unsigned long long *time,
|
static void pop_return_trace(unsigned long *ret, unsigned long long *time,
|
||||||
unsigned long *func)
|
unsigned long *func)
|
||||||
{
|
{
|
||||||
struct thread_info *ti;
|
|
||||||
int index;
|
int index;
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
raw_local_irq_save(flags);
|
struct thread_info *ti = current_thread_info();
|
||||||
__raw_spin_lock(&ret_stack_lock);
|
|
||||||
|
|
||||||
ti = current_thread_info();
|
|
||||||
index = ti->curr_ret_stack;
|
index = ti->curr_ret_stack;
|
||||||
*ret = ti->ret_stack[index].ret;
|
*ret = ti->ret_stack[index].ret;
|
||||||
*func = ti->ret_stack[index].func;
|
*func = ti->ret_stack[index].func;
|
||||||
*time = ti->ret_stack[index].calltime;
|
*time = ti->ret_stack[index].calltime;
|
||||||
ti->curr_ret_stack--;
|
ti->curr_ret_stack--;
|
||||||
|
|
||||||
__raw_spin_unlock(&ret_stack_lock);
|
|
||||||
raw_local_irq_restore(flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -120,7 +95,6 @@ unsigned long ftrace_return_to_handler(void)
|
|||||||
* Hook the return address and push it in the stack of return addrs
|
* Hook the return address and push it in the stack of return addrs
|
||||||
* in current thread info.
|
* in current thread info.
|
||||||
*/
|
*/
|
||||||
asmlinkage
|
|
||||||
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
|
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
|
||||||
{
|
{
|
||||||
unsigned long old;
|
unsigned long old;
|
||||||
@@ -175,14 +149,6 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
|
|||||||
*parent = old;
|
*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
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DYNAMIC_FTRACE
|
#ifdef CONFIG_DYNAMIC_FTRACE
|
||||||
|
@@ -53,8 +53,14 @@ void tracing_off(void)
|
|||||||
/* FIXME!!! */
|
/* FIXME!!! */
|
||||||
u64 ring_buffer_time_stamp(int cpu)
|
u64 ring_buffer_time_stamp(int cpu)
|
||||||
{
|
{
|
||||||
|
u64 time;
|
||||||
|
|
||||||
|
preempt_disable_notrace();
|
||||||
/* shift to debug/test normalization and TIME_EXTENTS */
|
/* shift to debug/test normalization and TIME_EXTENTS */
|
||||||
return sched_clock() << DEBUG_SHIFT;
|
time = sched_clock() << DEBUG_SHIFT;
|
||||||
|
preempt_enable_notrace();
|
||||||
|
|
||||||
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ring_buffer_normalize_time_stamp(int cpu, u64 *ts)
|
void ring_buffer_normalize_time_stamp(int cpu, u64 *ts)
|
||||||
|
@@ -109,8 +109,8 @@ my $stylecounter = 0;
|
|||||||
my %rows;
|
my %rows;
|
||||||
my $rowscount = 1;
|
my $rowscount = 1;
|
||||||
my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);
|
my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start);
|
||||||
my $key;
|
|
||||||
foreach $key (@initcalls) {
|
foreach my $key (@initcalls) {
|
||||||
my $duration = $end{$key} - $start{$key};
|
my $duration = $end{$key} - $start{$key};
|
||||||
|
|
||||||
if ($duration >= $threshold) {
|
if ($duration >= $threshold) {
|
||||||
|
Reference in New Issue
Block a user