Merge tag 'perf-core-for-mingo-4.12-20170316' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: New features: - Add 'brstackinsn' field in 'perf script' to reuse the x86 instruction decoder used in the Intel PT code to study hot paths to samples (Andi Kleen) Kernel changes: - Default UPROBES_EVENTS to Y (Alexei Starovoitov) - Fix check for kretprobe offset within function entry (Naveen N. Rao) Infrastructure changes: - Introduce util func is_sdt_event() (Ravi Bangoria) - Make perf_event__synthesize_mmap_events() scale on older kernels where reading /proc/pid/maps is way slower than reading /proc/pid/task/pid/maps (Stephane Eranian) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "insn.c"
|
||||
|
||||
#include "intel-pt-insn-decoder.h"
|
||||
#include "dump-insn.h"
|
||||
|
||||
#if INTEL_PT_INSN_BUF_SZ < MAX_INSN_SIZE || INTEL_PT_INSN_BUF_SZ > MAX_INSN
|
||||
#error Instruction buffer size too small
|
||||
@@ -179,6 +180,29 @@ int intel_pt_get_insn(const unsigned char *buf, size_t len, int x86_64,
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *dump_insn(struct perf_insn *x, uint64_t ip __maybe_unused,
|
||||
u8 *inbuf, int inlen, int *lenp)
|
||||
{
|
||||
struct insn insn;
|
||||
int n, i;
|
||||
int left;
|
||||
|
||||
insn_init(&insn, inbuf, inlen, x->is64bit);
|
||||
insn_get_length(&insn);
|
||||
if (!insn_complete(&insn) || insn.length > inlen)
|
||||
return "<bad>";
|
||||
if (lenp)
|
||||
*lenp = insn.length;
|
||||
left = sizeof(x->out);
|
||||
n = snprintf(x->out, left, "insn: ");
|
||||
left -= n;
|
||||
for (i = 0; i < insn.length; i++) {
|
||||
n += snprintf(x->out + n, left, "%02x ", inbuf[i]);
|
||||
left -= n;
|
||||
}
|
||||
return x->out;
|
||||
}
|
||||
|
||||
const char *branch_name[] = {
|
||||
[INTEL_PT_OP_OTHER] = "Other",
|
||||
[INTEL_PT_OP_CALL] = "Call",
|
||||
|
Reference in New Issue
Block a user