summaryrefslogtreecommitdiff
path: root/buildscripts/gdb
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-08-21 12:21:47 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-08-22 14:21:33 -0400
commit1dc2ac35ba63a9dbed727a2a9690ef8552506782 (patch)
tree2c75a0081e92908236781018ed984d8576abb994 /buildscripts/gdb
parenta81a923c2c44d69a39a81ade66572fafedfa4f03 (diff)
downloadmongo-1dc2ac35ba63a9dbed727a2a9690ef8552506782.tar.gz
SERVER-34738 mongo_lock.py graph should display lock type for LockManager locks
Diffstat (limited to 'buildscripts/gdb')
-rw-r--r--buildscripts/gdb/mongo_lock.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/buildscripts/gdb/mongo_lock.py b/buildscripts/gdb/mongo_lock.py
index 18f5228c78f..9bc2b08e0b7 100644
--- a/buildscripts/gdb/mongo_lock.py
+++ b/buildscripts/gdb/mongo_lock.py
@@ -167,7 +167,7 @@ class Graph(object):
for node_key in self.nodes:
print("Node", self.nodes[node_key]['node'])
for to_node in self.nodes[node_key]['next_nodes']:
- print(" ->", to_node)
+ print(" ->", self.nodes[to_node]['node'])
def to_graph(self, nodes=None, message=None):
"""Return the 'to_graph'."""
@@ -180,7 +180,8 @@ class Graph(object):
sb.append('digraph "mongod+lock-status" {')
for node_key in self.nodes:
for next_node_key in self.nodes[node_key]['next_nodes']:
- sb.append(' "{}" -> "{}";'.format(node_key, next_node_key))
+ sb.append(' "{}" -> "{}";'.format(self.nodes[node_key]['node'],
+ self.nodes[next_node_key]['node']))
for node_key in self.nodes:
color = ""
if nodes and node_key in nodes:
@@ -190,7 +191,8 @@ class Graph(object):
# character.
escaped_label = str(self.nodes[node_key]['node']).replace('"', '\\"')
- sb.append(' "{}" [label="{}" {}]'.format(node_key, escaped_label, color))
+ sb.append(' "{}" [label="{}" {}]'.format(self.nodes[node_key]['node'], escaped_label,
+ color))
sb.append("}")
return "\n".join(sb)
@@ -345,8 +347,8 @@ def find_lock_manager_holders(graph, thread_dict, show): # pylint: disable=too-
print("MongoDB Lock at {} ({}) held by {} waited on by {}".format(
lock_head, lock_request["mode"], lock_holder, lock_waiter))
if graph:
- graph.add_edge(lock_waiter, Lock(long(lock_head), "MongoDB lock"))
- graph.add_edge(Lock(long(lock_head), "MongoDB lock"), lock_holder)
+ graph.add_edge(lock_waiter, Lock(long(lock_head), lock_request["mode"]))
+ graph.add_edge(Lock(long(lock_head), lock_request["mode"]), lock_holder)
lock_request_ptr = lock_request["next"]