Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp767992lqh; Thu, 28 Mar 2024 16:20:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU633CXG5hIlotZZTWO/PsO4r1TDujzVAr9Ey84ycR3gf+s6qL9HlJ7Ld0JsaP+jL2RMbXJASPXmtXaK0/qystZUldNdc+sDY+ev9oXYA== X-Google-Smtp-Source: AGHT+IHP8XZHHQ+rcsRli5PjWt/dwF0PBYzjZWdfuThEAihsd4yu525fm6aGMKx3l6ane2T+PfzF X-Received: by 2002:ad4:5587:0:b0:691:4425:c7a3 with SMTP id f7-20020ad45587000000b006914425c7a3mr610666qvx.53.1711668029653; Thu, 28 Mar 2024 16:20:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711668029; cv=pass; d=google.com; s=arc-20160816; b=hcvh8KBJ1hE0Px+pTMWUR8zwCXOYOV3xrKJiOBPt5aPWFXUqKeBpnBJ+49AYcukGRV FN1xujrVHRRmBMRQPOI+tXZalc73crMYkPz+3BmOppqTbJDhh/BAvc9gyfmIZhs9/UPP 1SjqQtzLf9zc3Ga/k/jg41ghSm7Axi/HSjmaraAnalxpy4AZ4XS7dXGLXHeXR0jJTNoe vC9IGtmccAe6cBw9mNOHEfIFoXiYH7mhcXyjv3kQmVTMtDTeUkC0uLgQArLusTmMwjfL v8eJuhwZEirdN9EHLrRguEHXtpknnBVvfHMvNqNiP+34QI2xIbbnSPY9a/aspG8/NaKm k4eQ== 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=XHz8GG35lwyG5GK+13X3mawacLm3WiuAX7GGN21nUcM=; fh=fHhbvXgCev/wpffLVpfaAi8pPyv7hrTyhVPgsZ7HNrs=; b=B2fIS5WHAq5wUQgnceqgRf1CFN/q95f/O8JvXNel6DTPikL16wjkAuGP9msL1tmK+G Jr5W66s7ViRsHAlX21+yDGLg2vo8DGTI5NqTWPdlJx1AYEMjHwCSLsq3Xt4jcZQAwsaL L+xWTxTxMh4VjNcDOjYhYXcNh/2hgazbqLCqPJ3cSCNLg61lAp1GXeZn0hVSBSlXhLAV oflMSsQUi2v6X496lk+UM1hP+XBkI9BIVLLbo1HFL4myDDxbeAQ26sM3S2xDL7ns9gPl zXk2kZO3dZu+cHOqVS6WfB4Ix44PhpkiweworhqcgteeoovauHpGVfcgacqRzmgH6iVD shDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gDCIYGHj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123818-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123818-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. [147.75.199.223]) by mx.google.com with ESMTPS id c24-20020a056214071800b00690cf7612besi2441535qvz.413.2024.03.28.16.20.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 16:20:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123818-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gDCIYGHj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123818-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123818-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 5F8191C26DF2 for ; Thu, 28 Mar 2024 23:20:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 881A4137932; Thu, 28 Mar 2024 23:20:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gDCIYGHj" 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 B15257F471; Thu, 28 Mar 2024 23:20:11 +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=1711668011; cv=none; b=JErVEhesqi1WXXi7Kk1HzRm8jCd5tmb3meVk9BhAao/QQFennYwYJJd/KZ/CoPdvcK7toVeinLcrSDeMn3gqYL3Sx/7KKHzZKw9UjD/Gt9WF7XEU2n//efL7S/+/05KskocG4fPDF0tIE6I8tO+Qeo54Cof3QLhT/8yNdKyD8FA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711668011; c=relaxed/simple; bh=Le/6DqZN+PpjTvtonv6SHoMB847GalZIUlDBHCdNYKk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qQnWVhllVh1lMn0fa2sdzTceVErhcPU1wJqSLxOiJ3QNRlpiC/5C1cWYJaXQEHPGK1VvANWMzRi+4F4kprQaJq26aWjoNKrxR/rJCqZc4Oo7iSwqseUttBuQD7RZX2QH3cc5Iv6uYYcFW1W873GE/O5IVLjY2B3a1gNhWXrsXEU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gDCIYGHj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E741CC433A6; Thu, 28 Mar 2024 23:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711668011; bh=Le/6DqZN+PpjTvtonv6SHoMB847GalZIUlDBHCdNYKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gDCIYGHjpl901r/xSMvH/8c0KQ99TPWM3copLg4ZT43+Gsnjv/jczE+hx75RykQSR c+/ov86G6TAu9vcR71LMaW+eWXW2nhCCNFHGtJnJY9BYyyF7258sGW5/eUQbXhmoMV GCwe9VQVfdbzcMgOJ5CLP1gFnrpqwS5sqFcH7re3ye5Je+7k5V9RrEjaXiNI/EfY8e o6ZmiaYObg0HRjuNTse8e4JDYniGXlIVysFfsD70SHt0fXtjQ5vY6l1IQYKJB8iH4o itbIDJIdQePIUnH4GiYM6v8pqm0B42BpnyoPEfw+PfzBJIKNCKnmit8YKbdL6iwSrF BYzLzh5gFLueg== 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 1/4] perf annotate: Use ins__is_xxx() if possible Date: Thu, 28 Mar 2024 16:20:06 -0700 Message-ID: <20240328232009.466018-2-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240328232009.466018-1-namhyung@kernel.org> References: <20240328232009.466018-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. 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