From patchwork Sun Mar 20 17:11:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 553199 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp884221mag; Sun, 20 Mar 2022 10:33:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7WOKgT0vYypps5okSzM6rwEoISFyDA4vhXkLDt/ll94E/3zvZZ7/CFGrxDEFR/cAixKAs X-Received: by 2002:a05:622a:60f:b0:2e2:750:ce24 with SMTP id z15-20020a05622a060f00b002e20750ce24mr6527141qta.315.1647797633133; Sun, 20 Mar 2022 10:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647797633; cv=none; d=google.com; s=arc-20160816; b=Vg4NP33VqunJyB+z8/yHWXXGNiX5Zcke6gl9D2kVEiJQT6B1YJSFpQQE7xqGLGCISM jkk9MOHexZxXRMxUGh1UAFuEh2BmDdPaF9ATZEMEddm9RCgZMFodH7wdSfYV3FXMTb5L djLw3AMl5TyPynQqPwwW7ANJD2exuz0UmpZmS9NkXs9+zLw5EadtiXWY21o1AI5s2jjr gfqxCQ2+Jd5R1fgkw67v78VzTVgsUVy1//UTwpryVq+eunRFb2I403qr6iPmFih4AADr 3XlB69qepCJOw52MxzD9c4H8qWpO/9756DjyGChDSdbSEqRWGCR5RDMLYMgc+clje+63 Tn6g== 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=tbvVNjefg+clp9cnxa2dTGnw4THGled3q05yu65oSKo=; b=Jn66S5wkwDs6DOmBnBw224oYaLA9A5Mmd8xRdMUjf88OC7Nq+anDTap2thVbcksaY3 UdCTAiQCxMm9V5G20iXq+LhB0+pDKl/gV+MtBINivVdXuK9i6JxfT15N9AwHm3aG5tEp lXs2Uw4ibCq0cZCAkzv7EpUbujJsEwpULGcHTc5UC3Nw/cRSxCEwZxt4rXDt3+4Sx0um sjmiV9c1GYxeAlBlGAgEOguRD/FaRseyOkMBmOmAj7snr0uChTmhFWa97Y0DVeXOIf0R iOS0sJTSPXS68oRHRW1aXW5TjVtN+kQq/wVNNbQqlswqWqwGPWCCPj8R7KZRdGu5yIg8 FfdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hqrARsdy; 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=pass (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 c4-20020ac85184000000b002e1fbf3be5dsi1298310qtn.78.2022.03.20.10.33.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Mar 2022 10:33:53 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=hqrARsdy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVzRA-0005ls-DA for patch@linaro.org; Sun, 20 Mar 2022 13:33:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVz63-0000Eg-LF for qemu-devel@nongnu.org; Sun, 20 Mar 2022 13:12:03 -0400 Received: from [2607:f8b0:4864:20::533] (port=40499 helo=mail-pg1-x533.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVz61-0003Uu-Vu for qemu-devel@nongnu.org; Sun, 20 Mar 2022 13:12:03 -0400 Received: by mail-pg1-x533.google.com with SMTP id w21so5045268pgm.7 for ; Sun, 20 Mar 2022 10:12:01 -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=tbvVNjefg+clp9cnxa2dTGnw4THGled3q05yu65oSKo=; b=hqrARsdyXj855FwNSqVrrxSYRCsaLSWD4vBMiFL621BnosRPBDuvANTOIwY2/Bl31U UPotp2yuG3PXcaI/fmrBZ8edO/CnWPpmdc8zCuyCyjeBvZ3vhui3kxAPGWi0M457lB4d FhKh3Ivl7BUv1lm6FeHfN2mSz689Jsvaa8Rg9ZGYXhp4NXs7P2qZdVSNkV/H68YxyKA7 RPTVwQ+4x34j68HfscjRUDE2468MmOCWnGuNyIzg+ZtRGWLCpFrOUEpjFquljqDdly84 aJsymWEXJvkMM4o6xLG5GCF6l8DNdY4hlv/iTtvUJI7J33sRAgrWCtUyNkoA4aLYRCjF mzdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tbvVNjefg+clp9cnxa2dTGnw4THGled3q05yu65oSKo=; b=4sUjBeEcGotJ86sR6meMDPNEKSaFYYQdizZDDvB7f6y1wPCM0gjE2x3ywoYHy6QFsw MCWdj/DdVF0e5H2KtME4CvqvbgAwQWo+49wrVRqpfvrwoD9Ik5Vrpas4ovQSMffUXuqM i8djohxlXeJzUPDVqqU6qtbBC7IsZIwoqmg140G6Uioygv+ghXMdBBUmwUQBoi7iAW/3 lEsh0yX2L+L7AIWsX3E4l6MchWp9AVGhEfDJkGTdKh9SfBdkv9z3z8Poh0fjFqN4FDKm GD3vx39mATefYI3rXmotgWTQIY6KfdRlv2scjJ3nmFw2XE/g6HaO1ge2EaSmXgdj4jHC JeGQ== X-Gm-Message-State: AOAM533OQl88Fg2FWBa3S5EfXWe/q3PMV0u3D9bCPo9Le5lQKveEWdmQ KF540ouSODba5akHRepZGrBtyphQoQ07SA== X-Received: by 2002:a63:5907:0:b0:382:2f93:5467 with SMTP id n7-20020a635907000000b003822f935467mr9381857pgb.460.1647796320720; Sun, 20 Mar 2022 10:12:00 -0700 (PDT) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id q12-20020a17090aa00c00b001bc6f1baaaesm17149697pjp.39.2022.03.20.10.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 10:12:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-7.1 26/36] linux-user: Use qemu_set_log_filename_flags Date: Sun, 20 Mar 2022 10:11:25 -0700 Message-Id: <20220320171135.2704502-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320171135.2704502-1-richard.henderson@linaro.org> References: <20220320171135.2704502-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::533 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Perform all logfile setup in one step. Signed-off-by: Richard Henderson --- linux-user/main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 2bdee78019..75d13eff97 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -85,6 +85,7 @@ static bool enable_strace; * Used to support command line arguments overriding environment variables. */ static int last_log_mask; +static const char *last_log_filename; /* * When running 32-on-64 we should make sure we can fit all of the possible @@ -257,7 +258,7 @@ static void handle_arg_dfilter(const char *arg) static void handle_arg_log_filename(const char *arg) { - qemu_set_log_filename(arg, &error_fatal); + last_log_filename = arg; } static void handle_arg_set_env(const char *arg) @@ -643,7 +644,6 @@ int main(int argc, char **argv, char **envp) int i; int ret; int execfd; - int log_mask; unsigned long max_reserved_va; bool preserve_argv0; @@ -677,10 +677,9 @@ int main(int argc, char **argv, char **envp) optind = parse_args(argc, argv); - log_mask = last_log_mask | (enable_strace ? LOG_STRACE : 0); - if (log_mask) { - qemu_set_log(log_mask, &error_fatal); - } + qemu_set_log_filename_flags(last_log_filename, + last_log_mask | (enable_strace * LOG_STRACE), + &error_fatal); if (!trace_init_backends()) { exit(1);