perf annotate: Add some of the arithmetic instructions to support instruction trackin...
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Thu, 18 Jul 2024 08:43:52 +0000 (14:13 +0530)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 31 Jul 2024 19:12:59 +0000 (16:12 -0300)
commitcd0b6f67c4ab1aecdfedb277c42880fcffe75ace
tree7b5512b99462e27430d30cf43c63af0a9e49eb9e
parentace7d681d82d8ac6cc1c9646b19ab4cca7be0d90
perf annotate: Add some of the arithmetic instructions to support instruction tracking in powerpc

Data-type profiling has the concept of instruction tracking.

Example sequence in powerpc:

ld      r10,264(r3)
mr      r31,r3
<<after some sequence>
ld      r9,312(r31)

or differently

lwz r10,264(r3)
add r31, r3, RB
lwz r9, 0(r31)

If a sample is hit at "lwz r9, 0(r31)", data type of r31 depends
on previous instruction sequence here. So to track the previous
instructions, patch adds changes to identify some of the arithmetic
instructions which are having opcode as 31.

Since memory instructions also has cases with opcode 31, use the bits
22:30 to filter the arithmetic instructions here.

Also there are instructions with just two operands like "addme", "addze".

This patch adds new instructions ops "arithmetic_ops" to handle this

Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Tested-by: Kajol Jain <kjain@linux.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Akanksha J N <akanksha@linux.ibm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Link: https://lore.kernel.org/lkml/20240718084358.72242-10-atrajeev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/powerpc/annotate/instructions.c
tools/perf/util/disasm.c