From patchwork Wed Feb 26 07:39:19 2020 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: 183894 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2789282ile; Tue, 25 Feb 2020 23:43:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwlA1OAtfn8geVPR9btBl0tSKUrLNWS2cktco4c2nkA9tp6hYqqk+CJGBosHBkA9QLud0iA X-Received: by 2002:a37:b103:: with SMTP id a3mr3822980qkf.204.1582702992634; Tue, 25 Feb 2020 23:43:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582702992; cv=none; d=google.com; s=arc-20160816; b=WReDn+3qnHWYYttMTm1Nbsds2wY9qsFHO+V7luHgqq9ruXKso8vmvVCUokorYm9+3p X6e0Ei6SqpHB7raOOvjQEyeBA1jzbQVaASqqRbFWsuWiVVh0BvsH5uyPI00CE42Ng/kO wZQnRhLOy1lBXiUiAauhQ70YU46Dw11zsCYZTX8fpi2JomjcqIPp6JFUAwV7WXXwOC3X eXnTZapPsMPuGK297+Iy6agQ9pojetRRkTMnW/9YdDSEb7mazTf4nLnCYY//kTzp37c9 3QCU2bIPo3X3qwSymr8OQUv50YTxktCHDEJf+uvcDzUgVL6hPNpUiXHlmf7iJq/I1rys 22tg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ITdhJtBi+hshLd/SCnxQXLHEvNRwcFRFczk6s3Q/ph4=; b=I0z7u/Bh3SM9PCjbyPc5axnta1slQFTztb1xfxVlkPK2/Bm+rt4hrnz3aeRYd1G3Q4 nrj3/zZvZfn4ibLghdjYWe3LSToTRjPqw7C8XgvE2ysFy95AMZ4EdwelfMeegTdgPqrC MEjAMoktIkAMyGFUZQ6FYt9XZCc11yzksgE85OExSiJoxl2MxV+0VmhVz8qCy5DQ8BHv LQUe/nFD23nzxbbhsBMGeYRLxg71bN5k66RokTcNmPFitwkXVLugI5skr2+TnKG8Y/2B Q0dsf9cf0cmS1lyZgwGlqVy2nrypzmftbcnt6HizA7pITulTpWSrzGhhrFAeQzlnVerK b7Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EI45H9uE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id p88si122011qtd.103.2020.02.25.23.43.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Feb 2020 23:43:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EI45H9uE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:39292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6rLc-0007HB-6G for patch@linaro.org; Wed, 26 Feb 2020 02:43:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46159) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6rII-0000lC-8L for qemu-devel@nongnu.org; Wed, 26 Feb 2020 02:39:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6rIH-0002lm-7G for qemu-devel@nongnu.org; Wed, 26 Feb 2020 02:39:46 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:33349) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6rIH-0002jR-0a for qemu-devel@nongnu.org; Wed, 26 Feb 2020 02:39:45 -0500 Received: by mail-wm1-x331.google.com with SMTP id m10so3890602wmc.0 for ; Tue, 25 Feb 2020 23:39:44 -0800 (PST) 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=ITdhJtBi+hshLd/SCnxQXLHEvNRwcFRFczk6s3Q/ph4=; b=EI45H9uEnDgWI4S5CYtLcxE2QM/AXkWHxkgWFx4aq/kxE57BRCVgeRqX6rQgFZ3Pv3 uBefuS+zVC6yqi2uC/BswvVQejGq05MdGKmu+IT/FjwMnvNY6MX7/dHSdZKkF+exI3Xh n/M8am4TB1Bkdhrdqpwz1Q+W+Pjk0TkzD/+MyPpgw6F2aU4ouewiPOFknoonUS3ZtYkJ Ld1+POHj47IU3vEkKZVWzUvJ0/td06BoERqF2FfpycDQ6+4QziAszXl1sYSnwpqBUUMS IFdNdqe8hY4X1MXq/csp0RqxgglrKKRBtpfbRstPYC1ite75OJvca9S+k6KiRijNiZSR S3Xg== 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=ITdhJtBi+hshLd/SCnxQXLHEvNRwcFRFczk6s3Q/ph4=; b=DqJqZivx2bmpyGRxBs6KpmLhZEytsJw9Tr1UD8hqo+UKMCmiUaUurGvvsjR3KuM9/u Cf235lvknw+SJ0H7NF+vxJXqzu3vXgl601J3pKjfyKaoeY5gvF1Ev+ak/91Qcf7yvl4B Oy8I/esyQNhKDRtL/GfvDn9jB81uqJ1DB+pHJs1ztlVEi8i+DVSNp+biXQgNFL3AFmfx PuhGfbDfl54OjtaaCTrRlwpQrHS2OPmBeaekOvKK0IkvrMaSHs1HlbN2RNTYYgp5FO+o dnmGNjXdpYYu0jprgHb7N91/o77cI/pKqS2G/D8catai7tGQl8yS+hx1B5opG0q4OsDL wx3Q== X-Gm-Message-State: APjAAAWuG5Z3aQHb+oUN0zMHQOF8visoSxCFNtHO2+vww98iutiH29F4 yXyw379jn9j0dDqmfIHgA2WANA== X-Received: by 2002:a1c:f707:: with SMTP id v7mr3777116wmh.121.1582702784044; Tue, 25 Feb 2020 23:39:44 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c9sm1758147wmc.47.2020.02.25.23.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 23:39:38 -0800 (PST) Received: from zen.home.arpa (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0F17E1FF99; Wed, 26 Feb 2020 07:39:30 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 09/19] tracing: only allow -trace to override -D if set Date: Wed, 26 Feb 2020 07:39:19 +0000 Message-Id: <20200226073929.28237-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200226073929.28237-1-alex.bennee@linaro.org> References: <20200226073929.28237-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::331 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Stefan Hajnoczi , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Otherwise any -D settings the user may have made get ignored. Signed-off-by: Alex Bennée Tested-by: Laurent Vivier Reviewed-by: Robert Foley Message-Id: <20200225124710.14152-10-alex.bennee@linaro.org> -- 2.20.1 diff --git a/trace/control.c b/trace/control.c index 6c775e68eba..2ffe0008184 100644 --- a/trace/control.c +++ b/trace/control.c @@ -226,10 +226,15 @@ void trace_init_file(const char *file) #ifdef CONFIG_TRACE_SIMPLE st_set_trace_file(file); #elif defined CONFIG_TRACE_LOG - /* If both the simple and the log backends are enabled, "--trace file" - * only applies to the simple backend; use "-D" for the log backend. + /* + * If both the simple and the log backends are enabled, "--trace file" + * only applies to the simple backend; use "-D" for the log + * backend. However we should only override -D if we actually have + * something to override it with. */ - qemu_set_log_filename(file, &error_fatal); + if (file) { + qemu_set_log_filename(file, &error_fatal); + } #else if (file) { fprintf(stderr, "error: --trace file=...: "