summaryrefslogtreecommitdiffstats
path: root/elaborate.cxx
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-09-02 10:30:27 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-09-02 10:30:27 -0400
commitcd79792f037f23d9636ab9b4097af11d0aa26aea (patch)
tree38da0ddeab7cc0b0d332894b0a634338f2cd3ca9 /elaborate.cxx
parente070cc9c2f207bdaac1f3ca2c0ac4e291185bff1 (diff)
parenteebd7e0f235484ae0a6857fa41bda5dd61a2de68 (diff)
downloadsystemtap-steved-cd79792f037f23d9636ab9b4097af11d0aa26aea.tar.gz
systemtap-steved-cd79792f037f23d9636ab9b4097af11d0aa26aea.tar.xz
systemtap-steved-cd79792f037f23d9636ab9b4097af11d0aa26aea.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
* 'master' of ssh://sources.redhat.com/git/systemtap: Fix semantic error caused by -P option in nodwarf testing. revised for new publican build update added all else Display written but unread global statistics.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r--elaborate.cxx35
1 files changed, 31 insertions, 4 deletions
diff --git a/elaborate.cxx b/elaborate.cxx
index 7ecba049..cfbe1392 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -1160,8 +1160,7 @@ void add_global_var_display (systemtap_session& s)
{
vardecl* l = s.globals[g];
if (vut.read.find (l) != vut.read.end()
- || vut.written.find (l) == vut.written.end()
- || l->type == pe_stats)
+ || vut.written.find (l) == vut.written.end())
continue;
print_format* pf = new print_format;
@@ -1255,7 +1254,9 @@ void add_global_var_display (systemtap_session& s)
pf->raw_components += "%#d";
}
pf->raw_components += "]";
- if (l->type == pe_string)
+ if (l->type == pe_stats)
+ pf->raw_components += " @count=%#x @min=%#x @max=%#x @sum=%#x @avg=%#x\\n";
+ else if (l->type == pe_string)
pf->raw_components += "=\"%#s\"\\n";
else
pf->raw_components += "=%#x\\n";
@@ -1264,12 +1265,38 @@ void add_global_var_display (systemtap_session& s)
struct arrayindex* ai = new arrayindex;
ai->tok = l->tok;
ai->base = g_sym;
+
for (int i=0; i < idx_count; i++)
{
ai->indexes.push_back (idx_sym[i]);
pf->args.push_back(idx_sym[i]);
}
- pf->args.push_back(ai);
+ if (l->type == pe_stats)
+ {
+ struct stat_op* so [5];
+ token* so_tok [5];
+
+ for (unsigned sti = 0; sti < (sizeof(so_tok)/sizeof(token*)); sti++)
+ {
+ so_tok[sti] = new token;
+ so_tok[sti]->type = tok_identifier;
+ }
+ const stat_component_type stypes[] = {sc_count, sc_min, sc_max, sc_sum, sc_average};
+ for (unsigned si = 0; si < (sizeof(so_tok)/sizeof(token*)); si++)
+ {
+ so[si]= new stat_op;
+ so[si]->ctype = stypes[si];
+ so[si]->type = pe_long;
+ so[si]->stat = ai;
+ so[si]->tok = so_tok[si];
+ }
+
+ ai->type = pe_stats;
+ for (unsigned si = 0; si < (sizeof(so_tok)/sizeof(token*)); si++)
+ pf->args.push_back(so[si]);
+ }
+ else
+ pf->args.push_back(ai);
pf->components = print_format::string_to_components(pf->raw_components);
expr_statement* feb = new expr_statement;