public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: ltt-dev@shafik.org, Systemtap List <systemtap@sources.redhat.com>
Subject: Re: patches to actually use markers?
Date: Tue, 20 Nov 2007 16:50:00 -0000	[thread overview]
Message-ID: <20071120164951.GA31044@Krystal> (raw)
In-Reply-To: <20071116223344.GG25326@redhat.com>

* Frank Ch. Eigler (fche@redhat.com) wrote:
> Hi -
> 
> On Fri, Nov 16, 2007 at 05:03:14PM -0500, Mathieu Desnoyers wrote:
> > [...]
> > We currently have three distinct events for a system call :
> > 
> > syscall entry, with syscall id and instruction pointer
> > the syscall specific instrumentation (opt)
> > syscall exit
> 
> > [...]  Instrumentation within the syscall specific function helps
> > knowing when/if the operation has really been done _within the
> > kernel_. [...]
> 
> Not just that - but *what* the actual operation was.
> 

One could argue that by saving the syscall parameters, we could probably
remove some internal kernel instrumentation because it would duplicate
the information.

> > [...] Given these two opposite sets of constraints, I think having
> > more than one instrumentation site per syscall makes sense.
> 
> Sure - what bothers me is the satisfaction with the inconsistency of
> some system calls having no specific markers.
> 

I don't see much difference between the two approaches : if you create
a syscall audit-like probe module, you will have to deal with each
architecture and describe each system externally. Therefore, there is a
per system call / per architecture action required from the developers.
On the other hand, if we instrument the functions called by these system
calls, which are often in architecture independent code, we only have to
add instrumentation for each system call, (removing the "per
architecture" multiplicator).

We also come back to the distinction between maintaining a list of
system calls outside the actual kernel code base, making it harder to
follow the code flow, vs adding the instrumentation directly in the
kernel code.

Even if the probes are packaged with the kernel, adding a new system
call will require to go change yet another list that would keep track of
the system calls for each architecture.

> > Moreover, markers are really cheap... :)
> 
> I'm not the one who must buy what we're selling - it's the kernel
> maintainers. :-)
> 
> > [...]  Yes, refcount would be the way to go. The code is currently
> > in kernel/sched.c, since it touches the threads. I would have to add
> > the refcount. It will be in the next LTTng prerelease.
> 
> But you see, if markers are not just really cheap but really really
> cheap, then you don't need the task flag, nor the new API for
> refcounting the flags' clients, nor the new machinery to propagate the
> flag to new tasks.  You just put unconditional markers in there and
> let the possible multiple marker handlers do their own filtering.
> 

In per-architecture _assembly_ code ??

Note that the markers are C macros. We put them in syscall_trace, which
is a C callback made exactly for this kind of purpose. However, there is
a performance penality involved in setting up the stack and calling this
function, so we have to control wether or not it should be called. We
are not even talking about marker code there.

Mathieu

> 
> - FChE

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

  reply	other threads:[~2007-11-20 16:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29 19:26 David Smith
2007-10-29 22:05 ` Mathieu Desnoyers
2007-10-31 16:29   ` David Smith
2007-10-31 16:58     ` Mathieu Desnoyers
2007-10-31 18:12       ` Mathieu Desnoyers
2007-11-01  3:34         ` Mathieu Desnoyers
2007-11-16 19:13     ` David Smith
2007-11-16 19:24       ` Mathieu Desnoyers
2007-11-16 19:56         ` Frank Ch. Eigler
2007-11-16 20:10           ` Mathieu Desnoyers
2007-11-16 20:27             ` Frank Ch. Eigler
2007-11-16 20:35               ` Mathieu Desnoyers
2007-11-16 20:43                 ` Frank Ch. Eigler
2007-11-16 22:03                   ` Mathieu Desnoyers
2007-11-16 22:35                     ` Frank Ch. Eigler
2007-11-20 16:50                       ` Mathieu Desnoyers [this message]
2007-11-20 15:22         ` David Smith
2007-11-20 16:22           ` [Ltt-dev] " Mathieu Desnoyers
2007-11-20 20:43             ` David Smith
2007-11-20 18:46           ` Mathieu Desnoyers

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=20071120164951.GA31044@Krystal \
    --to=mathieu.desnoyers@polymtl.ca \
    --cc=fche@redhat.com \
    --cc=ltt-dev@shafik.org \
    --cc=systemtap@sources.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).