linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Kumar Gala <kumar.gala@motorola.com>, linuxppc-dev@lists.linuxppc.org
Cc: gdb@sources.redhat.com, <dmj+@andrew.cmu.edu>,
	<ezannoni@cygnus.com>, <fsirl@kernel.crashing.org>,
	paulus@samba.org
Subject: Re: AltiVec register ptrace support
Date: Fri, 7 Dec 2001 15:23:02 -0700	[thread overview]
Message-ID: <1011207222302.ZM10835@ocotillo.lan> (raw)
In-Reply-To: Kumar Gala <kumar.gala@motorola.com> "AltiVec register ptrace support" (Dec  7,  2:57pm)


On Dec 7,  2:57pm, Kumar Gala wrote:

> I have two different patches to the ptrace mechanism to add support
> for AltiVec registers.
>
> linux-2.4.8-altivec-ptrace.patch:  Adds support similar to existing
> mechanisms to get/set registers via PEEK/POKE calls extending the FPU
> model.
>
> linux-2.4.16-altivec-ptrace.patch: Adds support for new ptrace commands
> that match sparc/x86 PTRACE_{GET,SET}*REGS.  These dump the full register
> state in a single call.
>
> Personally, I would like to see the PTRACE_{GET,SET}*REGS method adopted
> for 2.4.x.  RedHat is trying to push out some GDB changes for AltiVec that
> require closure on this matter.

I would like to better understand your reasons for preferring
PTRACE_{GET,SET}*REGS.  Is it just because that's what x86 does
or do you think that this mechanism improves GDB's performance?

My personal opinion is that GETREGS/SETREGS does not greatly enhance
performance.  Try running strace on gdb debugging itself on x86 and on
PPC and compare the number of PTRACE_PEEKUSR calls on PPC vs.
PTRACE_????  calls on x86.  (The ????  is printed because strace
doesn't know about the various PTRACE_{GET,SET}*REGS calls.) When I
tried it just a moment ago using gdb to debug itself and running to a
breakpoint set on main(), I saw _more_ PTRACE_???? calls on x86 than
PEEKUSR/POKUSR calls on PPC.  Now, I admit that my testing wasn't very
exhaustive, but even if the number of PEEKUSR/POKEUSR calls were
higher, I think you'd find that calls to PEEKTEXT (for prologue
analysis) would dominate.  I.e, the majority of the ptrace() traffic
is due to reading memory, not reading registers.

Furthermore, I think that introducing GETREGS/SETREGS will make
ppc-linux-nat.c (in the GDB sources) more complicated.  We'll need
compile time tests to check for the presence of GETREGS/SETREGS and
use these mechanisms if they exist.  If they don't, this code will
have to fall back to using the old PEEKUSR/POKEUSR mechanism.  Also,
it may be necessary to have runtime tests which attempt to use
GETREGS/SETREGS and fall back to using PEEKUSR/POKEUSR.  In order to
see just how messy it can get, take a look at i386-linux-nat.c.

For the reasons stated above, I prefer your PEEKUSR/POKEUSR patch.

Kevin

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2001-12-07 22:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-04 16:13 Changes to PPC Linux required for GCC 3.1 Corey Minyard
2001-12-04 16:16 ` David Edelsohn
2001-12-04 16:39   ` Corey Minyard
2001-12-05 12:55 ` Franz Sirl
2001-12-05 16:18   ` Corey Minyard
2001-12-05 17:37     ` Tom Rini
2001-12-05 17:50       ` Benjamin Herrenschmidt
2001-12-05 19:45         ` Tom Rini
2001-12-05 20:30           ` Franz Sirl
2001-12-07 13:01             ` Gabriel Paubert
2001-12-07 20:57               ` AltiVec register ptrace support Kumar Gala
2001-12-07 22:23                 ` Kevin Buettner [this message]
2001-12-07 22:34                   ` Daniel Jacobowitz
2001-12-14 18:52                     ` Kumar Gala
2001-12-14 19:16                       ` Jason R Thorpe
2001-12-15  2:08                       ` Andrew Cagney
2001-12-15 17:44                         ` Kumar Gala
2001-12-16 21:11                         ` Paul Mackerras
2002-01-10 18:58                           ` Kumar Gala
2001-12-05 21:59         ` Changes to PPC Linux required for GCC 3.1 Paul Mackerras
2001-12-05 20:17       ` Daniel Jacobowitz
2001-12-05 20:20         ` David Edelsohn
2001-12-05 20:30         ` Franz Sirl
2001-12-06  0:59       ` Corey Minyard
2001-12-06  3:38         ` Tom Rini
2001-12-07  5:22           ` Corey Minyard
2001-12-05 20:51     ` Franz Sirl
2001-12-06  1:41       ` Corey Minyard
  -- strict thread matches above, loose matches on Subject: below --
2001-03-06 16:03 who loads argc in elf binary??????? Alexandre Nikolaev
2001-03-07 19:10 ` Daniel Jacobowitz
2001-03-07 19:15   ` David Edelsohn

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=1011207222302.ZM10835@ocotillo.lan \
    --to=kevinb@redhat.com \
    --cc=dmj+@andrew.cmu.edu \
    --cc=ezannoni@cygnus.com \
    --cc=fsirl@kernel.crashing.org \
    --cc=gdb@sources.redhat.com \
    --cc=kumar.gala@motorola.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).