From patchwork Fri Oct 5 15:48:58 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: 148208 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp623631lji; Fri, 5 Oct 2018 09:01:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV63jOa6xZl8W4hVyRVsmjcK/BelUl8elOMPWwVDN1k+HBp4bCRjYSIwTymS3+PNCB2u8oLjP X-Received: by 2002:ac8:1a13:: with SMTP id v19-v6mr10289096qtj.183.1538755272189; Fri, 05 Oct 2018 09:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538755272; cv=none; d=google.com; s=arc-20160816; b=DcMsBhZw//nv4ZogBLo3eHgSeqEFbBTn6xKEYTLcbLzt/0T3VeO/wnQabe0BbeFEtl xlOYPyOkzWKFCt3/1KBBe4BFpkcz3ajsj9akT/xaU8bnsoNxYVmgEcy3waOXNVseLvQW KFhJPp4zSoBNj7l7X2rojN8VDTHRvf934m6S9qAqJ2L07U5BOpFHBPmgL45B27+H/B6V tXZml632nFCF6Eyh+RZ+eHa6MNuHcB9FG8SlG3cwbgKR2EpU3eEgVBLQmbWI15Qftj0m xqlryT6suVWLOdg+7zAnmEzgAewAlgxR+H9U7QcZurRxmJ1Gmn5HN4acvKzj6J+tFxqC bpBQ== 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=w8gM7VL+X/yF2wQLvNV3izfa85PWeYk7XF0I+Hzlb3g=; b=BF6PtbKtcgGnB8hPNrQrNhRVH2l7JkccsNY2AwsnPv+JBaIi5351tK5ymyxaVEC0vx sirXOkz5HnUJGT6lLJGmAkTakMSGR9kyClDBvYVYCs7oMaoT5y9O0BNsoknN5P1PHsfK lVKQ/1K9PpwSRP98Hpyc+2sucVFlq0WfQxoRGhzDPZYTsb89Npi8BcjPNnV9EyBZ88I+ TiN3vZXVB6ujImP9wjxz+ngJSS+c1FJmp/vHy0XHfhm2nS35O+AxM39+3XFo7VThS1VO qRyOGqnEnWN+4qPHeYUPNHIpO5qzyiUSPTYJzC4wwEn3sffkzAtVZZQ2eISNQK4A2W4J biFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WF9z9ef+; 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 u9-v6si1075190qvr.57.2018.10.05.09.01.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Oct 2018 09:01: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=WF9z9ef+; 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]:35775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SXP-00032Z-4Y for patch@linaro.org; Fri, 05 Oct 2018 12:01:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SMA-0006aK-5P 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-0006Cb-Ia for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:34 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:43510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8SM8-00064t-2g for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:32 -0400 Received: by mail-wr1-x42a.google.com with SMTP id n1-v6so14043033wrt.10 for ; Fri, 05 Oct 2018 08:49:22 -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=w8gM7VL+X/yF2wQLvNV3izfa85PWeYk7XF0I+Hzlb3g=; b=WF9z9ef+0P06Hm6YT5dhQfsN1RdTbFfIOFURg2FSJf7Vb62SHPq3rqlGlv+AmFpiZl Lb5zoYF0R+G/lcBAp9KDxOWTcM4Uf77GNXi9exHKcyEwehjmn7g8WdP7kMLrEJceEBze wmpRkpDrfWLKMcnZHlUdSVG4iHNlljUCg+9Ys= 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=w8gM7VL+X/yF2wQLvNV3izfa85PWeYk7XF0I+Hzlb3g=; b=CCb1P+nQHU1HkgVtiJAT05cIkcfaxwmilWr1ltN6hc5ZpOqtTHev59/8iGaqcXI2mZ Dn3RzraKSQQxc6OBSlTNYpalopBHpIV76qyU816TtldLcYamEW7PLCA6ZD4OVjdo47pe 6zd8HihsGCBFGbVqe8hmixQxU4r5FmTtATIuQNw1ugACQL/+JPg1jKk+7Bp/mEp1+RCm WSXWRFBEe7S5OMGItByvO2FE7XdV5rFpKk/d+S/XeR+dXLU74hRFYDmwbiDa11ebUQI7 DBOtNZH1wdn//dQH+ITmtAW2HGLPQgxzMVDJffKZtD3yEfp6Nl79kmDB3alpThRtr9sZ 8L9A== X-Gm-Message-State: ABuFfoiAZl1q6vNxNZWXKhnAuZz8b9rV5UIRzIiiaBIuKSgv3NEvhEe1 U+2SlnBtx7wITue4gQRp8U3ItA== X-Received: by 2002:a5d:5701:: with SMTP id a1-v6mr9209209wrv.289.1538754561195; Fri, 05 Oct 2018 08:49:21 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 90-v6sm7096634wrg.86.2018.10.05.08.49.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 08:49:15 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 6EE673E0634; Fri, 5 Oct 2018 16:49:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 16:48:58 +0100 Message-Id: <20181005154910.3099-10-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::42a Subject: [Qemu-devel] [RFC PATCH 09/21] trace: suppress log output of trace points 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: Paolo Bonzini , cota@braap.org, =?utf-8?q?Alex_Be?= =?utf-8?b?bm7DqWU=?= , vilanova@ac.upc.edu, Pavel.Dovgaluk@ispras.ru Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When multiple tracers are enabled and you want to save to binary we shouldn't assume the user also wants to spam the log. They can always override it manually if they want. Signed-off-by: Alex Bennée --- util/log.c | 3 --- vl.c | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) -- 2.17.1 Reviewed-by: Richard Henderson diff --git a/util/log.c b/util/log.c index cc79a146d1..5759bf571f 100644 --- a/util/log.c +++ b/util/log.c @@ -56,9 +56,6 @@ static bool log_uses_own_buffers; void qemu_set_log(int log_flags) { qemu_loglevel = log_flags; -#ifdef CONFIG_TRACE_LOG - qemu_loglevel |= LOG_TRACE; -#endif if (!qemu_logfile && (is_daemonized() ? logfilename != NULL : qemu_loglevel)) { if (logfilename) { diff --git a/vl.c b/vl.c index a867c9c4d9..795e025445 100644 --- a/vl.c +++ b/vl.c @@ -2908,6 +2908,7 @@ int main(int argc, char **argv, char **envp) Error *err = NULL; bool list_data_dirs = false; char *dir, **dirs; + int maybe_log_trace = 0; typedef struct BlockdevOptions_queue { BlockdevOptions *bdo; Location loc; @@ -3985,6 +3986,19 @@ int main(int argc, char **argv, char **envp) } trace_init_file(trace_file); +#if defined(CONFIG_TRACE_SIMPLE) && defined(CONFIG_TRACE_LOG) + /* If the user has both log and simple tracing enabled but hasn't + * defined a binary trace file ensure we enable the right logging + * flags. + */ + if (!trace_file) { + maybe_log_trace = LOG_TRACE; + } +#elif defined CONFIG_TRACE_LOG + /* with just CONFIG_TRACE_LOG we enable unconditionally */ + maybe_log_trace = LOG_TRACE; +#endif + /* Open the logfile at this point and set the log mask if necessary. */ if (log_file) { @@ -3998,9 +4012,9 @@ int main(int argc, char **argv, char **envp) qemu_print_log_usage(stdout); exit(1); } - qemu_set_log(mask); + qemu_set_log(mask | maybe_log_trace); } else { - qemu_set_log(0); + qemu_set_log(maybe_log_trace); } /* add configured firmware directories */