Re: [hatari-devel] Re: BM407 + symbols

[ Thread Index | Date Index | More Archives ]


On tiistai 09 huhtikuu 2013, Douglas Little wrote:
> > For subroutine call instructions that take an absolute address instead
> > of destination being specified indirectly (e.g. in register), that
> > would probably be very safe as absolute subroutine call to next
> > instruction would be really dumb.  :-)
> Exactly. It would need to be conditional via a register to make any
> sense. And TBH it's an assumption you could mandate in the profiler
> 'dont do this if you want sensible profiles'. :-)
> > I would assume that even for indirect destinations that is pretty safe.
> > I'd guess it rare for code to call subroutine on next instruction
> > before going to it by normal PC increment.  It might still happen
> > though, if one needs to do tail call to the same function multiple
> > times and wants to save one branch & rts instruction...
> Yes pretty much what I wrote above. I think its ok providing you document
> the limitation.

Besides discussing it here, profiler code has pretty verbose comments about
these kind of things and the DSP side stuff is pretty small, so I would
expect anybody wondering about this to look into profiler code... :-)

I've now fixed all the problems I found with BadMood profiling automation,
but before I commit them, I need to fix some stuff in post-processor
which affected by these changes.

Btw. there's still one issue in the callgraphs.

If an instruction preceeding a symbol did a subroutine call, like here:
p:0155  00000c         (04 cyc)  rts
p:0378  0f7130         (04 cyc)  jsgt p:$0130
p:0379  699b00         (02 cyc)  move y:$001b,r1

Caller information shows that processor got into (end_addwall) function
from an rts, and that's what is seen in callgraphs currently, both for

While it's technically true, logically the function was arrived from
preceeding instruction that did a subroutine call.  This can be a bit
confusing.  I'll look whether I can do something for that before posting
new callgraphs.

	- Eero

Mail converted by MHonArc 2.6.19+