From nobody Thu Nov 13 14:53:13 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1581419554583933.1848387675925; Tue, 11 Feb 2020 03:12:34 -0800 (PST) Received: from localhost ([::1]:47960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1TSz-0008Nz-DJ for importer@patchew.org; Tue, 11 Feb 2020 06:12:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41533) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1TRe-0006et-FR for qemu-devel@nongnu.org; Tue, 11 Feb 2020 06:11:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1TRd-00069F-8o for qemu-devel@nongnu.org; Tue, 11 Feb 2020 06:11:10 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:54262) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1TRb-00067Q-Vt for qemu-devel@nongnu.org; Tue, 11 Feb 2020 06:11:09 -0500 Received: by mail-wm1-x344.google.com with SMTP id s10so2952855wmh.3 for ; Tue, 11 Feb 2020 03:11:07 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q3sm3198949wmj.38.2020.02.11.03.11.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:11:04 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9E4EF1FF87; Tue, 11 Feb 2020 11:11:03 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xiuLr2bgSRxDP5CJng9ok5G0lC9iDI/XVskdjRAUAgg=; b=E3vs9c7fahija2XGr6++VsgiMj4LD/gkIHv5taOUKomglv4MW4BQ+Uo1ECmBQRxEo/ FWPpyvWvJfSbvtdjIGuIklOdtH6/FP8Dlqu+b8Gw2kaQWoir/t1fcU1wJlKdWGFTLIKc vgn0CBtHr1LIYj1kheghs7RqN/9YwCa1+IoVwR2YouBHiu3oA3C3D1dbHiH9e0BJ8BEo Ge22uF11K4iVco6l92ie3niulGP3sRDinXrywjBOouOZcZaGJCsxtj2Xr90t2P2LspuU jEqqjj5xi2gP2afCMUxzvEskUtk0b5esnve4/sqhNYVA3B3ABrP5g8REhWVnV/Qfl2Gx DCSg== 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:mime-version :content-transfer-encoding; bh=xiuLr2bgSRxDP5CJng9ok5G0lC9iDI/XVskdjRAUAgg=; b=FxAymaocNYeh04VWTfFzPSBZrx4iIf6DA9MHbtoo2cWP03crpEBpFfs37YIYIN4jOc XCVji/Hu/iaIUNjtAyPQUrNiSb6gvhuQeap4QsJqUxMKY/xVv+IAf+VgrwVzBuG8pvzj /nDSfuSc7KwIvVdx32uMZlJWSS7h8oDhGekkVB73lU/BHJolzEf+6tJ8CbaD/rbfidZS q4txpOE7GRpfwuvI3rSmmXKU4QLQ9vc+6jnhagNtpoVXSdLH4Juncj+mAKhhpskzA0E7 uAaWj7NuH2bs3EfTEY0W4yoRYq5ilTbR/0KgBFXp8HaJKi9N5k1ou06xhHWNAvUfEWUg Lj5Q== X-Gm-Message-State: APjAAAWsFv1CPjOezZQvYv+26yaxUaWwWeYyOAwZeg5QLltA4XWPbckp S6xaZ0PbxrRd0MD+sH6MwxpG1w== X-Google-Smtp-Source: APXvYqxT/W4VfZUj5i+HHD9phypXXawQKkXVCadtTmUpLqSETMfwDiPNK/FTS5HyC8GmxwcHt+YcnA== X-Received: by 2002:a1c:a78b:: with SMTP id q133mr4995353wme.28.1581419465790; Tue, 11 Feb 2020 03:11:05 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH] tracing: only allow -trace to override -D if set Date: Tue, 11 Feb 2020 11:10:54 +0000 Message-Id: <20200211111054.27538-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Otherwise any -D settings the user may have made get ignored. Signed-off-by: Alex Benn=C3=A9e Tested-by: Laurent Vivier --- trace/control.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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=3D...: " --=20 2.20.1