From patchwork Sun Sep 25 10:51:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 609143 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1276544pvb; Sun, 25 Sep 2022 04:17:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4zswotifq555vU2SfW5QHEgOMC2Roquk2CQcIG4dY3Y+zYCchbGz5J1CWvv9tCkJxDZJ0d X-Received: by 2002:a05:620a:24d6:b0:6cd:f2d9:4a59 with SMTP id m22-20020a05620a24d600b006cdf2d94a59mr11231801qkn.457.1664104648608; Sun, 25 Sep 2022 04:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664104648; cv=none; d=google.com; s=arc-20160816; b=Y7UI/2QWwMxaEgSw+LrjYL9GRK5EhoIKhSpXnYYGugIDjD17MWsfgdmwvdRDeHY/k/ 1tUVtZOfSSKSFK3q+5PKFGUDDLMy3u6EoH5GvJAlvGIXT5kdzMxVAf4M22nonRSiUcDp UAGArFBxte9Qi5qc0KTKowgRAk+UOxioh760/eBwMmwX7RkertHrRTOCLx1IZJd0OmQn k8JOTHDZ72O1DtHM7B5EIm4lIK1NVrciki5COiy4aUjAVPfkH/R+HwTAysi3ZnDBGdIl yO2FHTvir7TXfUkSwXE9X4YFtJYRhJLWnJsLOva/YwmNm/CO7YjlZGKi8e0UvVteRqWq hFdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=Qu/eHdUzCrm8sOsOyH36Ac0H9NLVfy2uiRVSlOgtXZQ=; b=qAxdK4UcsVIjE/DpQ8chCwtHVi39pcNjHd9oRx19lU9SxjcWYdBpx3aM1go8yT7JLl 7J8qfEf4vMDFPzwolzuLh3rPbh8n9EnxcGR97bVKtgN/LBaAOmLxAoDzGKxay9Eh1hTp Xw3TFxnSCgK999ZsigxZhPSYg/+erkwO9N0m+cK+Rd8aXSc8oYuSuj2z6Kcp8TeL4Kjg roXhBis29GtIJCOufTPm6klUCkxlNcjLr2YCBg9ok1/m3oSizgFc/NR3+nZoINvYAhtK iYpku844nMVfKTJr1FEUnruPTVWgzbDYAwRgR27sxxQ3b+zPUf9R0k3pdNNeqORBpAZY aYxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YvqSvLdl; 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 iw9-20020a0562140f2900b00496d4a5cdc9si7876339qvb.522.2022.09.25.04.17.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Sep 2022 04:17:28 -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=YvqSvLdl; 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]:36554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocPdY-0006UE-3u for patch@linaro.org; Sun, 25 Sep 2022 07:17:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocPFI-0003J5-TL for qemu-devel@nongnu.org; Sun, 25 Sep 2022 06:52:28 -0400 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]:43556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocPFH-0000PC-G8 for qemu-devel@nongnu.org; Sun, 25 Sep 2022 06:52:24 -0400 Received: by mail-qv1-xf35.google.com with SMTP id s13so2772816qvq.10 for ; Sun, 25 Sep 2022 03:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Qu/eHdUzCrm8sOsOyH36Ac0H9NLVfy2uiRVSlOgtXZQ=; b=YvqSvLdlCrafz3z4dcAdqPICcwIhe28uTPd00A8FumCnzAGSErcNkCDW0iHa3EOO1K QIIcTar0OHSCHHmkZzbSZtI8glPZ/TY93T+bqkKuMwM+eLUtdiubnIEA+8NKEmdJxCiK uGVcWlbWppB2wyTKZ1uHK5S1pVbCSnDLCfaLyMDzga1q9/3Nff1olTfEviv2ESJsfRec +jcVPqDIqAT7JBDZVTWY6EmKiOBkkW7lVBp2wg9B1aLYf8jgUA+jyCZPCT+GvHAKX2aP vztPdncuGzjfTtESy1Y3N1hKKNPVM38+H41bkTVcn0jZfxdqXwOAsH9fZZ/BI1tHeOsi v+Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Qu/eHdUzCrm8sOsOyH36Ac0H9NLVfy2uiRVSlOgtXZQ=; b=cn5Mw0rccxU7KdiT5qwgGitRoXVY8gCYMeT+B6fbtTMkuzTx95aR8M48luQlz6MaaE 7FTkq0c2Fu4lUBZoEy1AgZJZZhBaAspgRax1o9w44doZfVlwBMcA6Tq23Oi1bA/67rU7 cd9ECUTGms+su9pXdx/dCDq+7uksh7iCkahQzHmnoUFiQKAyz3v8JNWME2iQ20isPfMa vdaJ7cNA7ZA/YFhUYODTNF07CaS/8m+CydJis9/4XE/g/RlX3+g6+f37rn7T2DO6wLbG 0h9F0djW5Q2o4eqebCe7pxZKzRH5ASp7SlgG+D84tAMe1jNRoYg+prEWvGRNGmcbvbCk IL/A== X-Gm-Message-State: ACrzQf1B50eVxcZMogSLP9zIbr0+xfoaphXgFOJschDMjDruKEGKpbsP HgIz/uHVkm3uaACIq9B5nvb+olPVArHu6A== X-Received: by 2002:a05:6214:29c2:b0:4ad:6f9b:9a0b with SMTP id gh2-20020a05621429c200b004ad6f9b9a0bmr13743062qvb.31.1664103142426; Sun, 25 Sep 2022 03:52:22 -0700 (PDT) Received: from stoup.. ([2605:ef80:80a9:5c0e:1ec2:d482:4986:8538]) by smtp.gmail.com with ESMTPSA id u15-20020a05620a0c4f00b006cf19068261sm10061132qki.116.2022.09.25.03.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 03:52:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v5 17/17] accel/tcg: Split log_cpu_exec into inline and slow path Date: Sun, 25 Sep 2022 10:51:24 +0000 Message-Id: <20220925105124.82033-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220925105124.82033-1-richard.henderson@linaro.org> References: <20220925105124.82033-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=richard.henderson@linaro.org; helo=mail-qv1-xf35.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 7fe42269ea..318dbc1a2c 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -292,12 +292,11 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, return tb; } -static inline void log_cpu_exec(target_ulong pc, CPUState *cpu, - const TranslationBlock *tb) +static void log_cpu_exec_slow(CPUState *cpu, const TranslationBlock *tb) { - if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_CPU | CPU_LOG_EXEC)) - && qemu_log_in_addr_range(pc)) { + target_ulong pc = tb_pc_log(tb); + if (qemu_log_in_addr_range(pc)) { qemu_log_mask(CPU_LOG_EXEC, "Trace %d: %p [" TARGET_FMT_lx "/" TARGET_FMT_lx "/%08x/%08x] %s\n", @@ -324,6 +323,13 @@ static inline void log_cpu_exec(target_ulong pc, CPUState *cpu, } } +static inline void log_cpu_exec(CPUState *cpu, const TranslationBlock *tb) +{ + if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_CPU | CPU_LOG_EXEC))) { + log_cpu_exec_slow(cpu, tb); + } +} + static bool check_for_breakpoints(CPUState *cpu, target_ulong pc, uint32_t *cflags) { @@ -421,7 +427,7 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env) return tcg_code_gen_epilogue; } - log_cpu_exec(pc, cpu, tb); + log_cpu_exec(cpu, tb); return tb->tc.ptr; } @@ -444,7 +450,7 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) TranslationBlock *last_tb; const void *tb_ptr = itb->tc.ptr; - log_cpu_exec(tb_pc_log(itb), cpu, itb); + log_cpu_exec(cpu, itb); qemu_thread_jit_execute(); ret = tcg_qemu_tb_exec(env, tb_ptr);