Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp234520lqz; Fri, 29 Mar 2024 14:58:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUngqufc2BYQYhWcXpciT6o5Ap72MlTp9diVcGWjHmWxMMBIGltctC8HpkAIAuyJgYfrGPK1WEEMXHG7UPDtfF/6KnPR72FlTXIPCEqEA== X-Google-Smtp-Source: AGHT+IFH5H7gfVWdXZP1Htb11Cz6HVMm86VIx6PqIlVJBCUxseonZahUX3g85AGoN3BkvLiVAQ6L X-Received: by 2002:ac8:59c5:0:b0:431:f7fc:dd0c with SMTP id f5-20020ac859c5000000b00431f7fcdd0cmr4043348qtf.68.1711749512003; Fri, 29 Mar 2024 14:58:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711749511; cv=pass; d=google.com; s=arc-20160816; b=jEje5HerFq+SQ++fARRfxlUgTTM6wC02teC67l3PIdEUjZ3Kyai9rPbWptbmRZxEmz LyETcaGpE2ORtjsABGU1fpJwkJV2xFKh2rgbRyzsLLp3f+Kub10kD6dIsiODA2htNOzC r6CmfRJvvkg4sWNCCzIaMAQBhj3WTgZ2mnqMk1Gg88x4jlHIzSG8AhFbFfSuVE13mmmI 9kxHsuWVFFXT5K+iV7ofIo0niIBvtWVp17XwK1NnC50SMMKkwLNBbKpEW+Q46gaPWZ/v ZQiqmy0PTMIkUsuHue8HDXSvvsPTtF+N/wwxxe468/i1vzBYEOcN0r6D7Qbwtm6nlW7P GVAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zKZKJIDcBKedZrrgwLHNknFor8ai0DcgMQoE0duw558=; fh=fHhbvXgCev/wpffLVpfaAi8pPyv7hrTyhVPgsZ7HNrs=; b=bsg4M2xK/HfairGruHf1RC+co7nLcxotPAwhRqHMZV4gGgMfwiY+0ZGpWbHXE41cpS PrrCgtCGRkqXJ5CbnPw+YtK7p5O/r8mRCkod7rmo51a8u3JteiqAAu3cP/1DCDCbtJLe AFQsxRxlQXXPNfycMohrQOB3YcYYA5IE30wVO6RQFgQ9IpxlyjBG1VTcLy31/ilBAv/y +tC2/JaQbU9NMHb84WJ9H5K712b9mvQEVuQOhtBINP04s+pnmxAX6uuCRKaBSck0yB3I WiuVUjZsbTGi6p7wyqFja5xnHyn/acgN2FUjGOXzHRZOrZRvcVqw6aHxaOVpJAUdkiyU b5kA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r39vM8QI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-125465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s28-20020a05622a1a9c00b004312f906f71si4675831qtc.463.2024.03.29.14.58.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 14:58:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r39vM8QI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-125465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B51A81C20FFA for ; Fri, 29 Mar 2024 21:58:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9337913CFB1; Fri, 29 Mar 2024 21:58:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r39vM8QI" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6EC213CC4C; Fri, 29 Mar 2024 21:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711749494; cv=none; b=O5OhXP4NLJQ2FTNg+7GMhVJAwkwYmKzWzSjimT53Qqmmq5C6HCnGvtA61Nv94iEFuu+hEUG5q56fV2V0Ph21uppFNhuXtAJPR7zFL9NFdrNU7wHFFdNr1oF8DqVfBgMs7lJ5mW6Vsd5aUYe6xFQk/jntOD9O+5ExwT52SwvTnAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711749494; c=relaxed/simple; bh=Yuksmztv1iAfN+x6okM3pQalu3vHmel1McQJiArxC8Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=md+aRUvA0w2kmDxWCV5aA5jVuZ626cUdAtHXsmOMqHEi9ozuL9mJi+R70AyNPTBB2EXwSz7bjE8y1bY/NZIGjbJ1qlLFRSgfeT+7Ae7ngv/A2VYHODcjsEqe+5GHROktbfvBeUHflclBn+wddWflP08EDr1ZGSeVEv0nwgJo3Q8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r39vM8QI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFD25C43390; Fri, 29 Mar 2024 21:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711749494; bh=Yuksmztv1iAfN+x6okM3pQalu3vHmel1McQJiArxC8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r39vM8QIkfUs/a0eGQCB598c4fl95aRuAe8k6SZBU1flFYvJlAej4c/ZehBEF1XpU eLaaPuF7CmO8MuaNKoV/AloH7c+5aXKuaOJqzM572pcRH1Jmf9cAgtCgBeon/7K9qL IROC73PuGk+lGlWM1za7Wu5Wksm7O19SCXdWzklUD8rPRfN080KLeRN+mtfxUk7mNR VHA9u1fw11t+YNGaF/oJNBhk9NBLKiLUcBkaqfh5qXC+oE9B4ccJlTWfcNC2RYzTJ5 6F1KFuWz+ueZRA4vnm1ldiw7dNUmY31NjvlfdkfTqumJtWEnVPhP0MQ4D3O9awkOTP 7abyOwdQ6mUqQ== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: [PATCH v2 1/5] perf annotate: Use ins__is_xxx() if possible Date: Fri, 29 Mar 2024 14:58:08 -0700 Message-ID: <20240329215812.537846-2-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240329215812.537846-1-namhyung@kernel.org> References: <20240329215812.537846-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is to prepare separation of disasm related code. Use the public ins API instead of checking the internal data structure. Tested-by: Ian Rogers Signed-off-by: Namhyung Kim --- tools/perf/util/annotate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 64e54ff1aa1d..986c499150ef 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -3665,7 +3665,7 @@ int annotate_get_insn_location(struct arch *arch, struct disasm_line *dl, struct annotated_op_loc *op_loc; int i; - if (!strcmp(dl->ins.name, "lock")) + if (ins__is_lock(&dl->ins)) ops = dl->ops.locked.ops; else ops = &dl->ops; @@ -3763,7 +3763,7 @@ static struct disasm_line *find_disasm_line(struct symbol *sym, u64 ip, * llvm-objdump places "lock" in a separate line and * in that case, we want to get the next line. */ - if (!strcmp(dl->ins.name, "lock") && + if (ins__is_lock(&dl->ins) && *dl->ops.raw == '\0' && allow_update) { ip++; continue; @@ -4093,10 +4093,10 @@ static bool process_basic_block(struct basic_block_data *bb_data, if (dl == last_dl) break; /* 'return' instruction finishes the block */ - if (dl->ins.ops == &ret_ops) + if (ins__is_ret(&dl->ins)) break; /* normal instructions are part of the basic block */ - if (dl->ins.ops != &jump_ops) + if (!ins__is_jump(&dl->ins)) continue; /* jump to a different function, tail call or return */ if (dl->ops.target.outside) -- 2.44.0.478.gd926399ef9-goog