URL: https://github.com/SSSD/sssd/pull/95
Author: jhrozek
 Title: #95: STAP: Check the number of transactions in the stap aggregate 
before dereferencing it.
Action: opened

PR body:
"""
None
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/95/head:pr95
git checkout pr95
From ffb99514c006436da480cd53cea6eba6fb9c579b Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Mon, 28 Nov 2016 08:44:04 +0100
Subject: [PATCH] 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.
---
 contrib/systemtap/id_perf.stp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/systemtap/id_perf.stp b/contrib/systemtap/id_perf.stp
index 0ad6195..a778975 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
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org

Reply via email to