Received: from eggs.gnu.org ([2001:4830:134:3::10]:36280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqXA8-0000d9-OS for qemu-devel@nongnu.org; Fri, 17 Aug 2018 01:19:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqXA5-0005ZH-GF for qemu-devel@nongnu.org; Fri, 17 Aug 2018 01:19:04 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:41993) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqXA3-0005VR-Du for qemu-devel@nongnu.org; Fri, 17 Aug 2018 01:19:00 -0400 From: "Emilio G. Cota" Date: Fri, 17 Aug 2018 01:18:44 -0400 Message-Id: <20180817051853.23792-1-cota@braap.org> Subject: [Qemu-devel] [PATCH v2 0/9] synchronization profiler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Peter Crosthwaite , Richard Henderson , "Dr. David Alan Gilbert" , Stefan Weil , Markus Armbruster , Peter Xu , Fam Zheng v1: https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg02186.html Changes since v1: - Rebase on current master. - Update copyright to 2018. - Add -m option to the HMP info command to sort by average wait time, as suggested by Paolo. - Add -n option to the HMP info command to NOT merge call sites. The default does merge call sites, as suggested by Paolo (thanks to Peter for the clarification). - Switch to camel case in qsp.c - Update the commit logs of the two HMP patches to clearly state that this is only for developers, so it is HMP-only. - Rename the HMP command from "sync" to "sync-profile", as suggested by Markus. - Use int for line info consistently (was using unsigned sometimes) - Drop qsp_init from qsp_cond_wait, as suggested by Fam. - #undef QSP_GEN_{VOID,RET1} once they're no longer used. - Add qsp_reset() This uses a snapshot to avoid deleting items, which would require adding rcu_read_lock/unlock to the fast path. - Convert to run-time option, as suggested by Fam - Add -enable-sync-profile to qemu-options - Add sync-profile HMP command: "sync-profile on|off|reset" - allocate QSPEntry with g_new0 I added most new bits as separate patches to ease review. The first patch has some perf numbers; the last patch shows sample output from the monitor. Checkpatch gives some errors, but they're false positives. You can fetch this series from: https://github.com/cota/qemu/tree/sync-profiler-v2 Diffstat below. Thanks, Emilio --- cpus.c | 10 +- hmp-commands-info.hx | 22 ++ hmp-commands.hx | 15 + hmp.c | 24 ++ hmp.h | 1 + include/qemu/main-loop.h | 4 +- include/qemu/qht.h | 1 + include/qemu/qsp.h | 29 ++ include/qemu/thread-posix.h | 4 +- include/qemu/thread-win32.h | 5 +- include/qemu/thread.h | 66 +++- monitor.c | 11 + qemu-options.hx | 10 + stubs/iothread-lock.c | 2 +- tests/atomic_add-bench.c | 6 +- util/Makefile.objs | 1 + util/qemu-thread-win32.c | 4 +- util/qht.c | 47 ++- util/qsp.c | 779 +++++++++++++++++++++++++++++++++++++++ vl.c | 3 + 20 files changed, 1016 insertions(+), 28 deletions(-) create mode 100644 include/qemu/qsp.h create mode 100644 util/qsp.c