<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Looks like the library I was generating was x86_64, but the application was strictly i386.  It took a bit of messing around with the project settings to get
 it to output just a 32-bit version, and then it seems the generated library went to a different directory /ApiTrace/build/wrappers/Debug instead of /ApiTrace/build/Debug/wrappers.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">After making those adjustments, I was able to get a trace generated, and it replays without trouble.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks again for the help,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Peter<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Peter Lohrmann
<br>
<b>Sent:</b> Tuesday, May 14, 2013 5:16 PM<br>
<b>To:</b> José Fonseca<br>
<b>Cc:</b> Apitrace list<br>
<b>Subject:</b> RE: apitrace on OS X<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Unfortunately, the wrapper (even prior to my changes) prevents the program from launching with the error:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">dyld: Symbol not found: _CGLClearDrawable<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">  Referenced from: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">  Expected in: /Users/Peter/ApiTrace/build/Debug/wrappers/OpenGL<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Trace/BPT trap: 5<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Have you ever run into that?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks for your help so far!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">- Peter<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> José Fonseca [<a href="mailto:jose.r.fonseca@gmail.com">mailto:jose.r.fonseca@gmail.com</a>]
<br>
<b>Sent:</b> Tuesday, May 14, 2013 4:28 PM<br>
<b>To:</b> Peter Lohrmann<br>
<b>Cc:</b> Apitrace list<br>
<b>Subject:</b> Re: apitrace on OS X<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I believe the right extenision is actually *.dylib. Not *.dyld.<br>
<br>
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.<br>
<br>
I build with Xcode compilers, via command line cmake, just as described in the README.<br>
<br>
The trace is generated in the current dir. There is usually a message to stderr saying "apitrace: tracing to ..." like on linux.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You can also force trace to be written to a given path by doing<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">   export TRACE_FILE=/path/to/where/you/want/the.trace<br>
<br>
before running.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You can also do<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">  otool -L /path/to/your/executable<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">to see whether the wrapper from apitrace are being picked or not. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">See   <a href="http://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/otool.1.html#//apple_ref/doc/man/1/otool">
http://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/otool.1.html#//apple_ref/doc/man/1/otool</a><br>
and <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/dyld.1.html">http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/dyld.1.html</a> for debuggin dynamic library loading.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
Jose<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Tue, May 14, 2013 at 11:58 PM, Peter Lohrmann <<a href="mailto:peterl@valvesoftware.com" target="_blank">peterl@valvesoftware.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">I have no *.dyld files. The file that gets output from the cgltrace project is just called "OpenGL"<br>
<br>
How are you compiling? I'm using XCode.<br>
<br>
Where does your trace file get generated? In the ApiTrace folder, or the OSX.app/Contents/MacOS/CINEBENCH OSX" folder?<br>
<br>
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.<br>
<br>
- Peter<o:p></o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="100%" align="center">
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-family:"Tahoma","sans-serif";color:black">From:</span></b><span style="font-family:"Tahoma","sans-serif";color:black"> José Fonseca [<a href="mailto:jose.r.fonseca@gmail.com" target="_blank">jose.r.fonseca@gmail.com</a>]<br>
<b>Sent:</b> Tuesday, May 14, 2013 3:09 PM<br>
<b>To:</b> Peter Lohrmann<br>
<b>Cc:</b> Apitrace list<br>
<b>Subject:</b> Re: apitrace on OS X</span><o:p></o:p></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">I use apitrace on MacOSX, though only sporadically. <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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 <a href="http://www.maxon.net/?id=1258" target="_blank">http://www.maxon.net/?id=1258</a> ,
 then you'd trace it as<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">   apitrace trace "CINEBENCH OSX.app/Contents/MacOS/CINEBENCH OSX"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">or somthing like that.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">  find /ApiTrace/build -name \*.dyld <o:p></o:p></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">output?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Jose<o:p></o:p></p>
<div>
<p class="MsoNormal">On Tue, May 14, 2013 at 10:21 PM, Peter Lohrmann <<a href="mailto:peterl@valvesoftware.com" target="_blank">peterl@valvesoftware.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi all,</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.
</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p>export DYLD_LIBRARY_PATH=/ApiTrace/build/wrappers/Debug/<o:p></o:p></p>
<p>open <long path>/OSXGLEssentials.app<o:p></o:p></p>
<p> <o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thank you,</span><o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">   Peter</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
apitrace mailing list<br>
<a href="mailto:apitrace@lists.freedesktop.org" target="_blank">apitrace@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/apitrace" target="_blank">http://lists.freedesktop.org/mailman/listinfo/apitrace</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>