From f757df229aaf994adde654086d4ca4d3ad1ee851 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 18 Feb 2013 14:56:29 +0000 Subject: Add function for listing native threads to eventlet backdoor The eventlet backdoor has a 'pgt' function for listing green threads and their stack traces. This adds a new 'pnt' function for doing the same with native threads. Change-Id: If6dcfd8dde61c96adfc6e052e5ec7db82914cd55 Signed-off-by: Daniel P. Berrange --- openstack/common/eventlet_backdoor.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'openstack') diff --git a/openstack/common/eventlet_backdoor.py b/openstack/common/eventlet_backdoor.py index 61ceded..8b81ebf 100644 --- a/openstack/common/eventlet_backdoor.py +++ b/openstack/common/eventlet_backdoor.py @@ -51,12 +51,20 @@ def _print_greenthreads(): print +def _print_nativethreads(): + for threadId, stack in sys._current_frames().items(): + print threadId + traceback.print_stack(stack) + print + + def initialize_if_enabled(): backdoor_locals = { 'exit': _dont_use_this, # So we don't exit the entire process 'quit': _dont_use_this, # So we don't exit the entire process 'fo': _find_objects, 'pgt': _print_greenthreads, + 'pnt': _print_nativethreads, } if CONF.backdoor_port is None: -- cgit