public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "wenji dot huang at oracle dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sources.redhat.com
Subject: [Bug translator/7053] automatic global printing of statistic needs to check @count>0
Date: Tue, 02 Dec 2008 03:36:00 -0000	[thread overview]
Message-ID: <20081202033528.31992.qmail@sourceware.org> (raw)
In-Reply-To: <20081125191945.7053.fche@redhat.com>


------- Additional Comments From wenji dot huang at oracle dot com  2008-12-02 03:35 -------
Created an attachment (id=3085)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3085&action=view)
patch for checking empty aggregate and adding default print

Add checking empty aggregate and default print where @count==0. It's not
necessary to check empty aggregate in Array case. The generated foreach 
can eliminate the possibly of printing empty aggregate.

Sample script:
$ sudo stap -ve 'global var; probe never{ var<<<2}' -p2
Pass 1: parsed user script and 47 library script(s) in 540usr/60sys/603real ms.

# globals
var:stats
# probes
never /* <- never */
(var) <<< (2)
end /* <- end */
{
if ((@count(var)) > (0)) printf("var @count=%#x @min=%#x @max=%#x @sum=%#x
@avg=%#x\\n", @count(var), @min(var), @max(var), @sum(var), @avg(var))
else printf("var @count=0x0\\n")

}
Pass 2: analyzed script: 2 probe(s), 0 function(s), 0 embed(s), 1 global(s) in
10usr/20sys/26real ms.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=7053

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

  parent reply	other threads:[~2008-12-02  3:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-25 19:20 [Bug translator/7053] New: " fche at redhat dot com
2008-11-27  4:47 ` [Bug translator/7053] " wenji dot huang at oracle dot com
2008-11-27 16:33 ` fche at redhat dot com
2008-12-02  3:36 ` wenji dot huang at oracle dot com [this message]
2008-12-02 19:20 ` fche at redhat dot com

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=20081202033528.31992.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.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).