lkml.org 
[lkml]   [2014]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] perf tools: Synthesize anon MMAP records on the heap
Date
Hi Gaurav,

On Wed, 15 Jan 2014 06:44:39 +0000, Gaurav Jain wrote:
> Hi Namhyung,
>
>
> On 1/15/14, 12:46 AM, "Namhyung Kim" <namhyung@kernel.org> wrote:
>>Hmm.. so the point is that an executable heap mapping should have
>>/tmp/perf-XXX.map as a file name, right? If so, does something like
>>below work well for you?
>
> Just gave it a try and it fixed the issue perfectly! Thanks for the help.
> This looks like a much better solution than treating the heap mapping as
> an anon record.

Thanks for testing! It's good to hear it solved your problem. :)

>
> Gaurav
>
>>diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
>>index 9b9bd719aa19..d52387fe83f1 100644
>>--- a/tools/perf/util/map.c
>>+++ b/tools/perf/util/map.c
>>@@ -69,7 +69,7 @@ struct map *map__new(struct list_head *dsos__list, u64
>>start, u64 len,
>> map->ino = ino;
>> map->ino_generation = ino_gen;
>>
>>- if (anon) {
>>+ if (anon || (no_dso && type == MAP__FUNCTION)) {

Hmm.. I think it should check type of anon mapping too (assuming JIT
interface only provides function symbols, no?):

if ((anon || no_dso) && type == MAP__FUNCTION)) {


>> snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", pid);
>> filename = newfilename;
>> }
>>@@ -93,7 +93,7 @@ struct map *map__new(struct list_head *dsos__list, u64
>>start, u64 len,
>> * functions still return NULL, and we avoid the
>> * unnecessary map__load warning.
>> */
>>- if (no_dso)
>>+ if (no_dso && type != MAP__FUNCTION)

And it should be simply:

if (type != MAP__FUNCTION)


>> dso__set_loaded(dso, map->type);
>> }
>> }

I'll update this and send a formal patch soon. Could you please test it with
the new patch then?

Thanks,
Namhyung

\
 
 \ /
  Last update: 2014-01-16 02:21    [W:0.048 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site