All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] perf bench: Fix 2 memory sanitizer warnings
Date: Sat, 12 Sep 2020 22:51:24 +0200	[thread overview]
Message-ID: <20200912205124.GF1714160@krava> (raw)
In-Reply-To: <20200912053725.1405857-1-irogers@google.com>

On Fri, Sep 11, 2020 at 10:37:25PM -0700, Ian Rogers wrote:
> Memory sanitizer warns if a write is performed where the memory
> being read for the write is uninitialized. Avoid this warning by
> initializing the memory.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> ---
>  tools/perf/bench/sched-messaging.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
> index 71d830d7b923..cecce93ccc63 100644
> --- a/tools/perf/bench/sched-messaging.c
> +++ b/tools/perf/bench/sched-messaging.c
> @@ -66,11 +66,10 @@ static void fdpair(int fds[2])
>  /* Block until we're ready to go */
>  static void ready(int ready_out, int wakefd)
>  {
> -	char dummy;
>  	struct pollfd pollfd = { .fd = wakefd, .events = POLLIN };
>  
>  	/* Tell them we're ready. */
> -	if (write(ready_out, &dummy, 1) != 1)
> +	if (write(ready_out, "R", 1) != 1)
>  		err(EXIT_FAILURE, "CLIENT: ready write");
>  
>  	/* Wait for "GO" signal */
> @@ -85,6 +84,7 @@ static void *sender(struct sender_context *ctx)
>  	unsigned int i, j;
>  
>  	ready(ctx->ready_out, ctx->wakefd);
> +	memset(data, 'S', sizeof(data));
>  
>  	/* Now pump to every receiver. */
>  	for (i = 0; i < nr_loops; i++) {
> -- 
> 2.28.0.618.gf4bc123cb7-goog
> 


  reply	other threads:[~2020-09-12 20:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12  5:37 [PATCH] perf bench: Fix 2 memory sanitizer warnings Ian Rogers
2020-09-12 20:51 ` Jiri Olsa [this message]
2020-09-14 21:30   ` Arnaldo Carvalho de Melo

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=20200912205124.GF1714160@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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 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.