Skip to content

Commit

Permalink
perf annotate: Add more instructions for instruction tracking
Browse files Browse the repository at this point in the history
Add few more instructions and use opcode as search key
to find if it is supported by the architecture.

The added ones are: addi, addic, addic., addis, subfic and mulli

Reviewed-by: Kajol Jain <[email protected]>
Reviewed-by: Namhyung Kim <[email protected]>
Signed-off-by: Athira Rajeev <[email protected]>
Tested-by: Kajol Jain <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Akanksha J N <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Disha Goel <[email protected]>
Cc: Hari Bathini <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Madhavan Srinivasan <[email protected]>
Cc: Segher Boessenkool <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
athira-rajeev authored and acmel committed Jul 31, 2024
1 parent cd0b6f6 commit 539bfea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/perf/arch/powerpc/annotate/instructions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -212,6 +220,12 @@ static struct ins_ops *check_ppc_insn(u32 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;
Expand Down

0 comments on commit 539bfea

Please sign in to comment.