From patchwork Tue Oct 4 13:01:23 2022 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: 612264 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp200162pvb; Tue, 4 Oct 2022 07:09:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4gJXKQ2q7i8D72hpYIrct7IRXxUNxRXtsmri1Xlrx8r1bhN3YUUP+koPlfFBIRu9VetCB2 X-Received: by 2002:a05:620a:a17:b0:6cb:e23e:9268 with SMTP id i23-20020a05620a0a1700b006cbe23e9268mr17363170qka.333.1664892591899; Tue, 04 Oct 2022 07:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664892591; cv=none; d=google.com; s=arc-20160816; b=PaoC2bue7hgfm1JPz6lQMb8Sh9HMP09eC1nS7jE0DF8oHqjVecRkqz1R+Cr9h3QcPz 4/Oy9/7ZokHLvIoNyag5nqZS+GGxPmPlH2MlyAIYvYky1DhodmTO7JvOsosn1UVQsvg7 kXw3D0mHg0iSLKksdx+9Than3qW/vZElmz1I13MAdMwz0pNDJ4zNkYx/YoxSwjUgbH79 EZJUVC/pJmOc5VhUzPfh9WxQ0xJPNwVPfnsdzW7Cb7vVzyVD39BAMz0Id6TkYf/zGVBg m2ZGD8hER6XOsEhobLnDn6JQz5lpwbHydVsnvIoVnv7DoXxCWtd5Ak/FgRQmD7pT/vNY reog== 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=9LqzuxSgRUEWhI49Vb5gMhdtkHKyysd2sMCsQOX6w2Q=; b=IX6n/VnoRJailbxtnR5B/uF5ks043cNA9hQXHePgYeG25yovjvvrfcV9eRGbg4yWz3 ZLdEkIYKGt8w1ZQV0yTy6M847Q+uPNqQMHZqkfdbvC9vsZIePOY3IQCecFFLSNtYAXCi 74+naroHI6cJV/hyVEl6mjvaIi8Ga5hBAL/I3NIEsOlblgs2PN9y/2X02kygZXQTxvMJ KsJxMfNto9fm2XfOGm71Aw8YYyv+4mb+BT/5lz2IAonzJhE6MbU5/HOu/VLqErOzFnnA 9SL/B+QMu3FiVRTyjltB87J9t4PmiotGtQGGiHZsfbHorzRtCHnP3y6r6++o5sSXmlj0 gZLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lIHIeBrq; 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 z20-20020a05620a08d400b006ce7e30377bsi4636350qkz.182.2022.10.04.07.09.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Oct 2022 07:09:51 -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=lIHIeBrq; 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]:40130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oficJ-0006Ha-45 for patch@linaro.org; Tue, 04 Oct 2022 10:09:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofhq3-0001J1-Ht for qemu-devel@nongnu.org; Tue, 04 Oct 2022 09:20:03 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofhq0-0001pm-RI for qemu-devel@nongnu.org; Tue, 04 Oct 2022 09:19:58 -0400 Received: by mail-wr1-x42b.google.com with SMTP id bu30so1403122wrb.8 for ; Tue, 04 Oct 2022 06:19:56 -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=9LqzuxSgRUEWhI49Vb5gMhdtkHKyysd2sMCsQOX6w2Q=; b=lIHIeBrqv7USjW7i7efOXs46rVW/DvGIO3QBl8zayH1LDJ5nDGGXRuXN6f5UaKvWgj FCnPP66IotfsUSFKPn6paCvbGXFktCoIxOZcCssD0Q+RI1NFVvVrsXrRo5ZG08brvoXY YjXOF+eulpN52DIZQ05W8vOqi0z8cyFOZB1OLQATpQktPQje4ljR5EEfulE1FIhTL63s 1UHsm63Sohlnlbcg4PbGZ46lmbVVKnFiAe9xZTLh1XdnZMXuj4AlQRo2xK4TzyBpPn4o zEaAZqEyg861eUdL3j2y5a2haWfPl2qXdMTgeHXA+wGPEOtR5LrcSfP8udCZ72GV4XtR PAiA== 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=9LqzuxSgRUEWhI49Vb5gMhdtkHKyysd2sMCsQOX6w2Q=; b=vzjqXL7+uZNVozkBrWgCNr4Cbm93iAFPN3kLj9YzHIygm+pROW/0a4RFnozenlcsZD DQNGYNagESSv+D1nAZWhx7NYvcRx1+ot2jVc7RNu3IX3Q7D5dPswZ50jh5cWM57c9Zov 8L0o+ic/Rc1LsWmP1vhLixdqlOXGq9b0Kchm12+V4igDOdCphfMoEYqdB6yKFYFMBA/c q23UmqfqrPILrHpvAAvtucH7gXoQrdeG0puOQ13q9M0XVZC9PGxi3pUd93JOnTgTqxY8 4HA7KEqaVbtDYb6aKmOxregU+AjWf574fyMbRGNpi0siMppOV1cUssp2p3g+pn/9gXYb w9sw== X-Gm-Message-State: ACrzQf3pzLaJI4RlfRhY91wZiGRByN8Gzq96pt4dVbp5pKCe5pCBLbYw kH0Y1+7W8qpjG0bQpqIH30B0WQ== X-Received: by 2002:a5d:5944:0:b0:22e:3c67:75de with SMTP id e4-20020a5d5944000000b0022e3c6775demr6636044wri.5.1664889596059; Tue, 04 Oct 2022 06:19:56 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c339400b003a5c999cd1asm17742276wmp.14.2022.10.04.06.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 06:19:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AD3961FFDB; Tue, 4 Oct 2022 14:01:42 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Mahmoud Mandour Subject: [PULL 39/54] contrib/plugins: reset skip when matching in execlog Date: Tue, 4 Oct 2022 14:01:23 +0100 Message-Id: <20221004130138.2299307-40-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004130138.2299307-1-alex.bennee@linaro.org> References: <20221004130138.2299307-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.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" The purpose of the matches was to only track the execution of instructions we care about. Without resetting skip to the value at the start of the block we end up dumping all instructions after the match with the consequent load on the instrumentation. Signed-off-by: Alex Bennée Cc: Alexandre Iooss Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220929114231.583801-40-alex.bennee@linaro.org> diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index e659ac9cbb..1b3bb7ebba 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -88,7 +88,7 @@ static void vcpu_insn_exec(unsigned int cpu_index, void *udata) static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) { struct qemu_plugin_insn *insn; - bool skip = (imatches || amatches) ? true : false; + bool skip = (imatches || amatches); size_t n = qemu_plugin_tb_n_insns(tb); for (size_t i = 0; i < n; i++) { @@ -147,6 +147,9 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) /* Register callback on instruction */ qemu_plugin_register_vcpu_insn_exec_cb(insn, vcpu_insn_exec, QEMU_PLUGIN_CB_NO_REGS, output); + + /* reset skip */ + skip = (imatches || amatches); } }