[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Simulavr-devel] using simulavr for profiling
From: |
Theodore A. Roth |
Subject: |
Re: [Simulavr-devel] using simulavr for profiling |
Date: |
Sun, 16 Mar 2003 14:17:31 -0800 (PST) |
On 17 Mar 2003, Richard Barrington wrote:
:)Hi,
:)
:)Has there been any development toward getting simulavr to produce gprof
:)output? I think this would be a useful thing... Any thoughts on what
:)would be involved to make this happen?
I've never looked into it. I could be useful though.
As for making it happen, I'm not sure what that would entail.
The way I see it happening on a Linux/Unix system, is that the compiler
inserts extra calls into you code which hook into the gprof code. I'm not
sure if this is the right approach for simulavr.
I'm not sure how to approach this though. My first impression seems to be to
just hook into the call, rcall and return opcodes in simulavr. On each call
or rcall, log the current clock count and PC, on each return, look up the
log entry by where you are going to return to (i.e. the PC), then dump the
entry to a gprof formatted file.
This doesn't seem too difficult, but you will take a run-time speed hit by
implementing it. That's not too bad though, compared with the information
you will gain.
I'll have to add this to my todo list...
Ted Roth