From e81acc440d0f2a5d40f5a43b6d3996b1f0a73ba8 Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" <raphaelsc@cloudius-systems.com> Date: Mon, 24 Mar 2014 20:44:24 -0300 Subject: [PATCH] scripts: Print number of threads in 'osv info threads' The id of the last thread might mislead people's thinking about the number of threads in OSv, so let's simply print the nr after all threads were already printed. Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com> --- scripts/loader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/loader.py b/scripts/loader.py index 70f874e9e..2504851d1 100644 --- a/scripts/loader.py +++ b/scripts/loader.py @@ -684,6 +684,7 @@ class osv_info_threads(gdb.Command): gdb.Command.__init__(self, 'osv info threads', gdb.COMMAND_USER, gdb.COMPLETE_NONE) def invoke(self, arg, for_tty): + thread_nr = 0 exit_thread_context() state = vmstate() for t in state.thread_list: @@ -729,6 +730,8 @@ class osv_info_threads(gdb.Command): gdb.write("\tjoining on %s\n" % fr.frame.read_var("this")) show_thread_timers(t) + thread_nr += 1 + gdb.write('Number of threads: %d\n' % thread_nr) class osv_info_callouts(gdb.Command): def __init__(self): -- GitLab