apitrace on OS X

Peter Lohrmann peterl at valvesoftware.com
Tue May 14 17:15:48 PDT 2013


Thanks for that. I got the Developer Tools installed (not sure why they weren't originally) so I could confirm that the library being loaded is what I expected ("OpenGL") and then used DYLD_PRINT_LIBRARIES to see which OpenGL was being loaded. Originally it was not the wrapper.

I think the underlying problem was that one of my paths had '~/' at the beginning, and that wasn't being handled properly. When I replaced that with "/Users/Peter/", the correct library was being loaded.

Unfortunately, the wrapper (even prior to my changes) prevents the program from launching with the error:

dyld: Symbol not found: _CGLClearDrawable
  Referenced from: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
  Expected in: /Users/Peter/ApiTrace/build/Debug/wrappers/OpenGL
in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Trace/BPT trap: 5

Have you ever run into that?

Thanks for your help so far!
- Peter

From: José Fonseca [mailto:jose.r.fonseca at gmail.com]
Sent: Tuesday, May 14, 2013 4:28 PM
To: Peter Lohrmann
Cc: Apitrace list
Subject: Re: apitrace on OS X

I believe the right extenision is actually *.dylib. Not *.dyld.

Sorry, I don't have a Mac hand. This is all from memory. Tomorrow I might retry on my mac machine and give more accurate answers.

I build with Xcode compilers, via command line cmake, just as described in the README.

The trace is generated in the current dir. There is usually a message to stderr saying "apitrace: tracing to ..." like on linux.

You can also force trace to be written to a given path by doing

   export TRACE_FILE=/path/to/where/you/want/the.trace

before running.

You can also do

  otool -L /path/to/your/executable

to see whether the wrapper from apitrace are being picked or not.

See   http://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/otool.1.html#//apple_ref/doc/man/1/otool
and http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/dyld.1.html for debuggin dynamic library loading.

Jose

On Tue, May 14, 2013 at 11:58 PM, Peter Lohrmann <peterl at valvesoftware.com<mailto:peterl at valvesoftware.com>> wrote:
I have no *.dyld files. The file that gets output from the cgltrace project is just called "OpenGL"

How are you compiling? I'm using XCode.

Where does your trace file get generated? In the ApiTrace folder, or the OSX.app/Contents/MacOS/CINEBENCH OSX" folder?

Even if I am in the directory containing apitrace, it is not recognized as an executable if I try to run it as you mention below. It does work if I use "open apitrace" and I can see the usage print out. Unfortunately I'm not able to get it to recognize any arguments.

- Peter
________________________________
From: José Fonseca [jose.r.fonseca at gmail.com<mailto:jose.r.fonseca at gmail.com>]
Sent: Tuesday, May 14, 2013 3:09 PM
To: Peter Lohrmann
Cc: Apitrace list
Subject: Re: apitrace on OS X
I use apitrace on MacOSX, though only sporadically.

I haven't tried tracing through "open". What I typically do is to find inside the executable inside foo.app/ and invoke that directly.  Take for example CINEBENCH -- if you download CINEBENCH http://www.maxon.net/?id=1258 , then you'd trace it as

   apitrace trace "CINEBENCH OSX.app/Contents/MacOS/CINEBENCH OSX"

or somthing like that.

Also, I'm surprised you have a wrappers/Debug subdir -- when I build on MacOSX the .dyld wrappers does not go into a Debug subdir. This only happens on MSVC builds for me. What does

  find /ApiTrace/build -name \*.dyld

output?

Jose
On Tue, May 14, 2013 at 10:21 PM, Peter Lohrmann <peterl at valvesoftware.com<mailto:peterl at valvesoftware.com>> wrote:

Hi all,



I'm trying to use apitrace on OS X, but having trouble. I've got the project building, and am using the suggested command line to launch the application (while also overriding DYLD_LIBRARY_PATH) and it does run, but I can't find a trace file anywhere. I'm guessing the application is not actually loading my opengl library.



export DYLD_LIBRARY_PATH=/ApiTrace/build/wrappers/Debug/

open <long path>/OSXGLEssentials.app



Can anyone offer some suggestions as to what the issue may be, or how to investigate this farther? I'm relatively new to OS X development, so all help would be appreciated.



Thank you,

   Peter

_______________________________________________
apitrace mailing list
apitrace at lists.freedesktop.org<mailto:apitrace at lists.freedesktop.org>
http://lists.freedesktop.org/mailman/listinfo/apitrace


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/apitrace/attachments/20130515/968d2f06/attachment.html>


More information about the apitrace mailing list