2 Dec 2008 04:35
[Bug translator/7053] automatic global printing of statistic needs to check <at> count>0
wenji dot huang at oracle dot com <sourceware-bugzilla <at> sourceware.org>
2008-12-02 03:35:28 GMT
2008-12-02 03:35:28 GMT
------- 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 <at> 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 (( <at> count(var)) > (0)) printf("var <at> count=%#x <at> min=%#x <at> max=%#x <at> sum=%#x <at> avg=%#x\\n", <at> count(var), <at> min(var), <at> max(var), <at> sum(var), <at> avg(var)) else printf("var <at> count=0x0\\n") } Pass 2: analyzed script: 2 probe(s), 0 function(s), 0 embed(s), 1 global(s) in 10usr/20sys/26real ms. -- --(Continue reading)
RSS Feed