* Question to struct map
@ 2017-09-12 15:04 Thomas-Mich Richter
2017-09-12 15:17 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 4+ messages in thread
From: Thomas-Mich Richter @ 2017-09-12 15:04 UTC (permalink / raw)
To: linux-perf-use.
Hi all,
I have a question regarding struct map.
What is the purpose is the functions pointers in struct map named map_ip and unmap_ip?
How do they relate the to dso the struct map is refering to?
This is not clear to me. Must have been on vacation for too long :-).
Thanks a lot.
--
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question to struct map
2017-09-12 15:04 Question to struct map Thomas-Mich Richter
@ 2017-09-12 15:17 ` Arnaldo Carvalho de Melo
2017-09-13 14:48 ` Thomas-Mich Richter
0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-09-12 15:17 UTC (permalink / raw)
To: Thomas-Mich Richter; +Cc: linux-perf-use.
Em Tue, Sep 12, 2017 at 05:04:53PM +0200, Thomas-Mich Richter escreveu:
> Hi all,
>
> I have a question regarding struct map.
> What is the purpose is the functions pointers in struct map named map_ip and unmap_ip?
> How do they relate the to dso the struct map is refering to?
A DSO has a symbol table (ELF or other kind, like the JIT ones
(documented in tools/perf/Documentation/jit-interface.txt) that may be
identity mapped or not, requiring or not use of relocation, etc.
The map, on the other hand, is where this DSO was loaded in memory,
which will be used to add to the symbol offset to do the address
resolution.
- Arnaldo
> This is not clear to me. Must have been on vacation for too long :-).
>
> Thanks a lot.
> --
> Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
> --
> Vorsitzende des Aufsichtsrats: Martina Koederitz
> Geschäftsführung: Dirk Wittkopp
> Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question to struct map
2017-09-12 15:17 ` Arnaldo Carvalho de Melo
@ 2017-09-13 14:48 ` Thomas-Mich Richter
2017-09-13 15:18 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 4+ messages in thread
From: Thomas-Mich Richter @ 2017-09-13 14:48 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: linux-perf-use.
On 09/12/2017 05:17 PM, Arnaldo Carvalho de Melo wrote:
> Em Tue, Sep 12, 2017 at 05:04:53PM +0200, Thomas-Mich Richter escreveu:
>> Hi all,
>>
>> I have a question regarding struct map.
>> What is the purpose is the functions pointers in struct map named map_ip and unmap_ip?
>> How do they relate the to dso the struct map is refering to?
>
> A DSO has a symbol table (ELF or other kind, like the JIT ones
> (documented in tools/perf/Documentation/jit-interface.txt) that may be
> identity mapped or not, requiring or not use of relocation, etc.
>
> The map, on the other hand, is where this DSO was loaded in memory,
> which will be used to add to the symbol offset to do the address
> resolution.
>
> - Arnaldo
>
I think I got it now.
The map__map_ip() function converts a symbol's virtual memory address to the
byte offset of that symbol in the ELF file.
The map__unmap_ip() function does the opposite.
Thanks for the explanation.
--
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question to struct map
2017-09-13 14:48 ` Thomas-Mich Richter
@ 2017-09-13 15:18 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-09-13 15:18 UTC (permalink / raw)
To: Thomas-Mich Richter; +Cc: linux-perf-use.
Em Wed, Sep 13, 2017 at 04:48:03PM +0200, Thomas-Mich Richter escreveu:
> On 09/12/2017 05:17 PM, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Sep 12, 2017 at 05:04:53PM +0200, Thomas-Mich Richter escreveu:
> >> I have a question regarding struct map.
> >> What is the purpose is the functions pointers in struct map named map_ip and unmap_ip?
> >> How do they relate the to dso the struct map is refering to?
> > A DSO has a symbol table (ELF or other kind, like the JIT ones
> > (documented in tools/perf/Documentation/jit-interface.txt) that may be
> > identity mapped or not, requiring or not use of relocation, etc.
> > The map, on the other hand, is where this DSO was loaded in memory,
> > which will be used to add to the symbol offset to do the address
> > resolution.
>
> I think I got it now.
> The map__map_ip() function converts a symbol's virtual memory address to the
> byte offset of that symbol in the ELF file.
>
> The map__unmap_ip() function does the opposite.
>
> Thanks for the explanation.
You're welcome, and if I may suggest, please consider these moments as
opportunities to help people that, like you, scratch their heads in the
future about these pointers, adding comments to the struct definition
:-)
- Arnaldo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-13 15:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-12 15:04 Question to struct map Thomas-Mich Richter
2017-09-12 15:17 ` Arnaldo Carvalho de Melo
2017-09-13 14:48 ` Thomas-Mich Richter
2017-09-13 15:18 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).