lkml.org 
[lkml]   [2013]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v7 16/18] perf tools: detect data vs. text mappings
    Date
    Leverages the PERF_RECORD_MISC_MMAP_DATA bit in
    the RECORD_MMAP record header. When the bit is set
    then the mapping type is set to MAP__VARIABLE.

    Signed-off-by: Stephane Eranian <eranian@google.com>
    ---
    tools/perf/util/machine.c | 10 +++++++++-
    1 file changed, 9 insertions(+), 1 deletion(-)

    diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
    index 1f09d05..d1c3e48 100644
    --- a/tools/perf/util/machine.c
    +++ b/tools/perf/util/machine.c
    @@ -379,6 +379,7 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event
    u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
    struct thread *thread;
    struct map *map;
    + enum map_type type;
    int ret = 0;

    if (dump_trace)
    @@ -395,10 +396,17 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event
    thread = machine__findnew_thread(machine, event->mmap.pid);
    if (thread == NULL)
    goto out_problem;
    +
    + if (event->header.misc & PERF_RECORD_MISC_MMAP_DATA)
    + type = MAP__VARIABLE;
    + else
    + type = MAP__FUNCTION;
    +
    map = map__new(&machine->user_dsos, event->mmap.start,
    event->mmap.len, event->mmap.pgoff,
    event->mmap.pid, event->mmap.filename,
    - MAP__FUNCTION);
    + type);
    +
    if (map == NULL)
    goto out_problem;

    --
    1.7.9.5


    \
     
     \ /
      Last update: 2013-01-24 19:01    [W:6.940 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site