Instruments does not work with a kernel built from source.

Originator:verbalfu
Number:rdar://10542001 Date Originated:12/07/2011
Status:Open Resolved:
Product:Mac OS X Product Version:10.7.2 / 11C54
Classification:Serious Bug Reproducible:Always
 
07-Dec-2011 12:26 PM Matthew Messier:
Summary:
Using a Darwin kernel built from source prevents Instruments from functioning.

Steps to Reproduce:
1. Build and install a Darwin kernel using the publicly available xnu sources (1699.24.8)
2. Launch Instruments
3. Use Time Profile (or most anything else, really, but this is what I first used to discover the problem)
4. Start the time profiler. No data will be collected. No error is displayed; however, a system.log entry is made indicating a problem (see Notes below)

Expected Results:
Instruments should function normally, collecting data at timed intervals.

Actual Results:
Instruments does not collect any data.

Regression:

Notes:
When Instruments attempts to start capturing data from a process, the following is logged to system.log:

Dec  7 12:09:55 ichor Instruments[10478]: <CPTimeTrigger.c:295>	Unable to create new time trigger client for new time trigger <CPTimeTrigger 0x7f9b4d806910>.
Dec  7 12:09:55 ichor Instruments[10478]: <CPTrigger.c:3776>	Unable to obtain control lock on time trigger <CPTimeTrigger 0x7f9b4d806910>, error #22 - Invalid argument.
Dec  7 12:09:55 ichor Instruments[10478]: <CPTrigger.c:3807>	Warning: unable to destroy control lock for <CPTimeTrigger 0x7f9b4d806910>, error #22 - Invalid argument.
Dec  7 12:09:55 ichor [0x0-0x15b15b].com.apple.Instruments3[10478]: [ERROR]	<CPTimeTrigger.c:295>	Unable to create new time trigger client for new time trigger <CPTimeTrigger 0x7f9b4d806910>.
Dec  7 12:09:55 ichor [0x0-0x15b15b].com.apple.Instruments3[10478]: [ERROR]	<CPTrigger.c:3776>	Unable to obtain control lock on time trigger <CPTimeTrigger 0x7f9b4d806910>, error #22 - Invalid argument.
Dec  7 12:09:55 ichor [0x0-0x15b15b].com.apple.Instruments3[10478]: [ERROR]	<CPTrigger.c:3807>	Warning: unable to destroy control lock for <CPTimeTrigger 0x7f9b4d806910>, error #22 - Invalid argument.
Dec  7 12:09:55 ichor Instruments[10478]: (_AddTimeTrigger:653): Error Domain=com.apple.CoreProfile Code=-2 "Initialisation of new time trigger <CPTimeTrigger 0x7f9b4d806910> failed." UserInfo=0x7f9b4d809ec0 {com.apple.CoreProfile.facility=com.apple.CoreProfile.Triggers, com.apple.CoreProfile.file=CPTimeTrigger.c, com.apple.CoreProfile.function=CPTimeTriggerCreate, com.apple.CoreProfile.line=85, NSLocalizedDescription=Initialisation of new time trigger <CPTimeTrigger 0x7f9b4d806910> failed.}

Apple private profiling kernel modules appear to be failing to initialize. The appleprofile.* sysctls do not exist as they normally would using an Apple supplied kernel. No error or other indication of failure is reported anywhere when the kernel modules are loaded, even manually using kextutil.

The inability to use Instruments with a custom-built kernel makes it rather difficult to fix and test performance bottlenecks in the kernel. Obviously I can fix and test that they work, but I can't actually use them for any further testing, which is a significant hinderance.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!