Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121068
b: refs/heads/master
c: 7e5e26a
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Nov 3, 2008
1 parent bc47981 commit dd30dc7
Show file tree
Hide file tree
Showing 25 changed files with 159 additions and 536 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: 3e03fb7f1da2e691644526c0d6df42d778716349
refs/heads/master: 7e5e26a3d8ac4bcadb380073dc9604c07a9a6198
5 changes: 0 additions & 5 deletions trunk/arch/arm/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef _ASM_ARM_FTRACE
#define _ASM_ARM_FTRACE

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#ifdef CONFIG_FUNCTION_TRACER
#define MCOUNT_ADDR ((long)(mcount))
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/powerpc/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef _ASM_POWERPC_FTRACE
#define _ASM_POWERPC_FTRACE

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#ifdef CONFIG_FUNCTION_TRACER
#define MCOUNT_ADDR ((long)(_mcount))
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/sh/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef __ASM_SH_FTRACE_H
#define __ASM_SH_FTRACE_H

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#ifndef __ASSEMBLY__
extern void mcount(void);
#endif
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/sparc/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef _ASM_SPARC64_FTRACE
#define _ASM_SPARC64_FTRACE

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#ifdef CONFIG_MCOUNT
#define MCOUNT_ADDR ((long)(_mcount))
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ config X86
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_DYNAMIC_FTRACE
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
select HAVE_ARCH_KGDB if !X86_VOYAGER
select HAVE_ARCH_TRACEHOOK
Expand Down
16 changes: 0 additions & 16 deletions trunk/arch/x86/include/asm/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,7 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
*/
return addr - 1;
}

#ifdef CONFIG_DYNAMIC_FTRACE
extern void ftrace_nmi_enter(void);
extern void ftrace_nmi_exit(void);
#else
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif
#endif /* __ASSEMBLY__ */

#else /* CONFIG_FUNCTION_TRACER */

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#endif /* CONFIG_FUNCTION_TRACER */

#endif /* _ASM_X86_FTRACE_H */
6 changes: 0 additions & 6 deletions trunk/arch/x86/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,6 @@ ENTRY(mcount)
END(mcount)

ENTRY(ftrace_caller)
cmpl $0, function_trace_stop
jne ftrace_stub

pushl %eax
pushl %ecx
pushl %edx
Expand All @@ -1183,9 +1180,6 @@ END(ftrace_caller)
#else /* ! CONFIG_DYNAMIC_FTRACE */

ENTRY(mcount)
cmpl $0, function_trace_stop
jne ftrace_stub

cmpl $ftrace_stub, ftrace_trace_function
jnz trace
.globl ftrace_stub
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/x86/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ ENTRY(mcount)
END(mcount)

ENTRY(ftrace_caller)
cmpl $0, function_trace_stop
jne ftrace_stub

/* taken from glibc */
subq $0x38, %rsp
Expand Down Expand Up @@ -105,9 +103,6 @@ END(ftrace_caller)

#else /* ! CONFIG_DYNAMIC_FTRACE */
ENTRY(mcount)
cmpl $0, function_trace_stop
jne ftrace_stub

cmpq $ftrace_stub, ftrace_trace_function
jnz trace
.globl ftrace_stub
Expand Down
18 changes: 1 addition & 17 deletions trunk/drivers/char/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,22 +274,6 @@ static struct sysrq_key_op sysrq_showstate_blocked_op = {
.enable_mask = SYSRQ_ENABLE_DUMP,
};

#ifdef CONFIG_TRACING
#include <linux/ftrace.h>

static void sysrq_ftrace_dump(int key, struct tty_struct *tty)
{
ftrace_dump();
}
static struct sysrq_key_op sysrq_ftrace_dump_op = {
.handler = sysrq_ftrace_dump,
.help_msg = "dumpZ-ftrace-buffer",
.action_msg = "Dump ftrace buffer",
.enable_mask = SYSRQ_ENABLE_DUMP,
};
#else
#define sysrq_ftrace_dump_op (*(struct sysrq_key_op *)0)
#endif

static void sysrq_handle_showmem(int key, struct tty_struct *tty)
{
Expand Down Expand Up @@ -422,7 +406,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
NULL, /* x */
/* y: May be registered on sparc64 for global register dump */
NULL, /* y */
&sysrq_ftrace_dump_op, /* z */
NULL /* z */
};

/* key2index calculation, -1 on invalid index */
Expand Down
64 changes: 6 additions & 58 deletions trunk/include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,6 @@ struct ftrace_ops {
struct ftrace_ops *next;
};

extern int function_trace_stop;

/**
* ftrace_stop - stop function tracer.
*
* A quick way to stop the function tracer. Note this an on off switch,
* it is not something that is recursive like preempt_disable.
* This does not disable the calling of mcount, it only stops the
* calling of functions from mcount.
*/
static inline void ftrace_stop(void)
{
function_trace_stop = 1;
}

/**
* ftrace_start - start the function tracer.
*
* This function is the inverse of ftrace_stop. This does not enable
* the function tracing if the function tracer is disabled. This only
* sets the function tracer flag to continue calling the functions
* from mcount.
*/
static inline void ftrace_start(void)
{
function_trace_stop = 0;
}

/*
* The ftrace_ops must be a static and should also
* be read_mostly. These functions do modify read_mostly variables
Expand All @@ -69,12 +41,9 @@ extern void ftrace_stub(unsigned long a0, unsigned long a1);
# define unregister_ftrace_function(ops) do { } while (0)
# define clear_ftrace_function(ops) do { } while (0)
static inline void ftrace_kill(void) { }
static inline void ftrace_stop(void) { }
static inline void ftrace_start(void) { }
#endif /* CONFIG_FUNCTION_TRACER */

#ifdef CONFIG_DYNAMIC_FTRACE

enum {
FTRACE_FL_FREE = (1 << 0),
FTRACE_FL_FAILED = (1 << 1),
Expand Down Expand Up @@ -135,6 +104,8 @@ extern void ftrace_release(void *start, unsigned long size);

extern void ftrace_disable_daemon(void);
extern void ftrace_enable_daemon(void);
extern void ftrace_nmi_enter(void);
extern void ftrace_nmi_exit(void);

#else
# define skip_trace(ip) ({ 0; })
Expand All @@ -143,6 +114,8 @@ extern void ftrace_enable_daemon(void);
# define ftrace_disable_daemon() do { } while (0)
# define ftrace_enable_daemon() do { } while (0)
static inline void ftrace_release(void *start, unsigned long size) { }
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif /* CONFIG_DYNAMIC_FTRACE */

/* totally disable ftrace - can not re-enable after this */
Expand Down Expand Up @@ -216,9 +189,6 @@ static inline void __ftrace_enabled_restore(int enabled)
#ifdef CONFIG_TRACING
extern int ftrace_dump_on_oops;

extern void tracing_start(void);
extern void tracing_stop(void);

extern void
ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);

Expand Down Expand Up @@ -249,8 +219,6 @@ ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
static inline int
ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)));

static inline void tracing_start(void) { }
static inline void tracing_stop(void) { }
static inline int
ftrace_printk(const char *fmt, ...)
{
Expand All @@ -269,11 +237,6 @@ ftrace_init_module(unsigned long *start, unsigned long *end) { }
#endif


/*
* Structure which defines the trace of an initcall.
* You don't have to fill the func field since it is
* only used internally by the tracer.
*/
struct boot_trace {
pid_t caller;
char func[KSYM_NAME_LEN];
Expand All @@ -284,28 +247,13 @@ struct boot_trace {
};

#ifdef CONFIG_BOOT_TRACER
/* Append the trace on the ring-buffer */
extern void trace_boot(struct boot_trace *it, initcall_t fn);

/* Tells the tracer that smp_pre_initcall is finished.
* So we can start the tracing
*/
extern void start_boot_trace(void);

/* Resume the tracing of other necessary events
* such as sched switches
*/
extern void enable_boot_trace(void);

/* Suspend this tracing. Actually, only sched_switches tracing have
* to be suspended. Initcalls doesn't need it.)
*/
extern void disable_boot_trace(void);
extern void stop_boot_trace(void);
#else
static inline void trace_boot(struct boot_trace *it, initcall_t fn) { }
static inline void start_boot_trace(void) { }
static inline void enable_boot_trace(void) { }
static inline void disable_boot_trace(void) { }
static inline void stop_boot_trace(void) { }
#endif


Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <linux/preempt.h>
#include <linux/smp_lock.h>
#include <linux/lockdep.h>
#include <linux/ftrace.h>
#include <asm/hardirq.h>
#include <asm/ftrace.h>
#include <asm/system.h>

/*
Expand Down
4 changes: 1 addition & 3 deletions trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,6 @@ int do_one_initcall(initcall_t fn)
it.caller = task_pid_nr(current);
printk("calling %pF @ %i\n", fn, it.caller);
it.calltime = ktime_get();
enable_boot_trace();
}

it.result = fn();
Expand All @@ -723,7 +722,6 @@ int do_one_initcall(initcall_t fn)
printk("initcall %pF returned %d after %Ld usecs\n", fn,
it.result, it.duration);
trace_boot(&it, fn);
disable_boot_trace();
}

msgbuf[0] = 0;
Expand Down Expand Up @@ -884,7 +882,7 @@ static int __init kernel_init(void * unused)
* we're essentially up and running. Get rid of the
* initmem segments and start the user-mode stuff..
*/

stop_boot_trace();
init_post();
return 0;
}
2 changes: 1 addition & 1 deletion trunk/kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ static struct ctl_table kern_table[] = {
#ifdef CONFIG_TRACING
{
.ctl_name = CTL_UNNUMBERED,
.procname = "ftrace_dump_on_oops",
.procname = "ftrace_dump_on_opps",
.data = &ftrace_dump_on_oops,
.maxlen = sizeof(int),
.mode = 0644,
Expand Down
7 changes: 0 additions & 7 deletions trunk/kernel/trace/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ config NOP_TRACER
config HAVE_FUNCTION_TRACER
bool

config HAVE_FUNCTION_TRACE_MCOUNT_TEST
bool
help
This gets selected when the arch tests the function_trace_stop
variable at the mcount call site. Otherwise, this variable
is tested by the called function.

config HAVE_DYNAMIC_FTRACE
bool

Expand Down
Loading

0 comments on commit dd30dc7

Please sign in to comment.