From: Frederic Weisbecker <fweisbec@gmail.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Tom Zanussi <tzanussi@gmail.com>,
LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH v2] tracing: Clean up trace.h
Date: Thu, 10 Sep 2009 03:43:36 +0200 [thread overview]
Message-ID: <20090910014334.GA8450@nowhere> (raw)
In-Reply-To: <4AA8579B.4020706@cn.fujitsu.com>
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
>
next prev parent reply other threads:[~2009-09-10 1:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-10 1:34 [PATCH v2] tracing: Clean up trace.h Li Zefan
2009-09-10 1:43 ` Frederic Weisbecker [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090910014334.GA8450@nowhere \
--to=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=tzanussi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox