From: Athira Rajeev <atrajeev@linux.ibm.com>
To: acme@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com,
irogers@google.com, namhyung@kernel.org
Cc: linux-perf-users@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
maddy@linux.ibm.com, atrajeev@linux.ibm.com, kjain@linux.ibm.com,
disgoel@linux.vnet.ibm.com, hbathini@linux.vnet.ibm.com,
Aditya.Bodkhe1@ibm.com, Tejas.Manhas1@ibm.com
Subject: [PATCH 2/2] tools/perf/powerpc: Use return code from disasm_line__parse
Date: Tue, 4 Mar 2025 21:11:14 +0530 [thread overview]
Message-ID: <20250304154114.62093-2-atrajeev@linux.ibm.com> (raw)
In-Reply-To: <20250304154114.62093-1-atrajeev@linux.ibm.com>
In disasm_line__parse_powerpc() , return code from function
disasm_line__parse() is ignored. This will result in bad results
if the disasm_line__parse fails to disasm the line. Use
the return code to fix this.
Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
---
tools/perf/util/disasm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
index a53e8c4e5bca..8f0eb56c6fc6 100644
--- a/tools/perf/util/disasm.c
+++ b/tools/perf/util/disasm.c
@@ -976,6 +976,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar
char *tmp_raw_insn, *name_raw_insn = skip_spaces(line);
char *name = skip_spaces(name_raw_insn + RAW_BYTES);
int disasm = 0;
+ int ret = 0;
if (args->options->disassembler_used)
disasm = 1;
@@ -984,7 +985,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar
return -1;
if (disasm)
- disasm_line__parse(name, namep, rawp);
+ ret = disasm_line__parse(name, namep, rawp);
else
*namep = "";
@@ -998,7 +999,7 @@ static int disasm_line__parse_powerpc(struct disasm_line *dl, struct annotate_ar
if (disasm)
dl->raw.raw_insn = be32_to_cpu(dl->raw.raw_insn);
- return 0;
+ return ret;
}
static void annotation_line__init(struct annotation_line *al,
--
2.43.5
next prev parent reply other threads:[~2025-03-04 15:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 15:41 [PATCH 1/2] tools/perf: Add field to annotation options to determine disassembler used Athira Rajeev
2025-03-04 15:41 ` Athira Rajeev [this message]
2025-03-05 11:52 ` [PATCH 2/2] tools/perf/powerpc: Use return code from disasm_line__parse Venkat Rao Bagalkote
2025-03-05 11:57 ` [PATCH 1/2] tools/perf: Add field to annotation options to determine disassembler used Venkat Rao Bagalkote
2025-03-07 18:09 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250304154114.62093-2-atrajeev@linux.ibm.com \
--to=atrajeev@linux.ibm.com \
--cc=Aditya.Bodkhe1@ibm.com \
--cc=Tejas.Manhas1@ibm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=disgoel@linux.vnet.ibm.com \
--cc=hbathini@linux.vnet.ibm.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kjain@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).