From: Wang Nan <wangnan0@huawei.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: <acme@kernel.org>, <jolsa@kernel.org>, <namhyung@kernel.org>,
<mingo@redhat.com>, <lizefan@huawei.com>, <pi3orama@163.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/4] perf tools: report: introduce --map-adjustment argument.
Date: Thu, 2 Apr 2015 09:15:38 +0800 [thread overview]
Message-ID: <551C983A.3030300@huawei.com> (raw)
In-Reply-To: <20150401132140.GC10820@krava.brq.redhat.com>
On 2015/4/1 21:21, Jiri Olsa wrote:
> On Wed, Apr 01, 2015 at 10:33:14AM +0000, Wang Nan wrote:
>> This patch introduces a --map-adjustment argument for perf report. The
>> goal of this option is to deal with private dynamic loader used in some
>> special program.
>>
>
> SNIP
>
>> diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
>> index 051883a..dc9e91e 100644
>> --- a/tools/perf/util/machine.c
>> +++ b/tools/perf/util/machine.c
>> @@ -1155,21 +1155,291 @@ out_problem:
>> return -1;
>> }
>>
>> +/*
>> + * Users are allowed to provide map adjustment setting for the case
>> + * that an address range is actually privatly mapped but known to be
>> + * ELF object file backended. Like this:
>> + *
>> + * |<- copied from libx.so ->| |<- copied from liby.so ->|
>> + * |<-------------------- MMAP area --------------------->|
>> + *
>> + * When dealing with such mmap events, try to obey user adjustment.
>> + * Such adjustment settings are not allowed overlapping.
>> + * Adjustments won't be considered as valid code until real MMAP events
>> + * take place. Therefore, users are allowed to provide adjustments which
>> + * cover never mapped areas, like:
>> + *
>> + * |<- libx.so ->| |<- liby.so ->|
>> + * |<-- MMAP area -->|
>> + *
>> + * This feature is useful when dealing with private dynamic linkers,
>> + * which assemble code piece from different ELF objects.
>> + *
>> + * map_adj_list is an ordered linked list. Order of two adjustments is
>> + * first defined by their pid, and then by their start address.
>> + * Therefore, adjustments for specific pids are groupped together
>> + * naturally.
>> + */
>> +static LIST_HEAD(map_adj_list);
>
> we dont like global stuff ;-)
>
> I think this belongs to the machine object, which is created
> within the perf_session__new, so after options parsing.. hum
>
Do you think such struct map_adj objects should better reside in thread
objects?
SNIP
>
> just curious.. how many --map-adjust entries do you normaly use?
> maybe if it's bigger number then a) using rb_tree might be faster
> and b) using some sort of config file could be better way for
> input might be easier
>
The address and pid are dynamically allocated so I don't think static config
file is a good way for input. I'll consider rb_tree in my next post.
Thank you.
next prev parent reply other threads:[~2015-04-02 1:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-01 10:33 [PATCH 0/4] perf tools: introduce --map-adjustment Wang Nan
2015-04-01 10:33 ` [PATCH 1/4] perf tools: unwind: ensure unwind hooks return negative errorno Wang Nan
2015-04-01 12:12 ` Jiri Olsa
2015-04-01 12:41 ` Wang Nan
2015-04-07 8:30 ` Wang Nan
2015-04-01 10:33 ` [PATCH 2/4] perf tools: introduce machine_map_new to merge mmap/mmap2 processing code Wang Nan
2015-04-01 12:18 ` Jiri Olsa
2015-04-01 14:58 ` Arnaldo Carvalho de Melo
2015-04-01 10:33 ` [PATCH 3/4] perf tools: report: introduce --map-adjustment argument Wang Nan
2015-04-01 13:21 ` Jiri Olsa
2015-04-02 1:15 ` Wang Nan [this message]
2015-04-01 14:23 ` pi3orama
2015-04-01 10:33 ` [PATCH 4/4] perf tools: unwinding: try to read from map_adj for a unmapped address Wang Nan
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=551C983A.3030300@huawei.com \
--to=wangnan0@huawei.com \
--cc=acme@kernel.org \
--cc=jolsa@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=pi3orama@163.com \
/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.