public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* updated bootprobe
@ 2006-08-04 14:41 Bryn M. Reeves
  2006-08-04 15:58 ` Jose R. Santos
  0 siblings, 1 reply; 4+ messages in thread
From: Bryn M. Reeves @ 2006-08-04 14:41 UTC (permalink / raw)
  To: systemtap

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

Dan Berrange's bootprobe script provides a nice example of systemtap use
that Dan has kindly agreed can be used in examples, training materials etc.

I've made a slightly modified version to add a GPL header (with Dan's
permission!) and update the probepoints to use the new tapsets.

If anyone has any comments/corrections for this version, I'd be very
happy to receive them.

The original, along with the perl post-processing scripts are still
available here:

http://people.redhat.com/berrange/systemtap/bootprobe/

Thanks,

Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFE01yL6YSQoMYUY94RAtBlAKCWiqtBd/Sp9JSxyMjJ1+N+goMPAwCglwqD
bJ8a0GSytfqoZ6EYvPzPOac=
=9fu3
-----END PGP SIGNATURE-----

[-- Attachment #2: initprocs.stp --]
[-- Type: text/plain, Size: 1715 bytes --]

/*
 * Copyright (C) 2006 Daniel Berrange, Red Hat Inc.
 * 
 * This copyrighted material is made available to anyone wishing to use,
 * modify, copy, or redistribute it subject to the terms and conditions
 * of the GNU General Public License v.2.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
*/
global indent

function get_usertime:long() %{
  THIS->__retvalue = current->utime + current->signal->utime;
%}

function get_systime:long() %{
  THIS->__retvalue = current->stime + current->signal->stime;
%}

function timestamp:string() {
  return sprintf("%d %s", gettimeofday_ms(), indent[pid()])
}

function proc:string() {
  return sprintf("%d (%s)", pid(), execname())
}

function push(pid, ppid) {
  indent[pid] = indent[ppid] . "  "
}

function pop(pid) {
  delete indent[pid]
}

probe syscall.fork.return {
  print(timestamp() . proc() . " forks " . sprint(retval) . "\n")
  push(retval, pid())
}

probe syscall.execve {
  print(timestamp() . proc() . " execs " . kernel_string($filename) . "\n")
}

probe syscall.open {
  if ($flags & 1) {
    print(timestamp() . proc() . " writes " . user_string($filename) . "\n")
  } else {
    print(timestamp() . proc() . " reads " . user_string($filename) . "\n")
  }
} 

probe syscall.exit {
  print(timestamp() . proc() . " exit with user " . sprint(get_usertime()) .
	" sys " . sprint(get_systime()) . "\n")
  pop(pid())
}

probe timer.jiffies(100) {
  if (pid() != 0) {
    print(timestamp() . proc() . " tick with user " . sprint(get_usertime()) .
	" sys " . sprint(get_systime()) . "\n")
  }
}


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: updated bootprobe
  2006-08-04 14:41 updated bootprobe Bryn M. Reeves
@ 2006-08-04 15:58 ` Jose R. Santos
  2006-08-04 16:08   ` Bryn M. Reeves
  2006-08-04 16:11   ` Daniel P. Berrange
  0 siblings, 2 replies; 4+ messages in thread
From: Jose R. Santos @ 2006-08-04 15:58 UTC (permalink / raw)
  To: Bryn M. Reeves; +Cc: systemtap

Bryn M. Reeves wrote:
> Hi all,
>
> Dan Berrange's bootprobe script provides a nice example of systemtap use
> that Dan has kindly agreed can be used in examples, training materials 
> etc.
>
> I've made a slightly modified version to add a GPL header (with Dan's
> permission!) and update the probepoints to use the new tapsets.
>
> If anyone has any comments/corrections for this version, I'd be very
> happy to receive them.
>
> The original, along with the perl post-processing scripts are still
> available here:
>
> http://people.redhat.com/berrange/systemtap/bootprobe/
>
> Thanks,
>
> Bryn.
Hy Bryn,

This looks like a systemcall and fork/exec trace.  Wouldn't it make 
sense to use the tracing facility already available in SystemTap and 
porting the Perl post-processing script to use that instead of rolling 
your own trace format?  I would love to have post-processing scripts 
that do the same thing for the SystemTap trace facility.

Please take a look at "man lket"

Here is the an example of a script that should be able to gather the 
information needed for generating the data that your post-processing 
creates.

====================
#! stap
process_snapshot() {}
addevent.tskdispatch.cpuidle {}
addevent.process {}
addevent.syscall.entry { printf ("%4b", $flags) }
addevent.syscall.exit {}
addevent.tskdispatch.cpuidle {}

=====================

-JRS

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: updated bootprobe
  2006-08-04 15:58 ` Jose R. Santos
@ 2006-08-04 16:08   ` Bryn M. Reeves
  2006-08-04 16:11   ` Daniel P. Berrange
  1 sibling, 0 replies; 4+ messages in thread
From: Bryn M. Reeves @ 2006-08-04 16:08 UTC (permalink / raw)
  To: jrs; +Cc: systemtap

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jose R. Santos wrote:
> Hy Bryn,
> 
> This looks like a systemcall and fork/exec trace.  Wouldn't it make

Hi Jose,

Yes - that's basically what the script does now. I was thinking of
extending it a bit to add some IO statistics, but that should still be
possible with the changes you suggest.

> sense to use the tracing facility already available in SystemTap and
> porting the Perl post-processing script to use that instead of rolling
> your own trace format?  I would love to have post-processing scripts
> that do the same thing for the SystemTap trace facility.

Many thanks for the pointer - I've only spent a very brief time looking
at LKET so far, and I agree that this is likely a better approach to
this problem.

I still think Dan's script has some didactic value as-is, but I will
definitely have a go at extending your example below to make more use of
stap & lket's own reporting abilities.

Kind regards,

Bryn.

> Please take a look at "man lket"
> 
> Here is the an example of a script that should be able to gather the
> information needed for generating the data that your post-processing
> creates.
> 
> ====================
> #! stap
> process_snapshot() {}
> addevent.tskdispatch.cpuidle {}
> addevent.process {}
> addevent.syscall.entry { printf ("%4b", $flags) }
> addevent.syscall.exit {}
> addevent.tskdispatch.cpuidle {}
> 
> =====================
> 
> -JRS

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFE03D66YSQoMYUY94RApSBAKCfVvV9zfprm4GDuC1BYq9h81/15wCfW7g3
LXB8NdUeCJw+agznUOtN+GM=
=GHwI
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: updated bootprobe
  2006-08-04 15:58 ` Jose R. Santos
  2006-08-04 16:08   ` Bryn M. Reeves
@ 2006-08-04 16:11   ` Daniel P. Berrange
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2006-08-04 16:11 UTC (permalink / raw)
  To: Jose R. Santos; +Cc: Bryn M. Reeves, systemtap

On Fri, Aug 04, 2006 at 11:03:52AM -0500, Jose R. Santos wrote:
> Bryn M. Reeves wrote:
> >Hi all,
> >
> >Dan Berrange's bootprobe script provides a nice example of systemtap use
> >that Dan has kindly agreed can be used in examples, training materials 
> >etc.
> >
> >I've made a slightly modified version to add a GPL header (with Dan's
> >permission!) and update the probepoints to use the new tapsets.
> >
> >If anyone has any comments/corrections for this version, I'd be very
> >happy to receive them.
> >
> >The original, along with the perl post-processing scripts are still
> >available here:
> >
> >http://people.redhat.com/berrange/systemtap/bootprobe/
> >
> 
> This looks like a systemcall and fork/exec trace.  Wouldn't it make 
> sense to use the tracing facility already available in SystemTap and 
> porting the Perl post-processing script to use that instead of rolling 
> your own trace format?  I would love to have post-processing scripts 
> that do the same thing for the SystemTap trace facility.
> 
> Please take a look at "man lket"

Yes, I wrote this initial script quite a while ago now before the lket
stuff existed in systemtap. It would certainly make sense to leverage
this now that it exists & update the post-processing tools accordingly

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-08-04 16:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-04 14:41 updated bootprobe Bryn M. Reeves
2006-08-04 15:58 ` Jose R. Santos
2006-08-04 16:08   ` Bryn M. Reeves
2006-08-04 16:11   ` Daniel P. Berrange

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).