lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240328232009.466018-1-namhyung@kernel.org>
Date: Thu, 28 Mar 2024 16:20:05 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ian Rogers <irogers@...gle.com>,
	Kan Liang <kan.liang@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-perf-users@...r.kernel.org,
	Changbin Du <changbin.du@...wei.com>
Subject: [PATCH 0/4] perf annotate: Use libcapstone as a disasssembler

Hello,

As we've added libcapstone support, it's natural to use it for perf annotate
as well.  This change added the capstone support on x86 first.  Other archs
can be added later (by someone who can verify it doesn't break things).

For now it tries to use capstone (if available) before objdump.  But it
doesn't support source file and line number info.  So users should use the
objdump (by passing --objdump=PATH option) if they need them.  For example,
this command line will keep the existing behavior (i.e. using objdump).

  # not to use capstone for disassembly
  $ perf annotate --objdump=objdump

The capstone uses LLVM objdump style output which is slightly different than
the GNU objdump.  But it should not have differences besides that.  I've
verified the result of data type profiling and it produced the same output
but gave me ~3x speedups.

Thanks,
Namhyung


Cc: Changbin Du <changbin.du@...wei.com>


Namhyung Kim (4):
  perf annotate: Use ins__is_xxx() if possible
  perf annotate: Add and use ins__is_nop()
  perf annotate: Split out util/disasm.c
  perf annotate: Use libcapstone to disassemble

 tools/perf/util/Build      |    1 +
 tools/perf/util/annotate.c | 1711 ++---------------------------------
 tools/perf/util/annotate.h |   59 +-
 tools/perf/util/disasm.c   | 1739 ++++++++++++++++++++++++++++++++++++
 tools/perf/util/disasm.h   |  112 +++
 5 files changed, 1914 insertions(+), 1708 deletions(-)
 create mode 100644 tools/perf/util/disasm.c
 create mode 100644 tools/perf/util/disasm.h

-- 
2.44.0.478.gd926399ef9-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ