Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121267
b: refs/heads/master
c: 8b96f01
h: refs/heads/master
i:
  121265: 1a4e149
  121263: 221c779
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Dec 8, 2008
1 parent d09aad7 commit 4c59f80
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 16 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: decbec3838d10ecd7aabdb4c0e05aac0e5f5dc0c
refs/heads/master: 8b96f0119818964e4944fd1c423bf6770027d3ac
6 changes: 0 additions & 6 deletions trunk/arch/x86/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
CFLAGS_REMOVE_ftrace.o = -pg
endif

ifdef CONFIG_FUNCTION_GRAPH_TRACER
# Don't trace __switch_to() but let it for function tracer
CFLAGS_REMOVE_process_32.o = -pg
CFLAGS_REMOVE_process_64.o = -pg
endif

#
# vsyscalls (which work on the user stack) should have
# no stack-protector checks:
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/x86/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/percpu.h>
#include <linux/prctl.h>
#include <linux/dmi.h>
#include <linux/ftrace.h>

#include <asm/uaccess.h>
#include <asm/pgtable.h>
Expand Down Expand Up @@ -548,7 +549,8 @@ __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
* the task-switch, and shows up in ret_from_fork in entry.S,
* for example.
*/
struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
__notrace_funcgraph struct task_struct *
__switch_to(struct task_struct *prev_p, struct task_struct *next_p)
{
struct thread_struct *prev = &prev_p->thread,
*next = &next_p->thread;
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/prctl.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/ftrace.h>

#include <asm/pgtable.h>
#include <asm/system.h>
Expand Down Expand Up @@ -551,8 +552,9 @@ static inline void __switch_to_xtra(struct task_struct *prev_p,
* - could test fs/gs bitsliced
*
* Kprobes not supported here. Set the probe on schedule instead.
* Function graph tracer not supported too.
*/
struct task_struct *
__notrace_funcgraph struct task_struct *
__switch_to(struct task_struct *prev_p, struct task_struct *next_p)
{
struct thread_struct *prev = &prev_p->thread;
Expand Down
11 changes: 11 additions & 0 deletions trunk/include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ struct ftrace_graph_ret {
};

#ifdef CONFIG_FUNCTION_GRAPH_TRACER

/*
* Sometimes we don't want to trace a function with the function
* graph tracer but we want them to keep traced by the usual function
* tracer if the function graph tracer is not configured.
*/
#define __notrace_funcgraph notrace

#define FTRACE_RETFUNC_DEPTH 50
#define FTRACE_RETSTACK_ALLOC_SIZE 32
/* Type of the callback handlers for tracing function graph*/
Expand All @@ -394,6 +402,9 @@ static inline int task_curr_ret_stack(struct task_struct *t)
return t->curr_ret_stack;
}
#else

#define __notrace_funcgraph

static inline void ftrace_graph_init_task(struct task_struct *t) { }
static inline void ftrace_graph_exit_task(struct task_struct *t) { }

Expand Down
4 changes: 0 additions & 4 deletions trunk/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ CFLAGS_REMOVE_cgroup-debug.o = -pg
CFLAGS_REMOVE_sched_clock.o = -pg
CFLAGS_REMOVE_sched.o = -pg
endif
ifdef CONFIG_FUNCTION_GRAPH_TRACER
CFLAGS_REMOVE_extable.o = -pg # For __kernel_text_address()
CFLAGS_REMOVE_module.o = -pg # For __module_text_address()
endif

obj-$(CONFIG_FREEZER) += freezer.o
obj-$(CONFIG_PROFILING) += profile.o
Expand Down
5 changes: 3 additions & 2 deletions trunk/kernel/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/ftrace.h>
#include <asm/uaccess.h>
#include <asm/sections.h>

Expand All @@ -40,7 +41,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
return e;
}

int core_kernel_text(unsigned long addr)
__notrace_funcgraph int core_kernel_text(unsigned long addr)
{
if (addr >= (unsigned long)_stext &&
addr <= (unsigned long)_etext)
Expand All @@ -53,7 +54,7 @@ int core_kernel_text(unsigned long addr)
return 0;
}

int __kernel_text_address(unsigned long addr)
__notrace_funcgraph int __kernel_text_address(unsigned long addr)
{
if (core_kernel_text(addr))
return 1;
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -2704,7 +2704,7 @@ int is_module_address(unsigned long addr)


/* Is this a valid kernel address? */
struct module *__module_text_address(unsigned long addr)
__notrace_funcgraph struct module *__module_text_address(unsigned long addr)
{
struct module *mod;

Expand Down

0 comments on commit 4c59f80

Please sign in to comment.