[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51DEDEEF.6090800@gmail.com>
Date: Thu, 11 Jul 2013 10:35:59 -0600
From: David Ahern <dsahern@...il.com>
To: acme@...stprotocols.net
CC: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH 3/6] perf event: initialize allocated memory for synthesized
events
Arnaldo:
Don't see this one in your perf/core branch.
On 7/2/13 1:27 PM, David Ahern wrote:
> Fixes valgrind complaint:
>
> =3118== Syscall param write(buf) points to uninitialised byte(s)
> ==3118== at 0x4E3F5B0: __write_nocancel (in /lib64/libpthread-2.14.90.so)
> ==3118== by 0x42F0EB: process_synthesized_event (builtin-record.c:89)
> ==3118== by 0x44E81C: perf_event__synthesize_mmap_events (event.c:230)
> ==3118== by 0x44F27C: perf_event__synthesize_threads (event.c:307)
> ==3118== by 0x42FEEA: cmd_record (builtin-record.c:530)
> ==3118== by 0x419D22: run_builtin (perf.c:319)
> ==3118== by 0x4195A2: main (perf.c:376)
>
> Signed-off-by: David Ahern <dsahern@...il.com>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Namhyung Kim <namhyung@...nel.org>
> ---
> tools/perf/util/event.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
> index 5cd13d7..556b999 100644
> --- a/tools/perf/util/event.c
> +++ b/tools/perf/util/event.c
> @@ -316,11 +316,11 @@ int perf_event__synthesize_thread_map(struct perf_tool *tool,
> union perf_event *comm_event, *mmap_event;
> int err = -1, thread, j;
>
> - comm_event = malloc(sizeof(comm_event->comm) + machine->id_hdr_size);
> + comm_event = zalloc(sizeof(comm_event->comm) + machine->id_hdr_size);
> if (comm_event == NULL)
> goto out;
>
> - mmap_event = malloc(sizeof(mmap_event->mmap) + machine->id_hdr_size);
> + mmap_event = zalloc(sizeof(mmap_event->mmap) + machine->id_hdr_size);
> if (mmap_event == NULL)
> goto out_free_comm;
>
> @@ -375,11 +375,11 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
> union perf_event *comm_event, *mmap_event;
> int err = -1;
>
> - comm_event = malloc(sizeof(comm_event->comm) + machine->id_hdr_size);
> + comm_event = zalloc(sizeof(comm_event->comm) + machine->id_hdr_size);
> if (comm_event == NULL)
> goto out;
>
> - mmap_event = malloc(sizeof(mmap_event->mmap) + machine->id_hdr_size);
> + mmap_event = zalloc(sizeof(mmap_event->mmap) + machine->id_hdr_size);
> if (mmap_event == NULL)
> goto out_free_comm;
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists