From: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
To: acme@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com,
irogers@google.com, namhyung@kernel.org,
segher@kernel.crashing.org, christophe.leroy@csgroup.eu
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, akanksha@linux.ibm.com,
maddy@linux.ibm.com, atrajeev@linux.vnet.ibm.com,
kjain@linux.ibm.com, disgoel@linux.vnet.ibm.com
Subject: [PATCH V3 09/14] tools/perf: Add more instructions for instruction tracking
Date: Sat, 1 Jun 2024 11:39:36 +0530 [thread overview]
Message-ID: <20240601060941.13692-10-atrajeev@linux.vnet.ibm.com> (raw)
In-Reply-To: <20240601060941.13692-1-atrajeev@linux.vnet.ibm.com>
Add few more instructions and use opcode as search key
to find if it is supported by the architecture. Added ones
are: addi, addic, addic., addis, subfic and mulli
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
tools/perf/arch/powerpc/annotate/instructions.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tools/perf/arch/powerpc/annotate/instructions.c b/tools/perf/arch/powerpc/annotate/instructions.c
index bec8ab0ee18d..db72148eb857 100644
--- a/tools/perf/arch/powerpc/annotate/instructions.c
+++ b/tools/perf/arch/powerpc/annotate/instructions.c
@@ -172,6 +172,14 @@ static struct insn_offset arithmetic_ins_op_31[] = {
{ .name = "DIV_W_XO_FORM", .value = 491, },
};
+static struct insn_offset arithmetic_two_ops[] = {
+ { .name = "mulli", .value = 7, },
+ { .name = "subfic", .value = 8, },
+ { .name = "addic", .value = 12, },
+ { .name = "addic.", .value = 13, },
+ { .name = "addi", .value = 14, },
+ { .name = "addis", .value = 15, },
+};
static int cmp_offset(const void *a, const void *b)
{
@@ -212,6 +220,12 @@ static struct ins_ops *check_ppc_insn(int raw_insn)
if (PPC_21_30(raw_insn) == 444)
return &arithmetic_ops;
}
+ } else {
+ mem_insns_31_opcode.value = opcode;
+ ret = bsearch(&mem_insns_31_opcode, arithmetic_two_ops, ARRAY_SIZE(arithmetic_two_ops),
+ sizeof(arithmetic_two_ops[0]), cmp_offset);
+ if (ret != NULL)
+ return &arithmetic_ops;
}
return NULL;
--
2.43.0
WARNING: multiple messages have this Message-ID (diff)
From: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
To: acme@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com,
irogers@google.com, namhyung@kernel.org,
segher@kernel.crashing.org, christophe.leroy@csgroup.eu
Cc: atrajeev@linux.vnet.ibm.com, kjain@linux.ibm.com,
linux-kernel@vger.kernel.org, akanksha@linux.ibm.com,
linux-perf-users@vger.kernel.org, maddy@linux.ibm.com,
disgoel@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH V3 09/14] tools/perf: Add more instructions for instruction tracking
Date: Sat, 1 Jun 2024 11:39:36 +0530 [thread overview]
Message-ID: <20240601060941.13692-10-atrajeev@linux.vnet.ibm.com> (raw)
In-Reply-To: <20240601060941.13692-1-atrajeev@linux.vnet.ibm.com>
Add few more instructions and use opcode as search key
to find if it is supported by the architecture. Added ones
are: addi, addic, addic., addis, subfic and mulli
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
tools/perf/arch/powerpc/annotate/instructions.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tools/perf/arch/powerpc/annotate/instructions.c b/tools/perf/arch/powerpc/annotate/instructions.c
index bec8ab0ee18d..db72148eb857 100644
--- a/tools/perf/arch/powerpc/annotate/instructions.c
+++ b/tools/perf/arch/powerpc/annotate/instructions.c
@@ -172,6 +172,14 @@ static struct insn_offset arithmetic_ins_op_31[] = {
{ .name = "DIV_W_XO_FORM", .value = 491, },
};
+static struct insn_offset arithmetic_two_ops[] = {
+ { .name = "mulli", .value = 7, },
+ { .name = "subfic", .value = 8, },
+ { .name = "addic", .value = 12, },
+ { .name = "addic.", .value = 13, },
+ { .name = "addi", .value = 14, },
+ { .name = "addis", .value = 15, },
+};
static int cmp_offset(const void *a, const void *b)
{
@@ -212,6 +220,12 @@ static struct ins_ops *check_ppc_insn(int raw_insn)
if (PPC_21_30(raw_insn) == 444)
return &arithmetic_ops;
}
+ } else {
+ mem_insns_31_opcode.value = opcode;
+ ret = bsearch(&mem_insns_31_opcode, arithmetic_two_ops, ARRAY_SIZE(arithmetic_two_ops),
+ sizeof(arithmetic_two_ops[0]), cmp_offset);
+ if (ret != NULL)
+ return &arithmetic_ops;
}
return NULL;
--
2.43.0
next prev parent reply other threads:[~2024-06-01 6:10 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-01 6:09 [PATCH V3 00/14] Add data type profiling support for powerpc Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 01/14] tools/perf: Move the data structures related to register type to header file Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 02/14] tools/perf: Add "update_insn_state" callback function to handle arch specific instruction tracking Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 03/14] tools/perf: Add support to capture and parse raw instruction in powerpc using dso__data_read_offset utility Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 04/14] tools/perf: Use sort keys to determine whether to pick objdump to disassemble Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 05/14] tools/perf: Add disasm_line__parse to parse raw instruction for powerpc Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-06 6:33 ` Namhyung Kim
2024-06-06 6:33 ` Namhyung Kim
2024-06-08 7:08 ` Athira Rajeev
2024-06-08 7:08 ` Athira Rajeev
2024-06-08 8:58 ` Christophe Leroy
2024-06-08 8:58 ` Christophe Leroy
2024-06-12 8:42 ` Athira Rajeev
2024-06-12 8:42 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 06/14] tools/perf: Update parameters for reg extract functions to use raw instruction on powerpc Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-06 6:52 ` Namhyung Kim
2024-06-06 6:52 ` Namhyung Kim
2024-06-08 7:08 ` Athira Rajeev
2024-06-08 7:08 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 07/14] tools/perf: Add support to identify memory instructions of opcode 31 in powerpc Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 08/14] tools/perf: Add some of the arithmetic instructions to support instruction tracking " Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev [this message]
2024-06-01 6:09 ` [PATCH V3 09/14] tools/perf: Add more instructions for instruction tracking Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 10/14] tools/perf: Update instruction tracking for powerpc Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-06 6:53 ` Namhyung Kim
2024-06-06 6:53 ` Namhyung Kim
2024-06-08 7:05 ` Athira Rajeev
2024-06-08 7:05 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 11/14] tools/perf: Add support to use libcapstone in powerpc Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-03 16:30 ` Ian Rogers
2024-06-03 16:30 ` Ian Rogers
2024-06-03 16:58 ` Adrian Hunter
2024-06-03 16:58 ` Adrian Hunter
2024-06-10 12:20 ` Athira Rajeev
2024-06-10 12:20 ` Athira Rajeev
2024-06-11 16:29 ` Adrian Hunter
2024-06-11 16:29 ` Adrian Hunter
2024-06-08 7:05 ` Athira Rajeev
2024-06-08 7:05 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 12/14] tools/perf: Add support to find global register variables using find_data_type_global_reg Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 13/14] tools/perf: Add support for global_die to capture name of variable in case of register defined variable Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
2024-06-01 6:09 ` [PATCH V3 14/14] tools/perf: Set instruction name to be used with insn-stat when using raw instruction Athira Rajeev
2024-06-01 6:09 ` Athira Rajeev
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=20240601060941.13692-10-atrajeev@linux.vnet.ibm.com \
--to=atrajeev@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=akanksha@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=disgoel@linux.vnet.ibm.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kjain@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=namhyung@kernel.org \
--cc=segher@kernel.crashing.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.