]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
perf test mmap-thread-lookup: Initialize variable to suppress memory sanitizer warning
authorNumfor Mbiziwo-Tiapo <nums@google.com>
Tue, 2 Jul 2019 17:37:15 +0000 (10:37 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 9 Jul 2019 12:33:54 +0000 (09:33 -0300)
Running the 'perf test' command after building perf with a memory
sanitizer causes a warning that says:

  WARNING: MemorySanitizer: use-of-uninitialized-value... in mmap-thread-lookup.c

Initializing the go variable to 0 silences this harmless warning.

Committer warning:

This was harmless, just a simple test writing whatever was at that
sizeof(int) memory area just to signal another thread blocked reading
that file created with pipe(). Initialize it tho so that we don't get
this warning.

Signed-off-by: Numfor Mbiziwo-Tiapo <nums@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Drayton <mbd@fb.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20190702173716.181223-1-nums@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/mmap-thread-lookup.c

index ba87e6e8d18c59362f6be9abcc15e897db1ad118..0a4301a5155c63d7ac793a3361dbd667b96f563e 100644 (file)
@@ -53,7 +53,7 @@ static void *thread_fn(void *arg)
 {
        struct thread_data *td = arg;
        ssize_t ret;
-       int go;
+       int go = 0;
 
        if (thread_init(td))
                return NULL;