public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@redhat.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org,
	utrace-devel <utrace-devel@redhat.com>,
	Roland McGrath <roland@redhat.com>,
	Jim Keniston <jkenisto@us.ibm.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Subject: Re: [RFC] [PATCH] In-kernel gdbstub based on utrace Infrastructure.
Date: Tue, 8 Dec 2009 16:58:29 -0500	[thread overview]
Message-ID: <20091208215829.GA19793@redhat.com> (raw)
In-Reply-To: <20091201211518.GA32376@elte.hu>

Hi -


> > Help me out here: by "kgdb extension" do you imagine "something new 
> > that an unprivileged user can use to debug his own process"?  Or do 
> > you imagine a new userspace facility that single-steps the kernel?
> 
> Is this a trick question? Single-stepping the kernel on the same system 
> [especially if it's an UP system] would certainly be a challenge ;-)
> 
> What i mean is what i said: if you provide a new framework (especially 
> if it's user visible - which both kgdb and the gdb stub is) you should 
> either fully replace existing functionality or extend it. Overlapping it 
> in an incomplete way is not useful to anyone.

But there is no "overlap" beyond the name.  The functional scope of
the two interfaces is totally non-overlapping, and are consistent with
the current chasms between kernel- and user-side debugging.

Sure, in the future, it may make sense to teach the kernel-side (kgdb
serial console) interface to manipulate userspace.  But that will
require a gdb extension.  And it would not satisfy an unprivileged
user's need to debug pure userspace (in a better way than current
ptrace can).

This is why I keep asking for specificity as to this "new framework"
you imagine.  Just sharing definitions such as kgdb_arch/kgdb_io but
otherwise completely disconnected (separate channels)?


> Extending kgdb to allow the use of it as if we used gdb locally would 
> certainly be interesting - and then you could drop into the kernel 
> anytime as well.

(Is this a restatement of the "trick question" idea?)


> > > We dont want to separate facilities for the same conceptual thing:
> > > examining application state (be that in user-space and
> > > kernel-space).

> > This seems like a shallow sort of consistency.  kgdb was added after 
> > ptrace existed -- why not extend ptrace instead to target the kernel? 
> > After all, it's "examining application state".  The answer is that it 
> > doesn't make a heck of a lot of sense.
> 
> kgdb simply used gdb's preferred way of remote debugging. That's 
> certainly the ugliest bit of it btw - but it's an externality to kgdb.
> Had it extended ptrace it wouldnt have gdb compatibility.

So, because of a constraint for gdb compatibility, you built a
separate interface for kgdb vs.  ptrace.  Fine.  Do you accept that,
even if a hypothetical single channel existed for which kernel- and
user-space debugging could occur, current gdb is not compatible with
this?  So by your own reasoning, such a facility should not be
mandated as a "necessary first step".


> [...]  perf replaces oprofile functionally.

(I'm told that it's not a strict superset from a functional point of
view, FWIW, something about a larger selection of low level hardware
counters.)

> If the in-kernel gdb stub replaced kgdb functionally you'd hear no
> complaints from me.

Let's leave it as an idea for the future.


- FChE

  reply	other threads:[~2009-12-08 22:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30 12:03 [RFC] [PATCH] In-kernel gdbstub based on utrace Infrastructure Srikar Dronamraju
2009-11-30 12:09 ` Peter Zijlstra
2009-11-30 12:32   ` Srikar Dronamraju
2009-11-30 12:41     ` Peter Zijlstra
2009-11-30 13:19       ` Srikar Dronamraju
2009-11-30 13:37         ` Peter Zijlstra
2009-11-30 14:05           ` Srikar Dronamraju
2009-11-30 15:03           ` Frank Ch. Eigler
2009-11-30 15:11             ` Peter Zijlstra
2009-11-30 15:16             ` Ingo Molnar
2009-11-30 15:29               ` Frank Ch. Eigler
2009-12-01 16:11                 ` Ingo Molnar
2009-12-01 17:00                   ` Frank Ch. Eigler
2009-12-01 17:09                     ` Ingo Molnar
2009-12-01 17:45                       ` Frank Ch. Eigler
2009-12-01 21:15                         ` Ingo Molnar
2009-12-08 21:58                           ` Frank Ch. Eigler [this message]
2009-12-10  7:41                             ` Ingo Molnar
2009-12-10 15:08                               ` Frank Ch. Eigler
2009-12-10 18:16                                 ` Ingo Molnar
2009-12-11  1:27                                   ` Frank Ch. Eigler

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=20091208215829.GA19793@redhat.com \
    --to=fche@redhat.com \
    --cc=ananth@in.ibm.com \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=utrace-devel@redhat.com \
    /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