aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-04-10 09:36:00 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-04-14 12:57:28 -0400
commita8d154b009168337494fbf345671bab74d3e4b8b (patch)
tree4097612e1a5cc8bf7658542f7d0f51b815113eaf /kernel/lockdep.c
parentea20d9293ce423a39717ed4375393129a2e701f9 (diff)
tracing: create automated trace defines
This patch lowers the number of places a developer must modify to add new tracepoints. The current method to add a new tracepoint into an existing system is to write the trace point macro in the trace header with one of the macros TRACE_EVENT, TRACE_FORMAT or DECLARE_TRACE, then they must add the same named item into the C file with the macro DEFINE_TRACE(name) and then add the trace point. This change cuts out the needing to add the DEFINE_TRACE(name). Every file that uses the tracepoint must still include the trace/<type>.h file, but the one C file must also add a define before the including of that file. #define CREATE_TRACE_POINTS #include <trace/mytrace.h> This will cause the trace/mytrace.h file to also produce the C code necessary to implement the trace point. Note, if more than one trace/<type>.h is used to create the C code it is best to list them all together. #define CREATE_TRACE_POINTS #include <trace/foo.h> #include <trace/bar.h> #include <trace/fido.h> Thanks to Mathieu Desnoyers and Christoph Hellwig for coming up with the cleaner solution of the define above the includes over my first design to have the C code include a "special" header. This patch converts sched, irq and lockdep and skb to use this new method. Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Neil Horman <nhorman@tuxdriver.com> Cc: Zhao Lei <zhaolei@cn.fujitsu.com> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index c4582a6ea953..257f21a76c52 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -42,12 +42,14 @@
42#include <linux/hash.h> 42#include <linux/hash.h>
43#include <linux/ftrace.h> 43#include <linux/ftrace.h>
44#include <linux/stringify.h> 44#include <linux/stringify.h>
45#include <trace/lockdep.h>
46 45
47#include <asm/sections.h> 46#include <asm/sections.h>
48 47
49#include "lockdep_internals.h" 48#include "lockdep_internals.h"
50 49
50#define CREATE_TRACE_POINTS
51#include <trace/lockdep.h>
52
51#ifdef CONFIG_PROVE_LOCKING 53#ifdef CONFIG_PROVE_LOCKING
52int prove_locking = 1; 54int prove_locking = 1;
53module_param(prove_locking, int, 0644); 55module_param(prove_locking, int, 0644);
@@ -2929,8 +2931,6 @@ void lock_set_class(struct lockdep_map *lock, const char *name,
2929} 2931}
2930EXPORT_SYMBOL_GPL(lock_set_class); 2932EXPORT_SYMBOL_GPL(lock_set_class);
2931 2933
2932DEFINE_TRACE(lock_acquire);
2933
2934/* 2934/*
2935 * We are not always called with irqs disabled - do that here, 2935 * We are not always called with irqs disabled - do that here,
2936 * and also avoid lockdep recursion: 2936 * and also avoid lockdep recursion:
@@ -2957,8 +2957,6 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
2957} 2957}
2958EXPORT_SYMBOL_GPL(lock_acquire); 2958EXPORT_SYMBOL_GPL(lock_acquire);
2959 2959
2960DEFINE_TRACE(lock_release);
2961
2962void lock_release(struct lockdep_map *lock, int nested, 2960void lock_release(struct lockdep_map *lock, int nested,
2963 unsigned long ip) 2961 unsigned long ip)
2964{ 2962{
@@ -3061,8 +3059,6 @@ found_it:
3061 put_lock_stats(stats); 3059 put_lock_stats(stats);
3062} 3060}
3063 3061
3064DEFINE_TRACE(lock_acquired);
3065
3066static void 3062static void
3067__lock_acquired(struct lockdep_map *lock, unsigned long ip) 3063__lock_acquired(struct lockdep_map *lock, unsigned long ip)
3068{ 3064{
@@ -3118,8 +3114,6 @@ found_it:
3118 lock->ip = ip; 3114 lock->ip = ip;
3119} 3115}
3120 3116
3121DEFINE_TRACE(lock_contended);
3122
3123void lock_contended(struct lockdep_map *lock, unsigned long ip) 3117void lock_contended(struct lockdep_map *lock, unsigned long ip)
3124{ 3118{
3125 unsigned long flags; 3119 unsigned long flags;