diff options
author | Wenji Huang <wenji.huang@oracle.com> | 2009-10-14 10:26:03 +0800 |
---|---|---|
committer | Wenji Huang <wenji.huang@oracle.com> | 2009-10-14 10:26:03 +0800 |
commit | 8c41e846e74026844d4b3e43778e53160f7dc27c (patch) | |
tree | ba2daa7a5fef99d3275b1f47047fc5935fda32d5 /translate.cxx | |
parent | 6928ee0a21a1832c9845c125b0998d45b801af81 (diff) | |
parent | 1c1f1a255cd969934bb7ce1678f4a411337be6f9 (diff) | |
download | systemtap-steved-8c41e846e74026844d4b3e43778e53160f7dc27c.tar.gz systemtap-steved-8c41e846e74026844d4b3e43778e53160f7dc27c.tar.xz systemtap-steved-8c41e846e74026844d4b3e43778e53160f7dc27c.zip |
Merge branch 'master' of ssh://wenji@sources.redhat.com/git/systemtap
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/translate.cxx b/translate.cxx index 1278a8d5..bc5d6158 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4083,6 +4083,14 @@ c_tmpcounter::visit_print_format (print_format* e) arr->indexes[i]->visit(this); } } + + // And the result for sprint[ln](@hist_*) + if (!e->print_to_stream) + { + exp_type ty = pe_string; + tmpvar res = parent->gensym(ty); + res.declare(*parent); + } } else { @@ -4145,8 +4153,18 @@ c_unparser::visit_print_format (print_format* e) o->newline() << "c->last_stmt = " << lex_cast_qstring(*e->tok) << ";"; o->newline() << "goto out;"; o->newline(-1) << "} else"; - o->newline(1) << "_stp_stat_print_histogram (" << v->hist() << ", " << agg.value() << ");"; - o->indent(-1); + if (e->print_to_stream) + { + o->newline(1) << "_stp_stat_print_histogram (" << v->hist() << ", " << agg.value() << ");"; + o->indent(-1); + } + else + { + exp_type ty = pe_string; + tmpvar res = gensym (ty); + o->newline(1) << "_stp_stat_print_histogram_buf (" << res.value() << ", MAXSTRINGLEN, " << v->hist() << ", " << agg.value() << ");"; + o->newline(-1) << res.value() << ";"; + } } delete v; |