[Nouveau] kmmio dump log format

Pekka Paalanen pq at iki.fi
Thu Jun 28 07:10:27 PDT 2007


On Wed, 27 Jun 2007 14:25:58 -0400
"Phillip Ezolt" <phillipezolt at gmail.com> wrote:

> Pekka,
> 
> In your redesign of the binary dump format, could you add the ability
> to store multiple PCs per sample? (ie, so that I can do backtraces (4
> frames deep?) ) rather than just a single PC?

The new format will be packet based, so it will be extendable. Yes, we
can do this, I and Jeff just have to discuss how to do it exactly. And
Jeff seems to be very busy nowadays.

> About 3-4 months ago, I hacked some code for kmmio which would walk
> the stack and record the pc X frames above the current register
> access.  Since I didn't figure out how to record multiple PCs per
> sample, I hardcoded how far up the stack I would walk, and did
> multiple runs (while changing the frame by recompiling) to get 3
> frames deep.
> (run 1 => current PC )
> (run 2 => one frame up)
> (run 3 => two frames up)
> Etc.
> 
> I would then combine the runs by hand, and turn the addresses into
> frames by using '/proc/kallsyms'.  It was very useful info, but
> tedious..

Ouch.

> Since fglrx actually has useful symbols in the kernel module, I was
> able to determine the meaning of some of the register accesses by
> looking at the stack trace.  (It wasn't enough to just look at the PC,
> since it was in some generic 'do_mmio' function... I needed the frame
> above it.)   I would like to do this again for some of the other
> registers that I don't know the meaning of yet..

We can do it, I just hope you will not get any legal issues because of
doing it. I do not think Nouveau would ever use PC/stack recording, it
is a bit too deep into the gray area.

> BTW. I can send you the patch if you want, but it is very i386
> specific & (if I remember) it requires framepointers.

I would say that let's wait until the log format rework is done,
because it will inflict changes also to the kernel side. And to be
honest, I'd rather leave kernel stuff to other people. And my system is
64-bit.

-- 
Pekka "PQ" Paalanen
http://www.iki.fi/pq/


More information about the Nouveau mailing list