<div dir="ltr">On Tue, Mar 5, 2013 at 9:11 AM, Alexander Monakov <span dir="ltr"><<a href="mailto:amonakov@ispras.ru" target="_blank">amonakov@ispras.ru</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im"><br>
<br>
On Mon, 4 Mar 2013, Carl Worth wrote:<br>
<br>
> I don't think it should be too hard to get this to work, (though it<br>
> may require a source change to the Steam overlay). I'll do some more<br>
> experiments tomorrow and see if I can't make a concrete recommendation<br>
> to be able to give to Valve as a bug report.<br>
><br>
> And, obviously, if there's something we can do to make apitrace more<br>
> robust here, I'll submit that change as well.<br>
<br>
</div>I faced a similar issue in my lightweight OpenGL offloading via GLX forking<br>
project, primus [1], and I'm successfully using the following approach:<br>
<br>
1) The interposition is based on LD_LIBRARY_PATH augmentation, LD_PRELOAD is<br>
not employed. Pro: no ugly tricks with dlopen/dlsym interposition. Contra:<br>
the interposer needs to know the path to the "real" OpenGL library. For<br>
APITrace, /usr/$LIB/libGL.so.1 will usually be a working default choice (NB:<br>
$LIB is a special token expanded by the dynamic loader, not the shell).<br>
<br>
2) Specifically in order to work with the Steam overlay, the interposer<br>
*protects itself from dlsym interposition* by using<br>
real_dlsym = dlsym(dlopen("libdl.so.2"), "dlsym"). Similar protection against<br>
dlopen interposition would also make sense.<br>
<br>
Hope that helps,<br>
<br>
Alexander<br>
<br>
[1] <a href="https://github.com/amonakov/primus" target="_blank">https://github.com/amonakov/primus</a><br>
<div class=""><div class="h5">_______________________________________________<br>
apitrace mailing list<br>
<a href="mailto:apitrace@lists.freedesktop.org">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><br>
</div></div></blockquote></div><br></div><div class="gmail_extra" style>FYI, with <a href="https://github.com/apitrace/apitrace/commit/7700f74f294a28e57860487b917c8807156b3ad1">https://github.com/apitrace/apitrace/commit/7700f74f294a28e57860487b917c8807156b3ad1</a> apitrace no longer crashes with Steam overlay. But the overlay's rendering is not shown/captured when when apitrace uses LD_PRELOAD. But using LD_LIBRARY_PATH mechanism captures everything just fine.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>Detailed instructions on <a href="https://github.com/apitrace/apitrace/wiki/Steam">https://github.com/apitrace/apitrace/wiki/Steam</a></div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style>Jose</div></div>