perf annotate: Add 'ret' (intel disasm style) as an alias for 'retq'
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 4 Sep 2020 17:11:18 +0000 (14:11 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 4 Sep 2020 19:07:30 +0000 (16:07 -0300)
When we use the 'intel' disassembler style we get 'ret' instead of
'retq', so add that as an alias.

  # perf annotate --disassembler-style=intel --stdio2 acpi_processor_ffh_cstate_enter > before

Apply this patch and then:

  # perf annotate --disassembler-style=intel --stdio2 acpi_processor_ffh_cstate_enter > after
  # diff -u before after
  --- before 2020-09-04 14:10:47.768414634 -0300
  +++ after 2020-09-04 14:10:59.116681039 -0300
  @@ -33,7 +33,7 @@
                 test    al,0x8
               ↓ je      97
                 and     DWORD PTR gs:[rip+0x7e548509],0x7fffffff
  -        97:   ret
  +        97: ← ret
                 mov     rax,QWORD PTR gs:0x17bc0
                 lock    or      BYTE PTR [rax+0x2],0x20
                 mov     rax,QWORD PTR [rax]
  #

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Martin Liška <mliska@suse.cz>
Cc: Matt P. Dziubinski <matdzb@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/x86/annotate/instructions.c

index 7eb5621..24ea12e 100644 (file)
@@ -110,6 +110,7 @@ static struct ins x86__instructions[] = {
        { .name = "por",        .ops = &mov_ops,  },
        { .name = "rclb",       .ops = &mov_ops,  },
        { .name = "rcll",       .ops = &mov_ops,  },
+       { .name = "ret",        .ops = &ret_ops,  },
        { .name = "retq",       .ops = &ret_ops,  },
        { .name = "sbb",        .ops = &mov_ops,  },
        { .name = "sbbl",       .ops = &mov_ops,  },