From: Peter Clifton <pcjc2@cam.ac.uk>
To: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Design of a GPU profiling debug interface
Date: Sat, 30 Oct 2010 14:04:11 +0100 [thread overview]
Message-ID: <1288443851.21112.30.camel@pcjc2lap> (raw)
I think I'll need some help with this. I'm by no means a kernel
programmer, so I'm feeling my way in the dark with this.
I want to design an interface so I can synchronise my GPU idle flags
polling with batchbuffer execution. I'm imagining at a high level, doing
something like this in my application (or mesa). (Hand-wavey-pseudocode)
expose_event_handler ()
{
static bool one_shot_trace = true;
if (one_shot_trace)
mesa_debug_i915_trace_idle (TRUE);
/* RENDERING COMMANDS IN HERE */
SwapBuffers();
if (one_shot_trace)
mesa_debug_i915_trace_idle (FALSE);
one_shot_trace = false;
}
I was imagining adding a flag to the EXECBUFFER2 IOCTL, or perhaps
adding a new EXECBUFFER3 IOCTL (which I'm playing with locally now).
Basically I just want to flag execbuffers which I'm interested in seeing
profiling data for.
In order to get really high-resolution profiling, it would be
advantageous to confine it to the time-period of interest otherwise the
data rate is too high. I guestimated about 10MB/s for a binary
representation of the data I'm currently polling in user-space. More
spatial resolution would be nice too, so this could increase.
I think I have a vague idea how to do the GPU and logging parts, even if
I end up having to start the polling before the batchbuffer starts
executing.
What I've got little / no clue how to is manage allocation of memory to
store the results in.
Should userspace (mesa?) be passing buffers for the kernel to return
profiling data? Then retrieving it somehow when it "knows" the
batchbuffer is finished? This will probably require over-allocation with
a guestimate of required memory space to log the given batch-buffer.
What about exporting via debugfs. Assuming the above code-fragment, we
could leave the last "frame" of polled data available, with the data
being overwritten when the next request to start logging comes in.
(That would perhaps require some kind of sequence number assigned if we
have multiple batches which come under the same request... or a separate
IOCTL to turn on / off logging).
Also.. I'm not sure how the locking would work if userspace is reading
out the debugfs file whilst another frame is being executed. (We'd
probably need a secondary logging buffer allocating in that case).
Thoughts?
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)
next reply other threads:[~2010-10-30 13:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-30 13:04 Peter Clifton [this message]
2010-11-09 17:15 ` Design of a GPU profiling debug interface Jesse Barnes
2010-11-09 22:27 ` Eric Anholt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288443851.21112.30.camel@pcjc2lap \
--to=pcjc2@cam.ac.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox