linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karim Yaghmour <karim@opersys.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	LTT-Dev <ltt-dev@shafik.org>,
	Linus Torvalds <torvalds@transmeta.com>
Subject: Re: [PATCH] LTT for 2.5.38 1/9: Core infrastructure
Date: Sun, 22 Sep 2002 15:06:30 -0400	[thread overview]
Message-ID: <3D8E14B6.F98A86E4@opersys.com> (raw)
In-Reply-To: Pine.LNX.4.44.0209221222060.21475-100000@localhost.localdomain


Hello Ingo,

Thanks for taking the time to look at this.

Ingo Molnar wrote:
> my problem with this stuff is conceptual: it introduces a constant drag on
> the kernel sourcecode, while 99% of development will not want to trace,
> ever.

It seems my description was misleading. So here's the skinny: LTT's main
purpose is to enable users and developers to observe the system's dynamics
in order to retrieve exact information regarding the behavior of the
entire system WITHOUT modifying the system's behavior or degrading the
system's performance. In turn, this can be used for identifying
synchronization and performance problems. In doing so, however, the services
implemented by LTT in the kernel happen to be quite useful to many other
kernel subsystems and device drivers since they too occasionnally need
tracing.

Here are some actual practical cases:
- How do you debug process synchronization problems in user-space? You
can't use anything that calls on ptrace() since it modifies the
processes' behavior and you can't use printf's for anything the least
bit complicated. The only way you can do this is if you use a tracing
tool such as LTT that enables you to see which services were called,
what happened as a consequence of the processes' requests, and where
the synchronization failed.
- How do you measure the exact time processes spend in kernel space,
identify why they spend it there, which processes they had to wait
for, etc.?
- How do you measure the exact time it takes for an interrupt's
effects to propagate through the entire system?  As a simple example, say
you want to follow the exact sequence of processes that run from the
moment you press a key on the keyboard until a character shows up in
the command terminal in X. LTT will shows this quite easily.
- Take tools like oprofile and syscalltrack which need the same
information available through the trace points added by LTT. Instead
of diverting the system call table, as they currently do, they could
retrieve the information they need easily from LTT without using
clean interfaces and no table redirection.
- Say you have thousands of servers in an installation and one of them
has some sporadic problem. How are you going to debug this sytem?
Should the sysadmin be expected to download the kernel's source, patch
it for tracing and restart the system to find the problem? Rather,
wouldn't it be simpler if he could run the tracing in the background
for the time until the problem occurs and then look at the trace to
see what's the real problem before digging deeper?
- etc.

Do I think that the kernel should be instrumented in a way that it is
"a constant drag on the kernel sourcecode"? No. This is why the trace points
inserted really have more to do with the way a classic Unix kernel is
structured (system calls, process switching, forks, execs, ...) than
anything peculiar to Linux's source code. Hence, you could reimplement
the entire Linux source an entirely different way, you would still find
those very same events taking place. Also, all these trace points result
in zero code if the kernel is compilled without tracing support.

For adding additional trace points wherever you want, you can use
kernel probes to add them dynamically (kprobes already interfaces with
LTT and is slated to go in 2.5) or you can use the custom even API
available from LTT to create your own events and logging them as
part of the trace.

In brief, no LTT isn't a kernel debugging tool, but yes its integration
into the kernel would certainly help subsystems that do need this sort
of service.

Karim

===================================================
                 Karim Yaghmour
               karim@opersys.com
      Embedded and Real-Time Linux Expert
===================================================

  parent reply	other threads:[~2002-09-22 18:58 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-22  5:43 [PATCH] LTT for 2.5.38 1/9: Core infrastructure Karim Yaghmour
2002-09-22 10:42 ` Ingo Molnar
2002-09-22 10:50   ` Ingo Molnar
2002-09-22 17:26   ` Roman Zippel
2002-09-22 18:35     ` Linus Torvalds
2002-09-22 19:18       ` Karim Yaghmour
2002-09-22 19:40         ` Ingo Molnar
2002-09-22 22:09           ` Karim Yaghmour
2002-09-22 22:24             ` Ingo Molnar
2002-09-22 22:41               ` Karim Yaghmour
2002-09-22 22:59                 ` Ingo Molnar
2002-09-22 22:50             ` Ingo Molnar
2002-09-22 23:32               ` Karim Yaghmour
2002-09-23  7:41                 ` Ingo Molnar
2002-09-23 15:12                   ` Karim Yaghmour
2002-09-23 20:11                     ` Andreas Ferber
2002-09-23 23:31                       ` Karim Yaghmour
2002-09-22 21:29       ` [ltt-dev] " bob
2002-09-22 19:06   ` Karim Yaghmour [this message]
2002-09-22 19:33     ` Karim Yaghmour
2002-09-22 21:20   ` [ltt-dev] " bob
2002-09-22 21:39     ` Ingo Molnar
2002-09-22 22:37       ` bob
2002-09-22 22:55         ` Ingo Molnar
2002-09-22 22:52           ` bob
2002-09-22 23:02             ` Ingo Molnar
2002-09-22 23:03               ` bob
2002-09-22 23:19                 ` Ingo Molnar
2002-09-22 23:50                   ` bob
2002-09-22 23:32             ` Ingo Molnar
2002-09-23  0:07               ` bob
2002-09-23  7:27                 ` Ingo Molnar
2002-09-23 13:59                   ` bob
2002-09-23  0:08               ` Karim Yaghmour
2002-09-22 22:58         ` Karim Yaghmour
     [not found] <Pine.LNX.4.44.0209221830400.8911-100000@serv.suse.lists.linux.kernel>
     [not found] ` <Pine.LNX.4.44.0209221130060.1455-100000@home.transmeta.com.suse.lists.linux.kernel>
2002-09-22 19:27   ` Andi Kleen
2002-09-24  1:07     ` john slee
2002-09-24 11:40       ` Andi Kleen

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=3D8E14B6.F98A86E4@opersys.com \
    --to=karim@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltt-dev@shafik.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@transmeta.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;
as well as URLs for NNTP newsgroup(s).