apitrace can't trace 32bit apps on a 64bit system. This is a problem when trying to trace 32bit games to debug mesa bugs.
The apitrace readme states "On 64bits Linux and Windows platforms you'll need apitrace binaries that match the architecture (32bits or 64bits) of the application being traced." So this isn't a bug in apitrace, but rather a limitation. What you can do however is install the 32bit version of apitrace, either compiling and installing manually to a prefix outside of the system root, or by downloading the respective package plus dependencies from koji [1] and installing them. If you choose the second variant, you'll need to remove the x86_64 apitrace to avoid conflicts. There is unfortunately little I can do on my part. If you dislike the apitrace limitation, you can try raising the issue upstream [2]. Installing 32bit non-library packages on 64-bit is cumbersome due to Fedora currently non being fully multiarch, but rather only allowing multiarch for libraries (i.e. lib vs lib64). I'm closing this issue as NOTABUG. Thanks. [1] http://koji.fedoraproject.org/koji/packageinfo?packageID=17361 [2] https://github.com/apitrace/apitrace/issues
apitrace loads a library using LD_PRELOAD. If the package was split to 32bit and 64bit libs, to allow installing the 32bit lib on a 64bit system, you could trace 64bit apps. All you need to do is some packaging magic to make it possible to have both 32bit and 64bit apitrace lib installed. I can't imagine why this approach will fail. have you tried it?
Very valid observation, you obviously have had a closer look at apitrace than I have. Please try this scratch build [1]. If it does not work, then possibly the path to the preload library is hardcoded and the sources need to be patched to load the correct library. Apologies for closing the bug without proper investigation on my part. [1] http://koji.fedoraproject.org/koji/taskinfo?taskID=6557134
I think you got the deps wrong, apitrace(x86-32) = 4.0-5.fc20 is needed by apitrace-libs-4.0-5.fc20.i686 I installed it with nodeps and it's no good, the path is hardcoded. Manually doing LD_PRELOAD=/usr/lib/apitrace/wrappers/glxtrace.so did manage to trace a 32bit app, so this is progress! All we/you need now is to patch apitrace to pick the right architecture... Perhaps chaining both architecture in LD_PRELOAD would work - 64bit will fail but 32bit will load, or vise-versa.
Right, I did it a bit in a hurry as I was about to run to catch the train :) I won't have time to look at in until tomorrow evening, in the meantime feel free to investigate more.
Created attachment 866508 [details] Patch Please try this scratch build [1] (note: I didn't bump the version, but it is not the same build as before). The patch I applied is attached. I highly doubt this is upstreamable though. Please give it a try. [1] http://koji.fedoraproject.org/koji/taskinfo?taskID=6560549
Nope, doesn't work: [elad@weatherwax FEZ]$ apitrace trace FEZ.bin.x86 error: failed to execute: FEZ.bin.x86 [elad@weatherwax FEZ]$ file FEZ.bin.x86 FEZ.bin.x86: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=c5efef25e83fa8e283c444711eede6c4c8ece673, not stripped
Uhm ok I'll need to look at it further.
Does you binary have executable permissions? I've tried out my patch here and it works fine.
apitrace-4.0-5.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/apitrace-4.0-5.fc19
Package apitrace-4.0-5.fc19: * should fix your issue, * was pushed to the Fedora 19 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing apitrace-4.0-5.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-3626/apitrace-4.0-5.fc19 then log in and leave karma (feedback).
apitrace-4.0-5.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.