[PATCH 0/3][RFC] Support for single frame capture

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Mon Mar 2 04:13:25 PST 2015


This is a bit rfc'y set of what I've been toying with recently, for commenting
round for now. Idea for single frame capture is coming from people claiming
trimming of traces not working or being too slow.

What this set does is allow glxtrace.so run in the background but not
necessarily writing everything into trace file. Setting environment variable
APITRACE_SINGLE_FRAME_CAPTURE_MODE to 1 causes alternative tracing mode to
be active. Once number is written to /tmp/apitrace_capture_frame_now.txt
glxtrace.so wakes up to writing everything into trace file, number written
into the file indicate how many following frames will be recorded. What I am
currently poking at to make better is gl state rebuilding code which can be
seen at end of glxtrace.py. Currently glxgears works for me when enable
tracing from the middle of glxgears execution.

Anyhow, if someone see something funny, weird or just plain wrong I'll be happy
to see the comments. Implementation for enable/disable writing of trace file
in trace writer class is a bit hackish' but it was least amount of changes I
thought of thus its the way it is. I had only glx in mind for now with
highlighting places for changes needed for egl and adroid later.

Simple steps to try this out would go as:

APITRACE_SINGLE_FRAME_CAPTURE_MODE=1 LD_PRELOAD=./glxtrace.so glxgears &
echo 3 > /tmp/apitrace_capture_frame_now.txt

After closing glxgears one should see three frames written into
glxgears.trace file.

/Juha-Pekka

Juha-Pekka Heikkila (3):
  Support single frame capture with glx
  Add support for display lists for single frame capture
  Add gl state rebuilding code for single frame capture

 common/trace_writer.cpp       |  29 ++++++---
 common/trace_writer.hpp       |  14 +++++
 common/trace_writer_local.cpp | 138 ++++++++++++++++++++++++++++++++++++++++--
 common/trace_writer_local.hpp |  10 +++
 wrappers/egltrace.py          |   8 +++
 wrappers/glxtrace.py          | 124 +++++++++++++++++++++++++++++++++++++
 6 files changed, 312 insertions(+), 11 deletions(-)

-- 
1.8.5.1



More information about the apitrace mailing list