* [PATCH] Don't spam trace report about missing fields
@ 2010-11-29 16:20 Avi Kivity
2010-11-29 16:26 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2010-11-29 16:20 UTC (permalink / raw)
To: Steven Rostedt; +Cc: kvm, linux-kernel, linux-trace-users
Instead of spamming the output with complaints about missing fields, simply
return an error to the caller, which can print something out or do something
more intelligent about them.
Fixes kvm plugin tracing older kernels.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
parse-events.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/parse-events.c b/parse-events.c
index f0b0324..7a4c3a6 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -4446,17 +4446,11 @@ int get_field_val(struct trace_seq *s, struct format_field *field,
const char *name, struct record *record,
unsigned long long *val, int err)
{
- if (!field) {
- if (err)
- trace_seq_printf(s, "<CANT FIND FIELD %s>", name);
+ if (!field)
return -1;
- }
- if (pevent_read_number_field(field, record->data, val)) {
- if (err)
- trace_seq_printf(s, " %s=INVALID", name);
+ if (pevent_read_number_field(field, record->data, val))
return -1;
- }
return 0;
}
@@ -4489,11 +4483,8 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,
field = pevent_find_field(event, name);
- if (!field) {
- if (err)
- trace_seq_printf(s, "<CANT FIND FIELD %s>", name);
+ if (!field)
return NULL;
- }
/* Allow @len to be NULL */
if (!len)
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Don't spam trace report about missing fields
2010-11-29 16:20 [PATCH] Don't spam trace report about missing fields Avi Kivity
@ 2010-11-29 16:26 ` Steven Rostedt
2010-11-29 17:22 ` Avi Kivity
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2010-11-29 16:26 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm, linux-kernel, linux-trace-users
On Mon, 2010-11-29 at 18:20 +0200, Avi Kivity wrote:
> Instead of spamming the output with complaints about missing fields, simply
> return an error to the caller, which can print something out or do something
> more intelligent about them.
>
> Fixes kvm plugin tracing older kernels.
Hmm, what about just passing in err=0?
-- Steve
>
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
> parse-events.c | 15 +++------------
> 1 files changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/parse-events.c b/parse-events.c
> index f0b0324..7a4c3a6 100644
> --- a/parse-events.c
> +++ b/parse-events.c
> @@ -4446,17 +4446,11 @@ int get_field_val(struct trace_seq *s, struct format_field *field,
> const char *name, struct record *record,
> unsigned long long *val, int err)
> {
> - if (!field) {
> - if (err)
> - trace_seq_printf(s, "<CANT FIND FIELD %s>", name);
> + if (!field)
> return -1;
> - }
>
> - if (pevent_read_number_field(field, record->data, val)) {
> - if (err)
> - trace_seq_printf(s, " %s=INVALID", name);
> + if (pevent_read_number_field(field, record->data, val))
> return -1;
> - }
>
> return 0;
> }
> @@ -4489,11 +4483,8 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,
>
> field = pevent_find_field(event, name);
>
> - if (!field) {
> - if (err)
> - trace_seq_printf(s, "<CANT FIND FIELD %s>", name);
> + if (!field)
> return NULL;
> - }
>
> /* Allow @len to be NULL */
> if (!len)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Don't spam trace report about missing fields
2010-11-29 16:26 ` Steven Rostedt
@ 2010-11-29 17:22 ` Avi Kivity
0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2010-11-29 17:22 UTC (permalink / raw)
To: Steven Rostedt; +Cc: kvm, linux-kernel, linux-trace-users
On 11/29/2010 06:26 PM, Steven Rostedt wrote:
> On Mon, 2010-11-29 at 18:20 +0200, Avi Kivity wrote:
> > Instead of spamming the output with complaints about missing fields, simply
> > return an error to the caller, which can print something out or do something
> > more intelligent about them.
> >
> > Fixes kvm plugin tracing older kernels.
>
> Hmm, what about just passing in err=0?
I was just patching the printk out it mindlessly. Will send a new patch.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-29 17:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-29 16:20 [PATCH] Don't spam trace report about missing fields Avi Kivity
2010-11-29 16:26 ` Steven Rostedt
2010-11-29 17:22 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).