3

I'm trying to build the dtrace target in the Xcode project using the advice here:

http://osx86.boeaja.info/2009/10/building-xnu-kernel-on-snow-leopard/

But I get: libproc.m:24:49: error: CoreSymbolication/CoreSymbolication.h: No such file or directory

I realize CoreSymbolication is a private framework, but Apple must make this header available somewhere in order for me to build dtrace, right? Can someone point me to the necessary files to build dtrace?

JanePhanie
  • 579
  • 1
  • 6
  • 10
  • DTrace is build into the standard shipping kernel in Snow Leopard. What exactly do you want to do? – Yuji Feb 02 '10 at 19:21
  • I want to build it from scratch. I figured that was part of the bargain with an open source (CDDL) package, but maybe Apple doesn't have to provide all the pieces to make this true? – JanePhanie Feb 18 '10 at 00:06

1 Answers1

1

As you probably figured out, Apple only has to release parts of the kernel which are taken from other open-source projects, and that doesn't include the userland libraries that they build on top of the kernel. CoreSymbolication/CoreSymbolication.h sounds a lot like a userspace header for Obj-C though, so you can probably build the kernel DTrace utilities without it. (Although I could very well be wrong.)

I would guess it's being used for symbol identification in the userland dtrace(1m) command. If only there was a tool that could help us figure this out... :-D

# dtrace -n 'pid$target:CoreSymbolication::entry {}' -c 'dtrace -ln syscall::write:entry'
dtrace: description 'pid$target:CoreSymbolication::entry ' matched 246 probes
   ID   PROVIDER            MODULE                          FUNCTION NAME
  147    syscall                                               write entry
dtrace: pid 88089 has exited
CPU     ID                    FUNCTION:NAME
  2   6538 CSSymbolOwnerGetRegionWithName:entry 
  2   5014 CSSymbolOwnerForeachRegionWithName:entry 
  2   5078      CSRegionForeachSymbol:entry 
  2   6495 CSSymbolicatorGetSymbolOwnerWithUUIDAtTime:entry 
  2   6493 CSSymbolicatorForeachSymbolOwnerWithUUIDAtTime:entry 
  2   6494 CSSymbolicatorForeachSymbolOwnerWithCFUUIDBytesAtTime:entry 
  2   5048  CSSymbolOwnerGetDataFlags:entry 
  2   6538 CSSymbolOwnerGetRegionWithName:entry 
  2   5014 CSSymbolOwnerForeachRegionWithName:entry 
  2   5078      CSRegionForeachSymbol:entry 
  2   5092         CSSymbolIsExternal:entry 
  2   5092         CSSymbolIsExternal:entry
  ...

It looks like the library is in use by the dtrace command, anyway.

Dan
  • 7,155
  • 2
  • 29
  • 54
  • Reverse-engineered headers available here – https://github.com/mountainstorm/CoreSymbolication (haven't tried using them myself, so no idea how good they are) – Simon Kissane Aug 02 '19 at 03:58