summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-09-06 10:09:26 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-09-06 10:09:26 -0400
commit1446b65dbd2d023a54675277f157ab661bc06474 (patch)
tree3e90f0718d3d3a18ac0a091e763f03c651b8f501
parenta80aa597e9d6fa3443a8f5a1c049422f909c85bb (diff)
parente071e49b06c2fe9e20c15ec3719cbaa60ae4afe1 (diff)
downloadsystemtap-steved-1446b65dbd2d023a54675277f157ab661bc06474.tar.gz
systemtap-steved-1446b65dbd2d023a54675277f157ab661bc06474.tar.xz
systemtap-steved-1446b65dbd2d023a54675277f157ab661bc06474.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
* 'master' of ssh://sources.redhat.com/git/systemtap: Handle scalar statistics.
-rw-r--r--ChangeLog4
-rw-r--r--elaborate.cxx33
-rw-r--r--testsuite/ChangeLog5
-rw-r--r--testsuite/systemtap.base/global_end.exp3
-rw-r--r--testsuite/systemtap.base/global_end.stp7
5 files changed, 42 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index ab8dd190..10a72cef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-09-05 Stan Cox <scox@redhat.com>
+
+ * elaborate.cxx (add_global_var_display): Handle scalar statistics.
+
2008-09-05 Frank Ch. Eigler <fche@elastic.org>
* configure.ac, Makefile.am, systemtap.spec: Don't look for libcap.
diff --git a/elaborate.cxx b/elaborate.cxx
index 44b6e24f..3dfc7183 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -1194,15 +1194,35 @@ void add_global_var_display (systemtap_session& s)
if (l->index_types.size() == 0) // Scalar
{
- 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";
- pf->args.push_back(g_sym);
pf->components = print_format::string_to_components(pf->raw_components);
expr_statement* feb = new expr_statement;
feb->value = pf;
feb->tok = print_tok;
+ if (l->type == pe_stats)
+ {
+ struct stat_op* so [5];
+ const stat_component_type stypes[] = {sc_count, sc_min, sc_max, sc_sum, sc_average};
+
+ for (unsigned si = 0;
+ si < (sizeof(so)/sizeof(struct stat_op*));
+ si++)
+ {
+ so[si]= new stat_op;
+ so[si]->ctype = stypes[si];
+ so[si]->type = pe_long;
+ so[si]->stat = g_sym;
+ so[si]->tok = l->tok;
+ pf->args.push_back(so[si]);
+ }
+ }
+ else
+ pf->args.push_back(g_sym);
b->statements.push_back(feb);
}
else // Array
@@ -1265,6 +1285,8 @@ void add_global_var_display (systemtap_session& s)
{
struct stat_op* so [5];
const stat_component_type stypes[] = {sc_count, sc_min, sc_max, sc_sum, sc_average};
+
+ ai->type = pe_stats;
for (unsigned si = 0;
si < (sizeof(so)/sizeof(struct stat_op*));
si++)
@@ -1274,13 +1296,8 @@ void add_global_var_display (systemtap_session& s)
so[si]->type = pe_long;
so[si]->stat = ai;
so[si]->tok = l->tok;
+ pf->args.push_back(so[si]);
}
-
- ai->type = pe_stats;
- for (unsigned si = 0;
- si < (sizeof(so)/sizeof(struct stat_op*));
- si++)
- pf->args.push_back(so[si]);
}
else
pf->args.push_back(ai);
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index ff907094..82435044 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-05 Stan Cox <scox@redhat.com>
+
+ * systemtap.base/global_end.stp: Also check scalar statistics.
+ * systemtap.base/global_end.exp: Likeewise.
+
2008-09-05 Frank Ch. Eigler <fche@elastic.org>
PR 4255.
diff --git a/testsuite/systemtap.base/global_end.exp b/testsuite/systemtap.base/global_end.exp
index d066cf9d..cd5c6f83 100644
--- a/testsuite/systemtap.base/global_end.exp
+++ b/testsuite/systemtap.base/global_end.exp
@@ -18,8 +18,9 @@ expect {
-re {iota."two".="twelve"} { incr ok; exp_continue }
-re {epsilon."one",1. @count=0x4 @min=0x1 @max=0x4 @sum=0xa @avg=0x2} { incr ok; exp_continue }
-re {epsilon."two",2. @count=0x4 @min=0xa @max=0x28 @sum=0x64 @avg=0x19} { incr ok; exp_continue }
+ -re {phi @count=0x4 @min=0x1 @max=0x4 @sum=0xa @avg=0x2} { incr ok; exp_continue }
timeout { fail "$test (timeout)" }
eof { }
}
wait
-if {$ok == 10} { pass "$test ($ok)" } { fail "$test ($ok)" }
+if {$ok == 11} { pass "$test ($ok)" } { fail "$test ($ok)" }
diff --git a/testsuite/systemtap.base/global_end.stp b/testsuite/systemtap.base/global_end.stp
index b26b7c03..876eac8c 100644
--- a/testsuite/systemtap.base/global_end.stp
+++ b/testsuite/systemtap.base/global_end.stp
@@ -1,4 +1,4 @@
-global alpha, beta, gamma, iota, epsilon
+global alpha, beta, gamma, iota, epsilon, phi
probe begin {
gamma = "abcdefghijklmnopqrstuvwxyz"
@@ -16,6 +16,11 @@ probe begin {
beta["two",1] = 3
beta["two",2] = 4
+ phi <<< 1
+ phi <<< 2
+ phi <<< 3
+ phi <<< 4
+
epsilon["one",1] <<< 1
epsilon["one",1] <<< 2
epsilon["one",1] <<< 3