* [Bug translator/7053] New: automatic global printing of statistic needs to check @count>0
@ 2008-11-25 19:20 fche at redhat dot com
2008-11-27 4:47 ` [Bug translator/7053] " wenji dot huang at oracle dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: fche at redhat dot com @ 2008-11-25 19:20 UTC (permalink / raw)
To: systemtap
probe never {p <<< 1} global p
results in
ERROR: empty aggregate near identifier 'p' at <input>:1:28
but should result in
p @count=0x0
--
Summary: automatic global printing of statistic needs to check
@count>0
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: translator
AssignedTo: systemtap at sources dot redhat dot com
ReportedBy: fche at redhat dot com
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug translator/7053] automatic global printing of statistic needs to check @count>0
2008-11-25 19:20 [Bug translator/7053] New: automatic global printing of statistic needs to check @count>0 fche at redhat dot com
@ 2008-11-27 4:47 ` wenji dot huang at oracle dot com
2008-11-27 16:33 ` fche at redhat dot com
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: wenji dot huang at oracle dot com @ 2008-11-27 4:47 UTC (permalink / raw)
To: systemtap
------- Additional Comments From wenji dot huang at oracle dot com 2008-11-27 04:46 -------
The related code in tranlate.cxx
// PR 2142+2610: empty aggregates
3757 o->newline() << "if (unlikely (" << agg.value() << " == NULL)"
3758 << " || " << agg.value() << "->count == 0) {";
3759 o->newline(1) << "c->last_error = \"empty aggregate\";";
3760 o->newline() << "goto out;";
I can't reproduce 2142 and 2610 when such code is commented. Then
sensible result will be printed in the test case. Maybe some
improvements on global were added since that commit.
Guess we can weaken the checking of empty aggregrate.
--
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug translator/7053] automatic global printing of statistic needs to check @count>0
2008-11-25 19:20 [Bug translator/7053] New: automatic global printing of statistic needs to check @count>0 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
2008-12-02 19:20 ` fche at redhat dot com
3 siblings, 0 replies; 5+ messages in thread
From: fche at redhat dot com @ 2008-11-27 16:33 UTC (permalink / raw)
To: systemtap
------- Additional Comments From fche at redhat dot com 2008-11-27 16:32 -------
If we wish to keep the status quo that @operators on empty aggregates are
erroneous, then the code to change for this bug would be elaborate.cxx's
synthesis of the printf (" @count=....@avg=..."), to fork it into one
case where @count=0 and is printed alone, and another one where @count>1
and the other @values are printed.
--
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug translator/7053] automatic global printing of statistic needs to check @count>0
2008-11-25 19:20 [Bug translator/7053] New: automatic global printing of statistic needs to check @count>0 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
2008-12-02 19:20 ` fche at redhat dot com
3 siblings, 0 replies; 5+ messages in thread
From: wenji dot huang at oracle dot com @ 2008-12-02 3:36 UTC (permalink / raw)
To: systemtap
------- 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug translator/7053] automatic global printing of statistic needs to check @count>0
2008-11-25 19:20 [Bug translator/7053] New: automatic global printing of statistic needs to check @count>0 fche at redhat dot com
` (2 preceding siblings ...)
2008-12-02 3:36 ` wenji dot huang at oracle dot com
@ 2008-12-02 19:20 ` fche at redhat dot com
3 siblings, 0 replies; 5+ messages in thread
From: fche at redhat dot com @ 2008-12-02 19:20 UTC (permalink / raw)
To: systemtap
------- Additional Comments From fche at redhat dot com 2008-12-02 19:17 -------
Nice work, plase commit with a test case.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|systemtap at sources dot |wenji dot huang at oracle
|redhat dot com |dot com
Status|NEW |ASSIGNED
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-12-02 19:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-25 19:20 [Bug translator/7053] New: automatic global printing of statistic needs to check @count>0 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
2008-12-02 19:20 ` fche at redhat dot com
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).