From patchwork Tue Feb 25 12:47:00 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: 183836 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1765214ile; Tue, 25 Feb 2020 05:40:09 -0800 (PST) X-Google-Smtp-Source: APXvYqyJB2NZxaujeFnwv60ivHCLv9y6D3BpQDpfxlN0Ar3bgxIQI/2nj88+35zvZgJBUZ0MQk1Y X-Received: by 2002:a37:a1d8:: with SMTP id k207mr55407454qke.375.1582638009359; Tue, 25 Feb 2020 05:40:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582638009; cv=none; d=google.com; s=arc-20160816; b=HrIcwvbdFIojSqFkbZ5BpVGb/jt/KRXK8VNdarw2RR2hmifH6ROH3symAeQusKo3qh pAp7thONiZUhylTjNKqplkb/l0WC0/a6RJwHwopTq56kwPFUGYdrw5QrnvzjdJp6x0C9 HRg7r1RgLEQLMIjB30HhC71/mjWqj7dbtfrDg0AC3AhFEagXKXsYPS4MwvMkaHoeeaHm o/FGvaU+Ph5POIrmJHYhgCk9dtQrUY3ESjpTeYKmIvm179SCI7oHeURzyDGk+XfMo0/2 w6Ub/DVlA1NL2XJ4cPydvg/1n/NzTUiz+d02FS2w9w/jfPZ0tfaf6Cx3AnB78UANQrE0 9eLQ== 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=4qoFVLEk4TMnSbFDHJO1R3wqor2c3af6vJj8knvgvVs=; b=TYcSlOx/wzInKScXXQg1p0HS6MwlgvaW2mAVNWE+GDu9Zo0qNsQVzwHwXnR34Ewv9O +L+uFraqN7ql+4bTgyB26ff8VrdIPOZo87e0Z+YBGW8v+mf01KEXGlIC2UJ9KlujEnXF wqZ+Lp7gqBLZOV64k59U+PXhyM8ARTIy8bnOHJ2uli80FobwMcYcghORHQBt/vLu41iK AeSlD4N11v1rXS4ELDAJBzVdyYjNScfUkPzU8kCd3eHdSbF7y7x1dQB6Dh1+sL5apatd yTnDFrYUOC19+XWQryeKj0fphdBBTg10YJRVFQUvco3QBBmcZ41rgkNdQw+qZuY1K+wm krDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=M+6TqLbv; 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 p68si7471114qke.320.2020.02.25.05.40.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Feb 2020 05:40:09 -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=M+6TqLbv; 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]:56212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6aRU-00030x-RC for patch@linaro.org; Tue, 25 Feb 2020 08:40:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59237) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ZcW-0005W5-6b for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6ZcU-0007GO-62 for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:27 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:35445) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6ZcT-0007G1-Nz for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:26 -0500 Received: by mail-wr1-x441.google.com with SMTP id w12so14596019wrt.2 for ; Tue, 25 Feb 2020 04:47:25 -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=4qoFVLEk4TMnSbFDHJO1R3wqor2c3af6vJj8knvgvVs=; b=M+6TqLbvamS6vUkSEZ6TheYfPLwCCDeqbP11gqV4EkTF95L0by3caNbDGfqOtSAPK5 DajEiATREsKszZulmCytYHusguMng0SA47sBlZJSVnfOoMSc7c+d/uEg0w9gT9l3ApB0 +FN8tAu0oMyqC1mJEc76aE2rfWVMjyz7IhIcSJ8TrqPOC5UNXRUhkiCSfTw/y6MFoM3H aUV3M5j2GEIw3i0ND0s95ZSukyfDiJiriKQHHskMx/PGIUyoA9S1mMAUUr9ytNoi5WUq jPLheobdrL0xU7sn0x6PSYxwIcoP8No5EyAJuJ/xzLX0VdRPNVYd36gcoyx4sYFfChtx M14w== 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=4qoFVLEk4TMnSbFDHJO1R3wqor2c3af6vJj8knvgvVs=; b=fjPYnYYn31QQsXYXR/LZFtNlBAbdqUf/Wk2zN/Nk47tmEM3hiS0f+Uc15Vtz0DPIpR qGT3Lq+nDT/+TeO9i9Mn4iA+yqi9b625bdAGErPiayZUy0EcVzQTYWl1GUPpu/Dbz+8R We8tArN0NjxpzGIlVlVTA+7je+S2YGy+X3dwrPlYlxPTj5TzdXot6Z/oiY0KWvn9DD7R BSlrBvhfbeKEt7Eug4fWwiAKHpSpP3mJLKTYzCCqE1DtS7RNN+RPQwCoaLXqiAr95fnD 8kzOQIPrf69e3m0wddRUVn7iSaYYJVyj63R+ivMbWcSZeHiiX6wvE72KxnFtSvI7TKGk 9udQ== X-Gm-Message-State: APjAAAXtnViJAv0btMp9QCx4cxKKQSvQxd9/G/wd6+68IOUW+N7q7fN3 jfAr8jKfCEqfYfAeAd5gqZCWYg== X-Received: by 2002:a5d:4b03:: with SMTP id v3mr76302155wrq.178.1582634844749; Tue, 25 Feb 2020 04:47:24 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w1sm24513316wro.72.2020.02.25.04.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 04:47:20 -0800 (PST) Received: from zen.home.arpa (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 174CF1FF99; Tue, 25 Feb 2020 12:47:11 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 09/19] tracing: only allow -trace to override -D if set Date: Tue, 25 Feb 2020 12:47:00 +0000 Message-Id: <20200225124710.14152-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200225124710.14152-1-alex.bennee@linaro.org> References: <20200225124710.14152-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::441 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: fam@euphon.net, berrange@redhat.com, robert.foley@linaro.org, pbonzini@redhat.com, stefanb@linux.vnet.ibm.com, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, Laurent Vivier , marcandre.lureau@redhat.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net 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 --- trace/control.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 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=...: "