From: William Cohen <wcohen@redhat.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: systemtap@sourceware.org
Subject: Re: [PATCH] Add the stopwatch.stp tapset
Date: Mon, 30 Jan 2012 17:53:00 -0000 [thread overview]
Message-ID: <4F26D901.6060403@redhat.com> (raw)
In-Reply-To: <y0m7h0e55cf.fsf@fche.csb>
On 01/26/2012 07:58 PM, Frank Ch. Eigler wrote:
> William Cohen <wcohen@redhat.com> writes:
>
>> The stopwatch.stp tapset provides multiple, independent timers to user
>> scripts. Stopwatches can be created by the user script at
>> anytime. [...]
>
> Might you consider a somewhat simpler API?
>
> function start_stopwatch (name:string) { }
> function stop_stopwatch (name:string) { }
> function read_stopwatch_ns:long (name:string) { }
> function read_stopwatch_us:long (name:string) { }
> function read_stopwatch_ms:long (name:string) { }
> function read_stopwatch_s:long (name:string) { }
>
> i.e., no explicit create (the tapset can create it on first encounter
> of a new name), no enums (encode start/stop as distinct functions),
> and explicit reader functions.
>
> - FChE
Hi Frank,
One thing missing from the simpler API is a way to clean things up. If a script has many stopwatches of limited lifetime, it would be possible for the stopwatch tapset to cause the associative arrays to fill up. There needs to be a:
function delete_stopwatch (name:string) {}
probably should have matching optional that can be explicitly called if desired:
function create_stopwatch (name:string) {}
Going through and trying to code up this API this afternoon.
-Will
next prev parent reply other threads:[~2012-01-30 17:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 20:37 William Cohen
2012-01-27 0:58 ` Frank Ch. Eigler
2012-01-30 17:53 ` William Cohen [this message]
2012-01-30 18:13 ` 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=4F26D901.6060403@redhat.com \
--to=wcohen@redhat.com \
--cc=fche@redhat.com \
--cc=systemtap@sourceware.org \
/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).