* [Linux-ia64] differentiating single-step vs taken-branch trap
@ 2001-09-24 1:43 Weihaw Chuang
2001-09-24 14:46 ` n0ano
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Weihaw Chuang @ 2001-09-24 1:43 UTC (permalink / raw)
To: linux-ia64
Hi everyone,
I've got two questions, but only the first is really
important.
1. I'm using the ptrace kernel interface to trace a
child process via single-step or taken-branch traps
(through David Mosberger's utrace tool). Is there a
way I can use ptrace to allow me to single-step, and
in addition observe occurances of taken-branches?
It seems that its possible to set the PSR.SS and
PSR.TB concurrently, but not a way of differentiating
the returned trap signal. All we know upon returning
from wait is that a trap occured.
Although it seems redundant, as far as I know there is
a subtle difference between taken-branch traps and
single-step traps. Taken-branch traps return back an
IIP value of the branch target, before committing the
the results of the target instruction. Single-step
traps assign IIP of the committed instruction. The
difference is important if I want to look ahead to get
register state before a memory operation commits any
registers writes.
2. Is there still a ia64 linux kernel mailing list?
And is it archived somewhere?
Many thanks,
-Wei
==************************************************************
Weihaw Chuang
wchuang@cs.ucsd.edu
************************************************************
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Linux-ia64] differentiating single-step vs taken-branch trap
2001-09-24 1:43 [Linux-ia64] differentiating single-step vs taken-branch trap Weihaw Chuang
@ 2001-09-24 14:46 ` n0ano
2001-09-24 16:42 ` David Mosberger
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: n0ano @ 2001-09-24 14:46 UTC (permalink / raw)
To: linux-ia64
Weihaw-
1) I don't believe that `ptrace' distinguishes between
these two events. As far as `ptrace' is concerned you've
executed a single instruction, taken branch or not. It
shouldn't be too hard to infer whether a branch was taken
or not. If the current bundle is not 1 greater than the
last bundle then a branch was taken, otherwise a branch
was most probably not taken. This will miss a branch to
the next instruction (seems pretty silly code) or a branch
around the one or two instructions that could follow inside
the same bundle holding the branch. The two exception
cases are pretty rare and you could do some instruction
dis-assembly to catch them if you really care.
2) Go to `www.linuxia64.com' and follow the link to
`kernel developers list'. This will lead to the archive for
the mailing list. (You posted this message to the IA64 mailing
list so obviously the list still exists :-)
On Sun, Sep 23, 2001 at 06:43:18PM -0700, Weihaw Chuang wrote:
> Hi everyone,
> I've got two questions, but only the first is really
> important.
> 1. I'm using the ptrace kernel interface to trace a
> child process via single-step or taken-branch traps
> (through David Mosberger's utrace tool). Is there a
> way I can use ptrace to allow me to single-step, and
> in addition observe occurances of taken-branches?
>
> It seems that its possible to set the PSR.SS and
> PSR.TB concurrently, but not a way of differentiating
> the returned trap signal. All we know upon returning
> from wait is that a trap occured.
>
> Although it seems redundant, as far as I know there is
> a subtle difference between taken-branch traps and
> single-step traps. Taken-branch traps return back an
> IIP value of the branch target, before committing the
> the results of the target instruction. Single-step
> traps assign IIP of the committed instruction. The
> difference is important if I want to look ahead to get
> register state before a memory operation commits any
> registers writes.
>
> 2. Is there still a ia64 linux kernel mailing list?
> And is it archived somewhere?
>
> Many thanks,
> -Wei
>
> ==> ************************************************************
>
> Weihaw Chuang
> wchuang@cs.ucsd.edu
>
> ************************************************************
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com
>
> _______________________________________________
> Linux-IA64 mailing list
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linux-ia64
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
n0ano@indstorage.com
Ph: 303/652-0870x117
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Linux-ia64] differentiating single-step vs taken-branch trap
2001-09-24 1:43 [Linux-ia64] differentiating single-step vs taken-branch trap Weihaw Chuang
2001-09-24 14:46 ` n0ano
@ 2001-09-24 16:42 ` David Mosberger
2001-09-24 17:53 ` Weihaw Chuang
2001-09-24 18:03 ` David Mosberger
3 siblings, 0 replies; 5+ messages in thread
From: David Mosberger @ 2001-09-24 16:42 UTC (permalink / raw)
To: linux-ia64
Hi Wei,
>>>>> On Sun, 23 Sep 2001 18:43:18 -0700 (PDT), Weihaw Chuang <weihaw@yahoo.com> said:
Wei> Hi everyone, I've got two questions, but only the first is
Wei> really important. 1. I'm using the ptrace kernel interface to
Wei> trace a child process via single-step or taken-branch traps
Wei> (through David Mosberger's utrace tool). Is there a way I can
Wei> use ptrace to allow me to single-step, and in addition observe
Wei> occurances of taken-branches?
Yes, the siginfo trap code (si_code) will tell you. It is set to
TRAP_BRANCH for a taken branch and to TRAP_TRACE for a single step
trap. Use PTRACE_GETSIGINFO to get a hold of the siginfo of the
traced task.
--david
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Linux-ia64] differentiating single-step vs taken-branch trap
2001-09-24 1:43 [Linux-ia64] differentiating single-step vs taken-branch trap Weihaw Chuang
2001-09-24 14:46 ` n0ano
2001-09-24 16:42 ` David Mosberger
@ 2001-09-24 17:53 ` Weihaw Chuang
2001-09-24 18:03 ` David Mosberger
3 siblings, 0 replies; 5+ messages in thread
From: Weihaw Chuang @ 2001-09-24 17:53 UTC (permalink / raw)
To: linux-ia64
In which header file do I find the
declaration/definition of the PTRACE_GETSIGINFO (as
well as TRAP_TRACE, TRAP_BRANCH) ? I'm using a
machine with 2.4.0 kernel. Would this rather old
kernel be the reason why?
-Wei
--- David Mosberger <davidm@hpl.hp.com> wrote:
> Hi Wei,
>
> >>>>> On Sun, 23 Sep 2001 18:43:18 -0700 (PDT),
> Weihaw Chuang <weihaw@yahoo.com> said:
>
> Wei> Hi everyone, I've got two questions, but only
> the first is
> Wei> really important. 1. I'm using the ptrace
> kernel interface to
> Wei> trace a child process via single-step or
> taken-branch traps
> Wei> (through David Mosberger's utrace tool). Is
> there a way I can
> Wei> use ptrace to allow me to single-step, and in
> addition observe
> Wei> occurances of taken-branches?
>
> Yes, the siginfo trap code (si_code) will tell you.
> It is set to
> TRAP_BRANCH for a taken branch and to TRAP_TRACE for
> a single step
> trap. Use PTRACE_GETSIGINFO to get a hold of the
> siginfo of the
> traced task.
>
> --david
==************************************************************
Weihaw Chuang
wchuang@cs.ucsd.edu
************************************************************
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Linux-ia64] differentiating single-step vs taken-branch trap
2001-09-24 1:43 [Linux-ia64] differentiating single-step vs taken-branch trap Weihaw Chuang
` (2 preceding siblings ...)
2001-09-24 17:53 ` Weihaw Chuang
@ 2001-09-24 18:03 ` David Mosberger
3 siblings, 0 replies; 5+ messages in thread
From: David Mosberger @ 2001-09-24 18:03 UTC (permalink / raw)
To: linux-ia64
>>>>> On Mon, 24 Sep 2001 10:53:29 -0700 (PDT), Weihaw Chuang <weihaw@yahoo.com> said:
Wei> In which header file do I find the declaration/definition of
Wei> the PTRACE_GETSIGINFO (as well as TRAP_TRACE, TRAP_BRANCH) ?
Wei> I'm using a machine with 2.4.0 kernel. Would this rather old
Wei> kernel be the reason why?
It comes from <sys/ptrace.h>. If it's not there, you need to upgrade
your glibc. A newer kernel wouldn't hurt either, though...
--david
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-09-24 18:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-24 1:43 [Linux-ia64] differentiating single-step vs taken-branch trap Weihaw Chuang
2001-09-24 14:46 ` n0ano
2001-09-24 16:42 ` David Mosberger
2001-09-24 17:53 ` Weihaw Chuang
2001-09-24 18:03 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox