Am 17.02.2015 um 11:52 schrieb Raul Garcia:
> Thank you for your quick reply. I am profiling an application for ARM so I am 
> using the cross compiler tools for that ISA, Can you tell me in which file 
> from Valgrind source code can I find the Instrumentation function that you 
> mention?

I talked about the instrument function of a Valgrind tool.
Look at lk_instrument() in lackey (in VG sources, inside the
directory with this name) for an example.

For IRStmt *s of type Ist_IMark, one could extend the struct
to allow for a field s->Ist.IMark.mnc to provide the mnemonic
of that guest instruction as string.
When VEX is translating guest code to IR, it currently prints
the instructions to debug output; see DIP macro usage e.g.
in VEX/priv/guest_amd64_toIR.c. One would have to reroute this
to temporarily allocated space accessable via above mentioned
IRStmt field.

However, this seem to be heavy changes in the VEX part of
valgrind sources, and the sketched approach may slow down the
translation.

Josef

> can you provide some hints for what would be the procedure to implement this? 
> What Valgrind document should I read?
>
> Cheers,
> Raul.
> 
> ________________________________________
> From: Josef Weidendorfer [josef.weidendor...@gmx.de]
> Sent: Tuesday, February 17, 2015 9:40 AM
> To: Raul Garcia; valgrind-users@lists.sourceforge.net
> Subject: Re: [Valgrind-users] Dump of opcode/mnemonic per code line
> 
> Am 16.02.2015 um 22:29 schrieb Raul Garcia:
>> |That information is great, but is it possible to get the exact instructions 
>> (mnemonics) that where utilized/executed
>> per each line like in the example below? This information would be really 
>> valuable to me.
> 
> In the instrument function you have access to the guest code bytes. So,
> if you add your own
> disassembler for the ISA, you can get what you want.
> 
> It would be nice if VEX can return the mnemonics. Especially as they are
> already in the code as
> debug output. As far as I can see, this is "just" some kind of
> refactoring effort which
> nobody did up to now.
> 
> Callgrind's visualization (kcachegrind) calls out to "objdump" to do
> annotation on a machine
> code level. That's just not working for dynamically generated code. To
> support that, your feature
> request also would be good.
> 
> Josef
> 
> 
>>
>> |        . void swap(int *a, int *b)
>>         3,000  {                    [insta, instb, instc]
>>         3,000      int tmp = *a;    |||[insta, instb, instc]|
>>         4,000      *a = *b;         ||||[instd, instd, insta,|||||||||| 
>> instc||||]||
>>         3,000      *b = tmp;        |||||[instc, insta, instb]|||
>>         2,000  }|                    ||||[instc, insta]||||
>>
>> Best Regards,
>> Raul.
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
>>
>>
>>
>> _______________________________________________
>> Valgrind-users mailing list
>> Valgrind-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>>
> 

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to