Skip to contentSkip to conversation

master - lvmdbusd: Add lvm flight recorder

PATCH tasleson 1 participant 1 message Mar 21, 2016

lore
Share & tools
lore

tasleson

author
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ca28ea88bedbc0ecb64e5579c1b3076b9a7cd533
Commit:        ca28ea88bedbc0ecb64e5579c1b3076b9a7cd533
Parent:        a0c7875c547fb8a420d789271f5e6660210e749f
Author:        Tony Asleson <[email protected]>
AuthorDate:    Mon Mar 21 17:22:56 2016 -0500
Committer:     Tony Asleson <[email protected]>
CommitterDate: Mon Mar 21 17:28:51 2016 -0500

lvmdbusd: Add lvm flight recorder

To help out with debug, when an exception is thrown in the dbus service we will dump all the information we have on the last 16 commands that were executed along with the stack strace.

---
 daemons/lvmdbusd/cfg.py        |    3 ++
 daemons/lvmdbusd/cmdhandler.py |   46 +++++++++++++++++++++++++++++++++++++--
 daemons/lvmdbusd/request.py    |    1 +
 3 files changed, 47 insertions(+), 3 deletions(-)
daemons/lvmdbusd/cfg.py +3 -0
index bde6a64..8aec8ae 100644
@@ -78,3 +78,6 @@ load = None
 
 # Global cached state
 db = None
+
+# lvm flight recorder
+blackbox = None
daemons/lvmdbusd/cmdhandler.py +43 -3

71 lines not on this page · raw message

daemons/lvmdbusd/request.py +1 -0
index cf258f1..02f8c88 100644
@@ -69,6 +69,7 @@ class RequestEntry(object):
 			# have gotten a job by the time we hit an error
 			# Lets get the stacktrace and set that to the error message
 			st = traceback.format_exc()
+			cfg.blackbox.dump()
 			log_error("Exception returned to client: \n%s" % st)
 			self.register_error(-1, str(e), e)