]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge tag 'perf-core-for-mingo-4.12-20170316' of git://git.kernel.org/pub/scm/linux...
authorIngo Molnar <mingo@kernel.org>
Thu, 16 Mar 2017 16:29:23 +0000 (17:29 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 16 Mar 2017 16:29:23 +0000 (17:29 +0100)
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>
1  2 
tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c

index 459352a9978fb2970840751807295a8b3dfb523c,a5f35b21172f84b5b536961cda551fb708526edc..54818828023bf4ad0960165d26afce60fe7166d1
  #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
  #endif
  
 -/* Based on branch_type() from perf_event_intel_lbr.c */
 +/* Based on branch_type() from arch/x86/events/intel/lbr.c */
  static void intel_pt_insn_decoder(struct insn *insn,
                                  struct intel_pt_insn *intel_pt_insn)
  {
@@@ -179,6 -180,29 +180,29 @@@ int intel_pt_get_insn(const unsigned ch
        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",