[Mesa-dev] How difficult would it be to have debugging information for Jitted code show up?

Kenneth Graunke kenneth at whitecape.org
Mon Nov 10 23:18:33 PST 2014


On Tuesday, November 11, 2014 12:27:26 AM Steven Stewart-Gallus wrote:
> Hello,
> 
> Before filing a bug report, I wanted to have ask first how difficult it'd be to
> have debugging information for Jitted code show up be. It occurs to me that this
> probably wouldn't work for precompiled shader sources and that there's probably
> not a lot of code that has been written to support this. However, LLVM obviously
> has support for debugging information and as Mesa relies upon LLVM maybe most of
> the hardwork has already been done? I would guess that this would be easiest for
> software rendering and maybe possible, maybe not possible for the code that uses
> the Intel 3D hardware abilities?
> 
> Thank you,
> Steven Stewart-Gallus

What kind of debugging information are you looking for?

We have a few environment variables already...

INTEL_DEBUG=perf
   Prints warnings when having to recompile shaders based on GL state;
   also warns when draw-time recompiling stalls the GPU

INTEL_DEBUG=vs,fs,gs
   Prints out shader assembly, including the number of instructions and loops

MESA_GLSL=dump
   Prints out shader source and compiler intermediate representation

With the Intel driver, we have some tools that can measure instruction counts
across a collection of shaders, and compare between reports:

   http://cgit.freedesktop.org/mesa/shader-db

FWIW, LLVM is not used on Intel, nor (AFAIK) nouveau.  radeonsi and llvmpipe
both require it, and I believe it's optional for r600.

We could certainly add more information, if there's something you're looking
for and not able to find today.  We've been adding things as we've found a
need for them...

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141110/9de0f3fe/attachment.sig>


More information about the mesa-dev mailing list