diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2016-11-28 08:44:04 +0100 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2016-12-08 13:45:09 +0100 |
commit | 150a0cc8fe1936002af136e5552ef6cdd210956f (patch) | |
tree | 5d06c3c87ee8211cde36fa655e581ad272d3c3f6 | |
parent | 9676b464dd428557ff5a648e1351a3972440396f (diff) | |
download | sssd-150a0cc8fe1936002af136e5552ef6cdd210956f.tar.gz sssd-150a0cc8fe1936002af136e5552ef6cdd210956f.tar.xz sssd-150a0cc8fe1936002af136e5552ef6cdd210956f.zip |
STAP: Only print transaction statistics if the script caught some transactions
If the script measured an 'id' run from the cache, there would be no
transactions and dereferencing the aggrefate would throw an error.
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
-rw-r--r-- | contrib/systemtap/id_perf.stp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/systemtap/id_perf.stp b/contrib/systemtap/id_perf.stp index 0ad619506..a7789750f 100644 --- a/contrib/systemtap/id_perf.stp +++ b/contrib/systemtap/id_perf.stp @@ -64,8 +64,10 @@ function print_report() } } - printf("The most expensive transaction breakdown, per transaction:\n") - print(@hist_linear(bts[max_trans_time_bt], 0, 500, 50)) + if (max_trans_time > 0) { + printf("The most expensive transaction breakdown, per transaction:\n") + print(@hist_linear(bts[max_trans_time_bt], 0, 500, 50)) + } } probe process("/usr/bin/id").begin |