From: fche@redhat.com (Frank Ch. Eigler)
To: William Cohen <wcohen@redhat.com>
Cc: systemtap@sources.redhat.com
Subject: Re: Proposed systemtap access to perfmon hardware
Date: Wed, 15 Mar 2006 22:34:00 -0000 [thread overview]
Message-ID: <y0mmzfr9w2a.fsf@ton.toronto.redhat.com> (raw)
In-Reply-To: <44183FCF.6010809@redhat.com>
wcohen wrote:
> [...] I have written up material describing how I would think that
> systemtap could use the performance monitoring hardware. [...]
It would be helpful to see a hypothetical script that would use the
proposed API.
Anyway, beyond such script language design issues, the hard part has
been the provision of *some* kernel-side API in terms of which this
stuff can be implemented. How is that going?
> [...]
> perfmon_allocate_counter:long (event_spec:string)
> perfmon_free_counter:long (event_handle:long)
> perfmon_create_context:long ()
> probe kernel.perfmon.sample(event_handle:long) {/*body*/}
These sound rather like suitable lower level functions that the
translator could use under the covers, and not functions that are
wisely exposed at the script level.
Specifically, I would rather expose each particular event_spec source
as a first-class probe point construct:
# probe perfmon.sample("event_spec") { /* body */ }
This would entail calls to such alloc/free/create functions being
emitted in the probe (un)registration boilerplate. "event_spec"
could perhaps be expanded into several probe point components, and
result in a periodic run of the handler much like timer.ms(N):
# probe perfmon.counter("tlbmiss").cpu(0).sample(1000) { /* ... */ }
That seems to leave just free-running counter operations:
> perfmon_get_counter:long (event_handle:long)
> perfmon_start_counter:long (event_handle:long)
> perfmon_stop_counter:long (event_handle:long)
One possible way to cast these into the language, and yet retain
automatic initialization/cleanup, might be this:
# probe perfmon.counter("tlbmiss").cpu(0).run { h = $handle }
# probe ANY { perfmon_{get,start,stop}_counter (h) }
# global h
What this would do is to have that perfmon.* probe handler run just
once (during initialization), supplying the script with the
system-assigned handle for this counter. Then another probe (though
probably not a "begin" one) can use that handle value to manipulate
the counter.
- FChE
next prev parent reply other threads:[~2006-03-15 22:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-15 16:24 William Cohen
2006-03-15 22:34 ` Frank Ch. Eigler [this message]
2006-03-17 16:20 ` William Cohen
2006-03-17 17:10 ` Bill Rugolsky Jr.
2006-03-17 17:34 ` Frank Ch. Eigler
2006-03-17 20:26 ` William Cohen
2006-03-20 17:27 ` Frank Ch. Eigler
2006-03-22 3:34 ` Maynard Johnson
2006-03-22 18:02 ` William Cohen
2006-03-22 22:16 ` Maynard Johnson
2006-03-22 18:30 ` Frank Ch. Eigler
2006-03-22 19:09 Stone, Joshua I
2006-03-22 20:04 ` Frank Ch. Eigler
2006-03-22 23:23 Stone, Joshua I
2006-03-22 23:46 Stone, Joshua I
2006-03-23 12:54 ` Maynard Johnson
2006-03-23 14:46 ` William Cohen
2006-03-23 17:09 Stone, Joshua I
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=y0mmzfr9w2a.fsf@ton.toronto.redhat.com \
--to=fche@redhat.com \
--cc=systemtap@sources.redhat.com \
--cc=wcohen@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).