From: jolsa@redhat.com (Jiri Olsa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] perf tests: Add dwarf unwind test on ARM
Date: Wed, 7 May 2014 14:06:03 +0200 [thread overview]
Message-ID: <20140507120603.GC2019@krava.brq.redhat.com> (raw)
In-Reply-To: <1399389979-11279-3-git-send-email-jean.pihet@linaro.org>
On Tue, May 06, 2014 at 05:26:18PM +0200, Jean Pihet wrote:
SNIP
> diff --git a/tools/perf/arch/arm/tests/dwarf-unwind.c b/tools/perf/arch/arm/tests/dwarf-unwind.c
> new file mode 100644
> index 0000000..d618f5f
> --- /dev/null
> +++ b/tools/perf/arch/arm/tests/dwarf-unwind.c
> @@ -0,0 +1,59 @@
> +#include <string.h>
> +#include "perf_regs.h"
> +#include "thread.h"
> +#include "map.h"
> +#include "event.h"
> +#include "tests/tests.h"
> +
> +#define STACK_SIZE 8192
> +
> +static int sample_ustack(struct perf_sample *sample,
> + struct thread *thread, u64 *regs)
> +{
> + struct stack_dump *stack = &sample->user_stack;
> + struct map *map;
> + unsigned long sp;
> + u64 stack_size, *buf;
> +
> + buf = malloc(STACK_SIZE);
> + if (!buf) {
> + pr_debug("failed to allocate sample uregs data\n");
> + return -1;
> + }
> +
> + sp = (unsigned long) regs[PERF_REG_ARM_SP];
> +
> + map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp);
> + if (!map) {
> + pr_debug("failed to get stack map\n");
> + return -1;
> + }
there's a memory leak of 'buf' already fixed fox x86:
perf tests x86: Fix memory leak in sample_ustack()
commit 763d7f5f2718f085bab5a9e63308349728f3ad12
Author: Masanari Iida <standby24x7@gmail.com>
Date: Sun Apr 20 00:16:41 2014 +0900
jirka
WARNING: multiple messages have this Message-ID (diff)
From: Jiri Olsa <jolsa@redhat.com>
To: Jean Pihet <jean.pihet@linaro.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>,
will.deacon@arm.com,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH 2/3] perf tests: Add dwarf unwind test on ARM
Date: Wed, 7 May 2014 14:06:03 +0200 [thread overview]
Message-ID: <20140507120603.GC2019@krava.brq.redhat.com> (raw)
In-Reply-To: <1399389979-11279-3-git-send-email-jean.pihet@linaro.org>
On Tue, May 06, 2014 at 05:26:18PM +0200, Jean Pihet wrote:
SNIP
> diff --git a/tools/perf/arch/arm/tests/dwarf-unwind.c b/tools/perf/arch/arm/tests/dwarf-unwind.c
> new file mode 100644
> index 0000000..d618f5f
> --- /dev/null
> +++ b/tools/perf/arch/arm/tests/dwarf-unwind.c
> @@ -0,0 +1,59 @@
> +#include <string.h>
> +#include "perf_regs.h"
> +#include "thread.h"
> +#include "map.h"
> +#include "event.h"
> +#include "tests/tests.h"
> +
> +#define STACK_SIZE 8192
> +
> +static int sample_ustack(struct perf_sample *sample,
> + struct thread *thread, u64 *regs)
> +{
> + struct stack_dump *stack = &sample->user_stack;
> + struct map *map;
> + unsigned long sp;
> + u64 stack_size, *buf;
> +
> + buf = malloc(STACK_SIZE);
> + if (!buf) {
> + pr_debug("failed to allocate sample uregs data\n");
> + return -1;
> + }
> +
> + sp = (unsigned long) regs[PERF_REG_ARM_SP];
> +
> + map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp);
> + if (!map) {
> + pr_debug("failed to get stack map\n");
> + return -1;
> + }
there's a memory leak of 'buf' already fixed fox x86:
perf tests x86: Fix memory leak in sample_ustack()
commit 763d7f5f2718f085bab5a9e63308349728f3ad12
Author: Masanari Iida <standby24x7@gmail.com>
Date: Sun Apr 20 00:16:41 2014 +0900
jirka
next prev parent reply other threads:[~2014-05-07 12:06 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 15:26 [PATCH 0/3] perf tools: Add libdw DWARF post unwind support for ARM Jean Pihet
2014-05-06 15:26 ` Jean Pihet
2014-05-06 15:26 ` [PATCH 1/3] perf tests: Introduce perf_regs_load function on ARM Jean Pihet
2014-05-06 15:26 ` Jean Pihet
2014-05-06 15:26 ` [PATCH 2/3] perf tests: Add dwarf unwind test " Jean Pihet
2014-05-06 15:26 ` Jean Pihet
2014-05-07 12:06 ` Jiri Olsa [this message]
2014-05-07 12:06 ` Jiri Olsa
2014-05-07 12:24 ` Jean Pihet
2014-05-07 12:24 ` Jean Pihet
2014-05-07 12:36 ` Jiri Olsa
2014-05-07 12:36 ` Jiri Olsa
2014-05-06 15:26 ` [PATCH 3/3] perf tools: Add libdw DWARF post unwind support for ARM Jean Pihet
2014-05-06 15:26 ` Jean Pihet
2014-05-06 17:56 ` Will Deacon
2014-05-06 17:56 ` Will Deacon
2014-05-07 9:52 ` Jean Pihet
2014-05-07 9:52 ` Jean Pihet
2014-05-07 10:00 ` Will Deacon
2014-05-07 10:00 ` Will Deacon
2014-05-07 10:14 ` Jean Pihet
2014-05-07 10:14 ` Jean Pihet
2014-05-16 8:41 ` [PATCH 1/4] tools: perf: consolidate types.h for ARM and ARM64 Jean Pihet
2014-05-16 8:41 ` Jean Pihet
2014-05-16 8:41 ` [PATCH 2/4] perf tests: Introduce perf_regs_load function on ARM Jean Pihet
2014-05-16 8:41 ` Jean Pihet
2014-05-21 5:55 ` [tip:perf/core] " tip-bot for Jean Pihet
2014-05-16 8:41 ` [PATCH 3/4] perf tests: Add dwarf unwind test " Jean Pihet
2014-05-16 8:41 ` Jean Pihet
2014-05-21 5:55 ` [tip:perf/core] " tip-bot for Jean Pihet
2014-05-16 8:41 ` [PATCH 4/4] perf tools: Add libdw DWARF post unwind support for ARM Jean Pihet
2014-05-16 8:41 ` Jean Pihet
2014-05-21 5:55 ` [tip:perf/core] " tip-bot for Jean Pihet
2014-05-21 5:55 ` [tip:perf/core] perf tools: Consolidate types.h for ARM and ARM64 tip-bot for Jean Pihet
-- strict thread matches above, loose matches on Subject: below --
2014-03-03 9:53 [PATCH 0/3] perf tools: Add libdw DWARF post unwind support for ARM Jean Pihet
2014-03-03 9:53 ` [PATCH 2/3] perf tests: Add dwarf unwind test on ARM Jean Pihet
2014-03-03 9:53 ` Jean Pihet
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=20140507120603.GC2019@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=linux-arm-kernel@lists.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.