From patchwork Fri Oct 5 15:49:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 148203 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp620398lji; Fri, 5 Oct 2018 08:58:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV61ETDG4d5MKkf2WvIOzdC+ulxmP0iMa8eGVnALx9nnm7JiyCtjUk9oGj8CY395JLPTh5zRZ X-Received: by 2002:ac8:2a33:: with SMTP id k48-v6mr9744576qtk.245.1538755092508; Fri, 05 Oct 2018 08:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538755092; cv=none; d=google.com; s=arc-20160816; b=B8DuEa/27wmqW7cbVFmSIQsbHrWJDA0BXy/a3GVa+iCmA2NrSc/PDvfgLOb/RelkTu VU1XzeCm1DFBSYzLMPdsIIeEsFX7ud+wB/oVu4EsermS5ubZhjcsfQTNq+y/6fCLwDd5 KD/lzjZdiGcOTH/w25YUDPPQ60S/GnuE0/HZRCHoWy2r2UX6k0vWJBDt7npmckR/0Bof K1fhjCDwfbWajl2/yZ20ZUWgmaVwpq0chuYawE+USQjM+mGC0iruoy9+yhJtpAF6X+rr 8OXWJtfUasDth7F5wdfPSVcYnYOXvLrFuxQLghMmbRoy1PEAp/jvoeudlU/CAk50xqmt tjSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=xomis5lLafULCE1DLy6Ga+55f13jUaR20ViL4qRpD/E=; b=JDr1UbtJRm56SSJngdzqtCtRMUBNvNfYbxSGO4Jr+2Q8zJtfONb+PEMc/FqZ9IfVlt BIUF5comzyooKjYuvQ9Ly8SxYsOwgupqnG9CFOLKwRcfTbWD37JNtQ5tF4ZBirbP06N7 9a0SbicjdlBvM443cDSAcEjz4cJzzUYPwZcy0P392AYKaaTUTzMsX8BlSvUmiSFcHRhn lWgWXvGRZ557jV72v7vJHmpfafuMBlBrJ+wDdVaR7FY/14BuPKhxiMMMfictFMtWj8fR 3GVo/DSz6F+SlluU0wQ68ntCg8J+nKGKuNM+LfGckekrcIvIDSM7PUZRbLetPPd2NSVP a3mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bL8+OH+s; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a5-v6si4065156qvn.135.2018.10.05.08.58.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Oct 2018 08:58:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bL8+OH+s; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SUV-0000Oo-SS for patch@linaro.org; Fri, 05 Oct 2018 11:58:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SMA-0006aj-Q7 for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8SM8-0006D1-Qf for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:34 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:38979) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8SM8-00068q-B9 for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:32 -0400 Received: by mail-wr1-x42f.google.com with SMTP id 61-v6so13303655wrb.6 for ; Fri, 05 Oct 2018 08:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xomis5lLafULCE1DLy6Ga+55f13jUaR20ViL4qRpD/E=; b=bL8+OH+sB0sfnjWQkuT7tjAGjtVHZTO8QZfvyKo52ZBtEgmJ4CEZwCIS4UM8rhEUB/ T8pE9DZWgEFnZrvchP5k7lHP0VfigMZN8Wmi3wLKHoPemduD3EAQsK9fXA508W5YTByl N51+CbVs8qY/XsaI09L2u5lxX+qi6pkf2kgDY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xomis5lLafULCE1DLy6Ga+55f13jUaR20ViL4qRpD/E=; b=g7KFNwemWTkukcNxqtvAMTBVvn7KxXlzMtKb2Q1mBBRpiwS8r/+LOHC2NmWrhB322l QpLCVaunwovGKwOWfly8GKdkYrRJGzASxbCaipsYDAEGFvtjcP5nB1WPsBtcFbxuyBIM vjol1hMallF2eEnwIhlCwaQPqg7xXdLEhbu9uQbZnTLU00eF8X+pefLL+KjadHKyT7YL u/gyqm5PTa+h5eihRq8Cu/M6BqxqEZG/H/aG0oTzwvxRX4bANCkNNFIoWgZ848cR50NU ydRd+iCocRv750o0ubBfsHmL2XBMquJfnQyU9SjVe8mqynCfuRSxuWe04ea8iQljM/XP 5d6w== X-Gm-Message-State: ABuFfojW0a3/vdBEJQnz8BNlv3YmNh+9BlZstsY+nBQrdeclAUgE6Gzq kvJq5RYV5Ia5x+Dv7aFhU2RQXS1cuQE= X-Received: by 2002:adf:8103:: with SMTP id 3-v6mr8531119wrm.106.1538754568509; Fri, 05 Oct 2018 08:49:28 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 195-v6sm2970011wmx.21.2018.10.05.08.49.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 08:49:24 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 308013E085A; Fri, 5 Oct 2018 16:49:12 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 16:49:07 +0100 Message-Id: <20181005154910.3099-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005154910.3099-1-alex.bennee@linaro.org> References: <20181005154910.3099-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f Subject: [Qemu-devel] [RFC PATCH 18/21] linux-user: allow dumping of plugin status at end of run X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier , cota@braap.org, Pavel.Dovgaluk@ispras.ru, =?utf-8?q?Alex_Benn=C3=A9e?= , vilanova@ac.upc.edu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As we don't have a monitor in linux-user mode we need some way of exporting our data to the world. We introduce a new -d option (plugin) which turns on the existing LOG_TRACE flag which qemu_plugin_status() will dump output to before we finally exit. Signed-off-by: Alex Bennée --- linux-user/exit.c | 12 ++++++++++++ util/log.c | 2 ++ 2 files changed, 14 insertions(+) -- 2.17.1 Reviewed-by: Richard Henderson diff --git a/linux-user/exit.c b/linux-user/exit.c index 14e94e28fa..2f9e016207 100644 --- a/linux-user/exit.c +++ b/linux-user/exit.c @@ -17,12 +17,23 @@ * along with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/plugins.h" #include "qemu.h" #ifdef CONFIG_GCOV extern void __gcov_dump(void); #endif +static void plugin_report(void) +{ +#ifdef CONFIG_TRACE_PLUGIN + GString *plugin_report = qemu_plugin_status(""); + qemu_log_mask(LOG_TRACE, "%s", plugin_report->str); + g_string_free(plugin_report, true); +#endif +} + + void preexit_cleanup(CPUArchState *env, int code) { #ifdef TARGET_GPROF @@ -31,5 +42,6 @@ void preexit_cleanup(CPUArchState *env, int code) #ifdef CONFIG_GCOV __gcov_dump(); #endif + plugin_report(); gdb_exit(env, code); } diff --git a/util/log.c b/util/log.c index 5759bf571f..d4423277e0 100644 --- a/util/log.c +++ b/util/log.c @@ -288,6 +288,8 @@ const QEMULogItem qemu_log_items[] = { { CPU_LOG_TB_NOCHAIN, "nochain", "do not chain compiled TBs so that \"exec\" and \"cpu\" show\n" "complete traces" }, + { LOG_TRACE, "plugin", + "show summary plugin information at end of run." }, { 0, NULL, NULL }, };