linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Zanussi <zanussi@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: kernel test robot <rong.a.chen@intel.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	lkp@lists.01.org
Subject: Re: [PATCH] tracing: Remove bogus 64-bit synth_event_trace() vararg assumption
Date: Wed, 12 Feb 2020 14:10:25 -0600	[thread overview]
Message-ID: <1581538225.25773.3.camel@kernel.org> (raw)
In-Reply-To: <20200212145026.0cbaa86b@gandalf.local.home>

Hi Steve,

On Wed, 2020-02-12 at 14:50 -0500, Steven Rostedt wrote:
> From: Tom Zanussi <zanussi@kernel.org>
> 
> [ Tom, please send patches normally, and not embedded in a reply.
> Otherwise it will not be picked up by my patchwork, and may be lost.
> ]

Sorry about that.  I just finished getting my 32-bit test system up and
running and this does fix the problem, although I do have an updated
patch that also fixes some compile warnings on 32-bit compiles that I
saw in the test module.

I'll post that as a separate patch, of course.

Tom


> 
> The vararg code in synth_event_trace() assumed the args were 64 bit
> which is not the case on 32 bit systems.  Just use long which should
> work on every system, and remove the u64 casts from the synth event
> test module.
> 
> Reported-by: kernel test robot <rong.a.chen@intel.com>
> Signed-off-by: Tom Zanussi <zanussi@kernel.org>
> ---
>  kernel/trace/synth_event_gen_test.c | 4 ++--
>  kernel/trace/trace_events_hist.c    | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/trace/synth_event_gen_test.c
> b/kernel/trace/synth_event_gen_test.c
> index 4aefe003cb7c..2a7465569a43 100644
> --- a/kernel/trace/synth_event_gen_test.c
> +++ b/kernel/trace/synth_event_gen_test.c
> @@ -424,11 +424,11 @@ static int __init test_trace_synth_event(void)
>  	/* Trace some bogus values just for testing */
>  	ret = synth_event_trace(create_synth_test, 7,	/*
> number of values */
>  				444,			/*
> next_pid_field */
> -				(u64)"clackers",	/*
> next_comm_field */
> +				"clackers",		/*
> next_comm_field */
>  				1000000,		/* ts_ns */
>  				1000,			/*
> ts_ms */
>  				smp_processor_id(),	/* cpu */
> -				(u64)"Thneed",		/*
> my_string_field */
> +				"Thneed",		/*
> my_string_field */
>  				999);			/*
> my_int_field */
>  	return ret;
>  }
> diff --git a/kernel/trace/trace_events_hist.c
> b/kernel/trace/trace_events_hist.c
> index 2fcb755e900a..e65276c3c9d1 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -1883,12 +1883,12 @@ int synth_event_trace(struct trace_event_file
> *file, unsigned int n_vals, ...)
>  
>  	va_start(args, n_vals);
>  	for (i = 0, n_u64 = 0; i < state.event->n_fields; i++) {
> -		u64 val;
> +		long val;
>  
> -		val = va_arg(args, u64);
> +		val = va_arg(args, long);
>  
>  		if (state.event->fields[i]->is_string) {
> -			char *str_val = (char *)(long)val;
> +			char *str_val = (char *)val;
>  			char *str_field = (char *)&state.entry-
> >fields[n_u64];
>  
>  			strscpy(str_field, str_val,
> STR_VAR_LEN_MAX);

      reply	other threads:[~2020-02-12 20:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 11:34 [tracing] 9fe41efaca: BUG:unable_to_handle_page_fault_for_address kernel test robot
2020-02-12 15:59 ` Tom Zanussi
2020-02-12 19:50   ` [PATCH] tracing: Remove bogus 64-bit synth_event_trace() vararg assumption Steven Rostedt
2020-02-12 20:10     ` Tom Zanussi [this message]

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=1581538225.25773.3.camel@kernel.org \
    --to=zanussi@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@lists.01.org \
    --cc=mhiramat@kernel.org \
    --cc=rong.a.chen@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).