Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shark symbolification of generated code




On Jan 8, 2008, at 8:44 AM, Joachim Ante wrote:

Hi,

I want to profile code that is jitted at runtime. Specifically i want to profile code generated by mono. (a .NET runtime)
The generated code of course has no debug symbols, so I'd like to write some kind of plugin or extension that will let Shark translate function address to human readable symbols.



Shark provides no infrastructure for this. JIT code isn't listed as a header by the dynamic linker so Shark doesn't even know where to look for symbol information. The profile will show the addresses of the executed JIT code, but there are a few potential problems. If the JIT doesn't preserve the frame pointer, the backtrace will be useless after the top frame. Even with that in place, Shark collects symbol information at the end of the sampling. This is to avoid the performance impact of doing symbol lookups during the sampling. If the JIT reuses the same block of memory for multiple JIT fragments, then Shark has no idea which code fragment was JIT'd to a given address when the sample was recorded. The JIT would need to keep track of every JIT code fragment generated, the original source it came from, and when the code fragment was generated.


I saw that there is a Chud - Symbolification framework, so i am wondering if there are some hooks I can implement to generate symbols for the generated code. I can very easily add some functions that will return a symbol, based on a the function adress.

CHUDSymbolication.framework is an internal framework. No documentation or headers are provided and the interface is subject to change. Even with that notice, I should point out that it doesn't offer the type of functionality you want anyway.




Any ideas? Is this possible at all? is there any information on the Chud Symbolification framework out there?

The only way this would be possible would be to either:

- Have a code cache that never evicts. Provide a function to map from JIT address to source address/information. Have us add support for calling that function to Shark.

- Have a code cache that evicts. Keep a log of all code fragments generated, the JIT address, the source address/information, and the time the code fragment was JIT'd. Provide a description of the log format. Have us add support for that log format to Shark.



Best regards,
Joachim Ante
_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list (email@hidden )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden


This email sent to email@hidden

-- Rick Altherr Architecture and Performance Group email@hidden


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden

References: 
 >Shark symbolification of generated code (From: Joachim Ante <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.