All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tracing: Clean up trace.h
@ 2009-09-10  1:34 Li Zefan
  2009-09-10  1:43 ` Frederic Weisbecker
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Li Zefan @ 2009-09-10  1:34 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Frederic Weisbecker, Tom Zanussi, LKML, Ingo Molnar

- remove some dead code
- remove @stats from struct tracer
- move DEFINE_COMPARISON_PRED() and DEFINE_EQUALITY_PRED()
  to kernel/trace/trace_events_filter.c

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---

I've split hw_breakpoint code out.

---
 kernel/trace/trace.h               |   86 +++++-------------------------------
 kernel/trace/trace_events_filter.c |   41 +++++++++++++++++
 2 files changed, 52 insertions(+), 75 deletions(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index ea7e0bc..76ed0db 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -125,14 +125,6 @@ struct print_entry {
 	char			buf[];
 };
 
-#define TRACE_OLD_SIZE		88
-
-struct trace_field_cont {
-	unsigned char		type;
-	/* Temporary till we get rid of this completely */
-	char			buf[TRACE_OLD_SIZE - 1];
-};
-
 struct trace_mmiotrace_rw {
 	struct trace_entry	ent;
 	struct mmiotrace_rw	rw;
@@ -182,20 +174,20 @@ enum kmemtrace_type_id {
 
 struct kmemtrace_alloc_entry {
 	struct trace_entry	ent;
-	enum kmemtrace_type_id type_id;
-	unsigned long call_site;
-	const void *ptr;
-	size_t bytes_req;
-	size_t bytes_alloc;
-	gfp_t gfp_flags;
-	int node;
+	enum kmemtrace_type_id	type_id;
+	unsigned long		call_site;
+	const void		*ptr;
+	size_t			bytes_req;
+	size_t			bytes_alloc;
+	gfp_t			gfp_flags;
+	int			node;
 };
 
 struct kmemtrace_free_entry {
 	struct trace_entry	ent;
-	enum kmemtrace_type_id type_id;
-	unsigned long call_site;
-	const void *ptr;
+	enum kmemtrace_type_id	type_id;
+	unsigned long		call_site;
+	const void		*ptr;
 };
 
 struct syscall_trace_enter {
@@ -226,7 +218,7 @@ struct ksym_trace_entry {
  * states when a trace occurs. These are:
  *  IRQS_OFF		- interrupts were disabled
  *  IRQS_NOSUPPORT	- arch does not support irqs_disabled_flags
- *  NEED_RESCED		- reschedule is requested
+ *  NEED_RESCHED	- reschedule is requested
  *  HARDIRQ		- inside an interrupt handler
  *  SOFTIRQ		- inside a softirq handler
  */
@@ -406,7 +398,6 @@ struct tracer {
 	struct tracer		*next;
 	int			print_max;
 	struct tracer_flags	*flags;
-	struct tracer_stat	*stats;
 };
 
 
@@ -525,20 +516,6 @@ static inline void __trace_stack(struct trace_array *tr, unsigned long flags,
 
 extern cycle_t ftrace_now(int cpu);
 
-#ifdef CONFIG_CONTEXT_SWITCH_TRACER
-typedef void
-(*tracer_switch_func_t)(void *private,
-			void *__rq,
-			struct task_struct *prev,
-			struct task_struct *next);
-
-struct tracer_switch_ops {
-	tracer_switch_func_t		func;
-	void				*private;
-	struct tracer_switch_ops	*next;
-};
-#endif /* CONFIG_CONTEXT_SWITCH_TRACER */
-
 extern void trace_find_cmdline(int pid, char comm[]);
 
 #ifdef CONFIG_DYNAMIC_FTRACE
@@ -841,47 +818,6 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,
 	return 0;
 }
 
-#define DEFINE_COMPARISON_PRED(type)					\
-static int filter_pred_##type(struct filter_pred *pred, void *event,	\
-			      int val1, int val2)			\
-{									\
-	type *addr = (type *)(event + pred->offset);			\
-	type val = (type)pred->val;					\
-	int match = 0;							\
-									\
-	switch (pred->op) {						\
-	case OP_LT:							\
-		match = (*addr < val);					\
-		break;							\
-	case OP_LE:							\
-		match = (*addr <= val);					\
-		break;							\
-	case OP_GT:							\
-		match = (*addr > val);					\
-		break;							\
-	case OP_GE:							\
-		match = (*addr >= val);					\
-		break;							\
-	default:							\
-		break;							\
-	}								\
-									\
-	return match;							\
-}
-
-#define DEFINE_EQUALITY_PRED(size)					\
-static int filter_pred_##size(struct filter_pred *pred, void *event,	\
-			      int val1, int val2)			\
-{									\
-	u##size *addr = (u##size *)(event + pred->offset);		\
-	u##size val = (u##size)pred->val;				\
-	int match;							\
-									\
-	match = (val == *addr) ^ pred->not;				\
-									\
-	return match;							\
-}
-
 extern struct mutex event_mutex;
 extern struct list_head ftrace_events;
 
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 93660fb..2324578 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -121,6 +121,47 @@ struct filter_parse_state {
 	} operand;
 };
 
+#define DEFINE_COMPARISON_PRED(type)					\
+static int filter_pred_##type(struct filter_pred *pred, void *event,	\
+			      int val1, int val2)			\
+{									\
+	type *addr = (type *)(event + pred->offset);			\
+	type val = (type)pred->val;					\
+	int match = 0;							\
+									\
+	switch (pred->op) {						\
+	case OP_LT:							\
+		match = (*addr < val);					\
+		break;							\
+	case OP_LE:							\
+		match = (*addr <= val);					\
+		break;							\
+	case OP_GT:							\
+		match = (*addr > val);					\
+		break;							\
+	case OP_GE:							\
+		match = (*addr >= val);					\
+		break;							\
+	default:							\
+		break;							\
+	}								\
+									\
+	return match;							\
+}
+
+#define DEFINE_EQUALITY_PRED(size)					\
+static int filter_pred_##size(struct filter_pred *pred, void *event,	\
+			      int val1, int val2)			\
+{									\
+	u##size *addr = (u##size *)(event + pred->offset);		\
+	u##size val = (u##size)pred->val;				\
+	int match;							\
+									\
+	match = (val == *addr) ^ pred->not;				\
+									\
+	return match;							\
+}
+
 DEFINE_COMPARISON_PRED(s64);
 DEFINE_COMPARISON_PRED(u64);
 DEFINE_COMPARISON_PRED(s32);
-- 
1.6.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] tracing: Clean up trace.h
  2009-09-10  1:34 [PATCH v2] tracing: Clean up trace.h Li Zefan
@ 2009-09-10  1:43 ` Frederic Weisbecker
  2009-09-10  2:17 ` Steven Rostedt
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Frederic Weisbecker @ 2009-09-10  1:43 UTC (permalink / raw)
  To: Li Zefan; +Cc: Steven Rostedt, Tom Zanussi, LKML, Ingo Molnar

On Thu, Sep 10, 2009 at 09:34:19AM +0800, Li Zefan wrote:
> - remove some dead code
> - remove @stats from struct tracer
> - move DEFINE_COMPARISON_PRED() and DEFINE_EQUALITY_PRED()
>   to kernel/trace/trace_events_filter.c
> 
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---


Nice :-)

Acked-by: Frederic Weisbecker <fweisbec@gmail.com>



> 
> I've split hw_breakpoint code out.
> 
> ---
>  kernel/trace/trace.h               |   86 +++++-------------------------------
>  kernel/trace/trace_events_filter.c |   41 +++++++++++++++++
>  2 files changed, 52 insertions(+), 75 deletions(-)
> 
> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> index ea7e0bc..76ed0db 100644
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -125,14 +125,6 @@ struct print_entry {
>  	char			buf[];
>  };
>  
> -#define TRACE_OLD_SIZE		88
> -
> -struct trace_field_cont {
> -	unsigned char		type;
> -	/* Temporary till we get rid of this completely */
> -	char			buf[TRACE_OLD_SIZE - 1];
> -};
> -
>  struct trace_mmiotrace_rw {
>  	struct trace_entry	ent;
>  	struct mmiotrace_rw	rw;
> @@ -182,20 +174,20 @@ enum kmemtrace_type_id {
>  
>  struct kmemtrace_alloc_entry {
>  	struct trace_entry	ent;
> -	enum kmemtrace_type_id type_id;
> -	unsigned long call_site;
> -	const void *ptr;
> -	size_t bytes_req;
> -	size_t bytes_alloc;
> -	gfp_t gfp_flags;
> -	int node;
> +	enum kmemtrace_type_id	type_id;
> +	unsigned long		call_site;
> +	const void		*ptr;
> +	size_t			bytes_req;
> +	size_t			bytes_alloc;
> +	gfp_t			gfp_flags;
> +	int			node;
>  };
>  
>  struct kmemtrace_free_entry {
>  	struct trace_entry	ent;
> -	enum kmemtrace_type_id type_id;
> -	unsigned long call_site;
> -	const void *ptr;
> +	enum kmemtrace_type_id	type_id;
> +	unsigned long		call_site;
> +	const void		*ptr;
>  };
>  
>  struct syscall_trace_enter {
> @@ -226,7 +218,7 @@ struct ksym_trace_entry {
>   * states when a trace occurs. These are:
>   *  IRQS_OFF		- interrupts were disabled
>   *  IRQS_NOSUPPORT	- arch does not support irqs_disabled_flags
> - *  NEED_RESCED		- reschedule is requested
> + *  NEED_RESCHED	- reschedule is requested
>   *  HARDIRQ		- inside an interrupt handler
>   *  SOFTIRQ		- inside a softirq handler
>   */
> @@ -406,7 +398,6 @@ struct tracer {
>  	struct tracer		*next;
>  	int			print_max;
>  	struct tracer_flags	*flags;
> -	struct tracer_stat	*stats;
>  };
>  
>  
> @@ -525,20 +516,6 @@ static inline void __trace_stack(struct trace_array *tr, unsigned long flags,
>  
>  extern cycle_t ftrace_now(int cpu);
>  
> -#ifdef CONFIG_CONTEXT_SWITCH_TRACER
> -typedef void
> -(*tracer_switch_func_t)(void *private,
> -			void *__rq,
> -			struct task_struct *prev,
> -			struct task_struct *next);
> -
> -struct tracer_switch_ops {
> -	tracer_switch_func_t		func;
> -	void				*private;
> -	struct tracer_switch_ops	*next;
> -};
> -#endif /* CONFIG_CONTEXT_SWITCH_TRACER */
> -
>  extern void trace_find_cmdline(int pid, char comm[]);
>  
>  #ifdef CONFIG_DYNAMIC_FTRACE
> @@ -841,47 +818,6 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,
>  	return 0;
>  }
>  
> -#define DEFINE_COMPARISON_PRED(type)					\
> -static int filter_pred_##type(struct filter_pred *pred, void *event,	\
> -			      int val1, int val2)			\
> -{									\
> -	type *addr = (type *)(event + pred->offset);			\
> -	type val = (type)pred->val;					\
> -	int match = 0;							\
> -									\
> -	switch (pred->op) {						\
> -	case OP_LT:							\
> -		match = (*addr < val);					\
> -		break;							\
> -	case OP_LE:							\
> -		match = (*addr <= val);					\
> -		break;							\
> -	case OP_GT:							\
> -		match = (*addr > val);					\
> -		break;							\
> -	case OP_GE:							\
> -		match = (*addr >= val);					\
> -		break;							\
> -	default:							\
> -		break;							\
> -	}								\
> -									\
> -	return match;							\
> -}
> -
> -#define DEFINE_EQUALITY_PRED(size)					\
> -static int filter_pred_##size(struct filter_pred *pred, void *event,	\
> -			      int val1, int val2)			\
> -{									\
> -	u##size *addr = (u##size *)(event + pred->offset);		\
> -	u##size val = (u##size)pred->val;				\
> -	int match;							\
> -									\
> -	match = (val == *addr) ^ pred->not;				\
> -									\
> -	return match;							\
> -}
> -
>  extern struct mutex event_mutex;
>  extern struct list_head ftrace_events;
>  
> diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
> index 93660fb..2324578 100644
> --- a/kernel/trace/trace_events_filter.c
> +++ b/kernel/trace/trace_events_filter.c
> @@ -121,6 +121,47 @@ struct filter_parse_state {
>  	} operand;
>  };
>  
> +#define DEFINE_COMPARISON_PRED(type)					\
> +static int filter_pred_##type(struct filter_pred *pred, void *event,	\
> +			      int val1, int val2)			\
> +{									\
> +	type *addr = (type *)(event + pred->offset);			\
> +	type val = (type)pred->val;					\
> +	int match = 0;							\
> +									\
> +	switch (pred->op) {						\
> +	case OP_LT:							\
> +		match = (*addr < val);					\
> +		break;							\
> +	case OP_LE:							\
> +		match = (*addr <= val);					\
> +		break;							\
> +	case OP_GT:							\
> +		match = (*addr > val);					\
> +		break;							\
> +	case OP_GE:							\
> +		match = (*addr >= val);					\
> +		break;							\
> +	default:							\
> +		break;							\
> +	}								\
> +									\
> +	return match;							\
> +}
> +
> +#define DEFINE_EQUALITY_PRED(size)					\
> +static int filter_pred_##size(struct filter_pred *pred, void *event,	\
> +			      int val1, int val2)			\
> +{									\
> +	u##size *addr = (u##size *)(event + pred->offset);		\
> +	u##size val = (u##size)pred->val;				\
> +	int match;							\
> +									\
> +	match = (val == *addr) ^ pred->not;				\
> +									\
> +	return match;							\
> +}
> +
>  DEFINE_COMPARISON_PRED(s64);
>  DEFINE_COMPARISON_PRED(u64);
>  DEFINE_COMPARISON_PRED(s32);
> -- 
> 1.6.3
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] tracing: Clean up trace.h
  2009-09-10  1:34 [PATCH v2] tracing: Clean up trace.h Li Zefan
  2009-09-10  1:43 ` Frederic Weisbecker
@ 2009-09-10  2:17 ` Steven Rostedt
  2009-09-10  2:25   ` Li Zefan
  2009-09-12  7:52 ` [tip:tracing/core] tracing: remove dead code tip-bot for Li Zefan
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2009-09-10  2:17 UTC (permalink / raw)
  To: Li Zefan; +Cc: Frederic Weisbecker, Tom Zanussi, LKML, Ingo Molnar

On Thu, 2009-09-10 at 09:34 +0800, Li Zefan wrote:
> - remove some dead code
> - remove @stats from struct tracer
> - move DEFINE_COMPARISON_PRED() and DEFINE_EQUALITY_PRED()
>   to kernel/trace/trace_events_filter.c
> 

Actually, Li if you don't mind, I'm going to break this up into separate
patches. Each of the above "topics" really should be a separate patch.
It makes bisecting and such nicer if for some strange reason this patch
became the cause.

-- Steve

> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
> 
> I've split hw_breakpoint code out.
> 
> ---
>  kernel/trace/trace.h               |   86 +++++-------------------------------
>  kernel/trace/trace_events_filter.c |   41 +++++++++++++++++
>  2 files changed, 52 insertions(+), 75 deletions(-)
> 
> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> index ea7e0bc..76ed0db 100644
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -125,14 +125,6 @@ struct print_entry {
>  	char			buf[];
>  };
>  
> -#define TRACE_OLD_SIZE		88
> -
> -struct trace_field_cont {
> -	unsigned char		type;
> -	/* Temporary till we get rid of this completely */
> -	char			buf[TRACE_OLD_SIZE - 1];
> -};
> -
>  struct trace_mmiotrace_rw {
>  	struct trace_entry	ent;
>  	struct mmiotrace_rw	rw;
> @@ -182,20 +174,20 @@ enum kmemtrace_type_id {
>  
>  struct kmemtrace_alloc_entry {
>  	struct trace_entry	ent;
> -	enum kmemtrace_type_id type_id;
> -	unsigned long call_site;
> -	const void *ptr;
> -	size_t bytes_req;
> -	size_t bytes_alloc;
> -	gfp_t gfp_flags;
> -	int node;
> +	enum kmemtrace_type_id	type_id;
> +	unsigned long		call_site;
> +	const void		*ptr;
> +	size_t			bytes_req;
> +	size_t			bytes_alloc;
> +	gfp_t			gfp_flags;
> +	int			node;
>  };
>  
>  struct kmemtrace_free_entry {
>  	struct trace_entry	ent;
> -	enum kmemtrace_type_id type_id;
> -	unsigned long call_site;
> -	const void *ptr;
> +	enum kmemtrace_type_id	type_id;
> +	unsigned long		call_site;
> +	const void		*ptr;
>  };
>  
>  struct syscall_trace_enter {
> @@ -226,7 +218,7 @@ struct ksym_trace_entry {
>   * states when a trace occurs. These are:
>   *  IRQS_OFF		- interrupts were disabled
>   *  IRQS_NOSUPPORT	- arch does not support irqs_disabled_flags
> - *  NEED_RESCED		- reschedule is requested
> + *  NEED_RESCHED	- reschedule is requested
>   *  HARDIRQ		- inside an interrupt handler
>   *  SOFTIRQ		- inside a softirq handler
>   */
> @@ -406,7 +398,6 @@ struct tracer {
>  	struct tracer		*next;
>  	int			print_max;
>  	struct tracer_flags	*flags;
> -	struct tracer_stat	*stats;
>  };
>  
> 
> @@ -525,20 +516,6 @@ static inline void __trace_stack(struct trace_array *tr, unsigned long flags,
>  
>  extern cycle_t ftrace_now(int cpu);
>  
> -#ifdef CONFIG_CONTEXT_SWITCH_TRACER
> -typedef void
> -(*tracer_switch_func_t)(void *private,
> -			void *__rq,
> -			struct task_struct *prev,
> -			struct task_struct *next);
> -
> -struct tracer_switch_ops {
> -	tracer_switch_func_t		func;
> -	void				*private;
> -	struct tracer_switch_ops	*next;
> -};
> -#endif /* CONFIG_CONTEXT_SWITCH_TRACER */
> -
>  extern void trace_find_cmdline(int pid, char comm[]);
>  
>  #ifdef CONFIG_DYNAMIC_FTRACE
> @@ -841,47 +818,6 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,
>  	return 0;
>  }
>  
> -#define DEFINE_COMPARISON_PRED(type)					\
> -static int filter_pred_##type(struct filter_pred *pred, void *event,	\
> -			      int val1, int val2)			\
> -{									\
> -	type *addr = (type *)(event + pred->offset);			\
> -	type val = (type)pred->val;					\
> -	int match = 0;							\
> -									\
> -	switch (pred->op) {						\
> -	case OP_LT:							\
> -		match = (*addr < val);					\
> -		break;							\
> -	case OP_LE:							\
> -		match = (*addr <= val);					\
> -		break;							\
> -	case OP_GT:							\
> -		match = (*addr > val);					\
> -		break;							\
> -	case OP_GE:							\
> -		match = (*addr >= val);					\
> -		break;							\
> -	default:							\
> -		break;							\
> -	}								\
> -									\
> -	return match;							\
> -}
> -
> -#define DEFINE_EQUALITY_PRED(size)					\
> -static int filter_pred_##size(struct filter_pred *pred, void *event,	\
> -			      int val1, int val2)			\
> -{									\
> -	u##size *addr = (u##size *)(event + pred->offset);		\
> -	u##size val = (u##size)pred->val;				\
> -	int match;							\
> -									\
> -	match = (val == *addr) ^ pred->not;				\
> -									\
> -	return match;							\
> -}
> -
>  extern struct mutex event_mutex;
>  extern struct list_head ftrace_events;
>  
> diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
> index 93660fb..2324578 100644
> --- a/kernel/trace/trace_events_filter.c
> +++ b/kernel/trace/trace_events_filter.c
> @@ -121,6 +121,47 @@ struct filter_parse_state {
>  	} operand;
>  };
>  
> +#define DEFINE_COMPARISON_PRED(type)					\
> +static int filter_pred_##type(struct filter_pred *pred, void *event,	\
> +			      int val1, int val2)			\
> +{									\
> +	type *addr = (type *)(event + pred->offset);			\
> +	type val = (type)pred->val;					\
> +	int match = 0;							\
> +									\
> +	switch (pred->op) {						\
> +	case OP_LT:							\
> +		match = (*addr < val);					\
> +		break;							\
> +	case OP_LE:							\
> +		match = (*addr <= val);					\
> +		break;							\
> +	case OP_GT:							\
> +		match = (*addr > val);					\
> +		break;							\
> +	case OP_GE:							\
> +		match = (*addr >= val);					\
> +		break;							\
> +	default:							\
> +		break;							\
> +	}								\
> +									\
> +	return match;							\
> +}
> +
> +#define DEFINE_EQUALITY_PRED(size)					\
> +static int filter_pred_##size(struct filter_pred *pred, void *event,	\
> +			      int val1, int val2)			\
> +{									\
> +	u##size *addr = (u##size *)(event + pred->offset);		\
> +	u##size val = (u##size)pred->val;				\
> +	int match;							\
> +									\
> +	match = (val == *addr) ^ pred->not;				\
> +									\
> +	return match;							\
> +}
> +
>  DEFINE_COMPARISON_PRED(s64);
>  DEFINE_COMPARISON_PRED(u64);
>  DEFINE_COMPARISON_PRED(s32);


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] tracing: Clean up trace.h
  2009-09-10  2:17 ` Steven Rostedt
@ 2009-09-10  2:25   ` Li Zefan
  2009-09-10 13:34     ` Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Li Zefan @ 2009-09-10  2:25 UTC (permalink / raw)
  To: rostedt; +Cc: Frederic Weisbecker, Tom Zanussi, LKML, Ingo Molnar

于 2009年09月10日 10:17, Steven Rostedt 写道:
> On Thu, 2009-09-10 at 09:34 +0800, Li Zefan wrote:
>> - remove some dead code
>> - remove @stats from struct tracer
>> - move DEFINE_COMPARISON_PRED() and DEFINE_EQUALITY_PRED()
>>   to kernel/trace/trace_events_filter.c
>>
> 
> Actually, Li if you don't mind, I'm going to break this up into separate
> patches. Each of the above "topics" really should be a separate patch.
> It makes bisecting and such nicer if for some strange reason this patch
> became the cause.
> 

Actually it does more than I described:

- indent some lines
- fix a typo in comment
- remove trace_field_cont
- remove tracer_switch_ops
- remove @stats from struct tracer
- move 2 macros to trace_events_filter.c

I'm not sure it worths breaking into several patches, since each of them
is trivial.

But I won't mind if you break this up, or if you want me to do
this.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] tracing: Clean up trace.h
  2009-09-10  2:25   ` Li Zefan
@ 2009-09-10 13:34     ` Steven Rostedt
  0 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2009-09-10 13:34 UTC (permalink / raw)
  To: Li Zefan; +Cc: Frederic Weisbecker, Tom Zanussi, LKML, Ingo Molnar

On Thu, 2009-09-10 at 10:25 +0800, Li Zefan wrote:
> 于 2009年09月10日 10:17, Steven Rostedt 写道:
> > On Thu, 2009-09-10 at 09:34 +0800, Li Zefan wrote:
> >> - remove some dead code
> >> - remove @stats from struct tracer
> >> - move DEFINE_COMPARISON_PRED() and DEFINE_EQUALITY_PRED()
> >>   to kernel/trace/trace_events_filter.c
> >>
> > 
> > Actually, Li if you don't mind, I'm going to break this up into separate
> > patches. Each of the above "topics" really should be a separate patch.
> > It makes bisecting and such nicer if for some strange reason this patch
> > became the cause.
> > 
> 
> Actually it does more than I described:
> 
> - indent some lines
> - fix a typo in comment
> - remove trace_field_cont
> - remove tracer_switch_ops
> - remove @stats from struct tracer
> - move 2 macros to trace_events_filter.c
> 
> I'm not sure it worths breaking into several patches, since each of them
> is trivial.
> 
> But I won't mind if you break this up, or if you want me to do
> this.

Yeah I already broke it up and sent it out. Some could go together, but
I did not like moving code mixed with other cleanups.

Thanks,

-- Steve



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:tracing/core] tracing: remove dead code
  2009-09-10  1:34 [PATCH v2] tracing: Clean up trace.h Li Zefan
  2009-09-10  1:43 ` Frederic Weisbecker
  2009-09-10  2:17 ` Steven Rostedt
@ 2009-09-12  7:52 ` tip-bot for Li Zefan
  2009-09-12  7:52 ` [tip:tracing/core] tracing: format clean ups tip-bot for Li Zefan
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Li Zefan @ 2009-09-12  7:52 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, lizf, tglx

Commit-ID:  e0ab5f2daee1c7a6a387591bf37f0bad4e407112
Gitweb:     http://git.kernel.org/tip/e0ab5f2daee1c7a6a387591bf37f0bad4e407112
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Thu, 10 Sep 2009 09:34:19 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Wed, 9 Sep 2009 23:54:06 -0400

tracing: remove dead code

Removes unreachable code.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4AA8579B.4020706@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


---
 kernel/trace/trace.h |   22 ----------------------
 1 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index fa1dccb..536ae1d 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -120,14 +120,6 @@ struct print_entry {
 	char			buf[];
 };
 
-#define TRACE_OLD_SIZE		88
-
-struct trace_field_cont {
-	unsigned char		type;
-	/* Temporary till we get rid of this completely */
-	char			buf[TRACE_OLD_SIZE - 1];
-};
-
 struct trace_mmiotrace_rw {
 	struct trace_entry	ent;
 	struct mmiotrace_rw	rw;
@@ -509,20 +501,6 @@ static inline void __trace_stack(struct trace_array *tr, unsigned long flags,
 
 extern cycle_t ftrace_now(int cpu);
 
-#ifdef CONFIG_CONTEXT_SWITCH_TRACER
-typedef void
-(*tracer_switch_func_t)(void *private,
-			void *__rq,
-			struct task_struct *prev,
-			struct task_struct *next);
-
-struct tracer_switch_ops {
-	tracer_switch_func_t		func;
-	void				*private;
-	struct tracer_switch_ops	*next;
-};
-#endif /* CONFIG_CONTEXT_SWITCH_TRACER */
-
 extern void trace_find_cmdline(int pid, char comm[]);
 
 #ifdef CONFIG_DYNAMIC_FTRACE

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [tip:tracing/core] tracing: format clean ups
  2009-09-10  1:34 [PATCH v2] tracing: Clean up trace.h Li Zefan
                   ` (2 preceding siblings ...)
  2009-09-12  7:52 ` [tip:tracing/core] tracing: remove dead code tip-bot for Li Zefan
@ 2009-09-12  7:52 ` tip-bot for Li Zefan
  2009-09-12  7:53 ` [tip:tracing/core] tracing: remove stats from struct tracer tip-bot for Li Zefan
  2009-09-12  7:53 ` [tip:tracing/core] tracing: move PRED macros to trace_events_filter.c tip-bot for Li Zefan
  5 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Li Zefan @ 2009-09-12  7:52 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, lizf, tglx

Commit-ID:  bd9cfca9cb71200dd82b320bba12540dc078f4e0
Gitweb:     http://git.kernel.org/tip/bd9cfca9cb71200dd82b320bba12540dc078f4e0
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Thu, 10 Sep 2009 09:34:19 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Wed, 9 Sep 2009 23:54:07 -0400

tracing: format clean ups

Fix white-space formatting.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4AA8579B.4020706@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


---
 kernel/trace/trace.h |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 536ae1d..86a0523 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -169,20 +169,20 @@ enum kmemtrace_type_id {
 
 struct kmemtrace_alloc_entry {
 	struct trace_entry	ent;
-	enum kmemtrace_type_id type_id;
-	unsigned long call_site;
-	const void *ptr;
-	size_t bytes_req;
-	size_t bytes_alloc;
-	gfp_t gfp_flags;
-	int node;
+	enum kmemtrace_type_id	type_id;
+	unsigned long		call_site;
+	const void		*ptr;
+	size_t			bytes_req;
+	size_t			bytes_alloc;
+	gfp_t			gfp_flags;
+	int			node;
 };
 
 struct kmemtrace_free_entry {
 	struct trace_entry	ent;
-	enum kmemtrace_type_id type_id;
-	unsigned long call_site;
-	const void *ptr;
+	enum kmemtrace_type_id	type_id;
+	unsigned long		call_site;
+	const void		*ptr;
 };
 
 struct syscall_trace_enter {
@@ -203,7 +203,7 @@ struct syscall_trace_exit {
  * states when a trace occurs. These are:
  *  IRQS_OFF		- interrupts were disabled
  *  IRQS_NOSUPPORT	- arch does not support irqs_disabled_flags
- *  NEED_RESCED		- reschedule is requested
+ *  NEED_RESCHED	- reschedule is requested
  *  HARDIRQ		- inside an interrupt handler
  *  SOFTIRQ		- inside a softirq handler
  */

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [tip:tracing/core] tracing: remove stats from struct tracer
  2009-09-10  1:34 [PATCH v2] tracing: Clean up trace.h Li Zefan
                   ` (3 preceding siblings ...)
  2009-09-12  7:52 ` [tip:tracing/core] tracing: format clean ups tip-bot for Li Zefan
@ 2009-09-12  7:53 ` tip-bot for Li Zefan
  2009-09-12  7:53 ` [tip:tracing/core] tracing: move PRED macros to trace_events_filter.c tip-bot for Li Zefan
  5 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Li Zefan @ 2009-09-12  7:53 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, lizf, tglx

Commit-ID:  a5921c6c37d51ee2079ca3c69ea6f7b7384f5d87
Gitweb:     http://git.kernel.org/tip/a5921c6c37d51ee2079ca3c69ea6f7b7384f5d87
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Thu, 10 Sep 2009 09:34:19 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Wed, 9 Sep 2009 23:54:09 -0400

tracing: remove stats from struct tracer

Remove unused field @stats from struct tracer.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4AA8579B.4020706@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


---
 kernel/trace/trace.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 86a0523..2163d18 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -382,7 +382,6 @@ struct tracer {
 	struct tracer		*next;
 	int			print_max;
 	struct tracer_flags	*flags;
-	struct tracer_stat	*stats;
 };
 
 

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [tip:tracing/core] tracing: move PRED macros to trace_events_filter.c
  2009-09-10  1:34 [PATCH v2] tracing: Clean up trace.h Li Zefan
                   ` (4 preceding siblings ...)
  2009-09-12  7:53 ` [tip:tracing/core] tracing: remove stats from struct tracer tip-bot for Li Zefan
@ 2009-09-12  7:53 ` tip-bot for Li Zefan
  5 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Li Zefan @ 2009-09-12  7:53 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, lizf, tglx

Commit-ID:  197e2eabc90c203d1086916b7f66694ba5fbb937
Gitweb:     http://git.kernel.org/tip/197e2eabc90c203d1086916b7f66694ba5fbb937
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Thu, 10 Sep 2009 09:34:19 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Wed, 9 Sep 2009 23:54:11 -0400

tracing: move PRED macros to trace_events_filter.c

Move DEFINE_COMPARISON_PRED() and DEFINE_EQUALITY_PRED()
  to kernel/trace/trace_events_filter.c

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4AA8579B.4020706@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


---
 kernel/trace/trace.h               |   41 ------------------------------------
 kernel/trace/trace_events_filter.c |   41 ++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 2163d18..acaa680 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -800,47 +800,6 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,
 	return 0;
 }
 
-#define DEFINE_COMPARISON_PRED(type)					\
-static int filter_pred_##type(struct filter_pred *pred, void *event,	\
-			      int val1, int val2)			\
-{									\
-	type *addr = (type *)(event + pred->offset);			\
-	type val = (type)pred->val;					\
-	int match = 0;							\
-									\
-	switch (pred->op) {						\
-	case OP_LT:							\
-		match = (*addr < val);					\
-		break;							\
-	case OP_LE:							\
-		match = (*addr <= val);					\
-		break;							\
-	case OP_GT:							\
-		match = (*addr > val);					\
-		break;							\
-	case OP_GE:							\
-		match = (*addr >= val);					\
-		break;							\
-	default:							\
-		break;							\
-	}								\
-									\
-	return match;							\
-}
-
-#define DEFINE_EQUALITY_PRED(size)					\
-static int filter_pred_##size(struct filter_pred *pred, void *event,	\
-			      int val1, int val2)			\
-{									\
-	u##size *addr = (u##size *)(event + pred->offset);		\
-	u##size val = (u##size)pred->val;				\
-	int match;							\
-									\
-	match = (val == *addr) ^ pred->not;				\
-									\
-	return match;							\
-}
-
 extern struct mutex event_mutex;
 extern struct list_head ftrace_events;
 
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 93660fb..2324578 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -121,6 +121,47 @@ struct filter_parse_state {
 	} operand;
 };
 
+#define DEFINE_COMPARISON_PRED(type)					\
+static int filter_pred_##type(struct filter_pred *pred, void *event,	\
+			      int val1, int val2)			\
+{									\
+	type *addr = (type *)(event + pred->offset);			\
+	type val = (type)pred->val;					\
+	int match = 0;							\
+									\
+	switch (pred->op) {						\
+	case OP_LT:							\
+		match = (*addr < val);					\
+		break;							\
+	case OP_LE:							\
+		match = (*addr <= val);					\
+		break;							\
+	case OP_GT:							\
+		match = (*addr > val);					\
+		break;							\
+	case OP_GE:							\
+		match = (*addr >= val);					\
+		break;							\
+	default:							\
+		break;							\
+	}								\
+									\
+	return match;							\
+}
+
+#define DEFINE_EQUALITY_PRED(size)					\
+static int filter_pred_##size(struct filter_pred *pred, void *event,	\
+			      int val1, int val2)			\
+{									\
+	u##size *addr = (u##size *)(event + pred->offset);		\
+	u##size val = (u##size)pred->val;				\
+	int match;							\
+									\
+	match = (val == *addr) ^ pred->not;				\
+									\
+	return match;							\
+}
+
 DEFINE_COMPARISON_PRED(s64);
 DEFINE_COMPARISON_PRED(u64);
 DEFINE_COMPARISON_PRED(s32);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-09-12  7:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-10  1:34 [PATCH v2] tracing: Clean up trace.h Li Zefan
2009-09-10  1:43 ` Frederic Weisbecker
2009-09-10  2:17 ` Steven Rostedt
2009-09-10  2:25   ` Li Zefan
2009-09-10 13:34     ` Steven Rostedt
2009-09-12  7:52 ` [tip:tracing/core] tracing: remove dead code tip-bot for Li Zefan
2009-09-12  7:52 ` [tip:tracing/core] tracing: format clean ups tip-bot for Li Zefan
2009-09-12  7:53 ` [tip:tracing/core] tracing: remove stats from struct tracer tip-bot for Li Zefan
2009-09-12  7:53 ` [tip:tracing/core] tracing: move PRED macros to trace_events_filter.c tip-bot for Li Zefan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.