Merge 'tip/perf/urgent' into perf/core to pick fixes
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 2 Mar 2015 14:45:49 +0000 (11:45 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 2 Mar 2015 14:45:49 +0000 (11:45 -0300)
Needed to build perf/core buildable in some cases.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1  2 
arch/x86/kernel/kprobes/opt.c
tools/perf/util/evlist.h
tools/perf/util/symbol-elf.c

index 0dd8d089c315e0e9df338e9144799c6e900df831,3aef248ec1ee1d0df58174a8af74eb986249d2e2..7b3b9d15c47a63953d6932026cc57db795e3a507
@@@ -259,6 -259,8 +259,8 @@@ static int can_optimize(unsigned long p
                         */
                        return 0;
                recovered_insn = recover_probed_instruction(buf, addr);
+               if (!recovered_insn)
+                       return 0;
                kernel_insn_init(&insn, (void *)recovered_insn, MAX_INSN_SIZE);
                insn_get_length(&insn);
                /* Another subsystem puts a breakpoint */
@@@ -322,8 -324,7 +324,8 @@@ void arch_remove_optimized_kprobe(struc
   * Target instructions MUST be relocatable (checked inside)
   * This is called when new aggr(opt)probe is allocated or reused.
   */
 -int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
 +int arch_prepare_optimized_kprobe(struct optimized_kprobe *op,
 +                                struct kprobe *__unused)
  {
        u8 *buf;
        int ret;
diff --combined tools/perf/util/evlist.h
index d4768a30f88422c2db39020d4173861f67bfad26,e99a67632831a8e6548fae8a40b654f01b009d1e..f07c984465f0e39fdd59d2d4ec36ef54f9dbdeb5
@@@ -28,7 -28,7 +28,7 @@@ struct perf_mmap 
        int              mask;
        int              refcnt;
        unsigned int     prev;
-       char             event_copy[PERF_SAMPLE_MAX_SIZE];
+       char             event_copy[PERF_SAMPLE_MAX_SIZE] __attribute__((aligned(8)));
  };
  
  struct perf_evlist {
@@@ -51,7 -51,6 +51,7 @@@
        struct thread_map *threads;
        struct cpu_map    *cpus;
        struct perf_evsel *selected;
 +      struct events_stats stats;
  };
  
  struct perf_evsel_str_handler {
@@@ -78,8 -77,6 +78,8 @@@ int perf_evlist__add_newtp(struct perf_
                           const char *sys, const char *name, void *handler);
  
  int perf_evlist__set_filter(struct perf_evlist *evlist, const char *filter);
 +int perf_evlist__set_filter_pid(struct perf_evlist *evlist, pid_t pid);
 +int perf_evlist__set_filter_pids(struct perf_evlist *evlist, size_t npids, pid_t *pids);
  
  struct perf_evsel *
  perf_evlist__find_tracepoint_by_id(struct perf_evlist *evlist, int id);
index b02731a19d1f41f7c95d0b2cc670edfdc59bcb42,33b7a2aef71322ab88b93e675c070bfc4a7c7da7..ada16762fac244f2f29c664d07f04ac18e3bcd7e
  #include <symbol/kallsyms.h>
  #include "debug.h"
  
+ #ifndef EM_AARCH64
+ #define EM_AARCH64    183  /* ARM 64 bit */
+ #endif
  #ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
  extern char *cplus_demangle(const char *, int);
  
@@@ -69,10 -74,6 +74,10 @@@ static inline uint8_t elf_sym__type(con
        return GELF_ST_TYPE(sym->st_info);
  }
  
 +#ifndef STT_GNU_IFUNC
 +#define STT_GNU_IFUNC 10
 +#endif
 +
  static inline int elf_sym__is_function(const GElf_Sym *sym)
  {
        return (elf_sym__type(sym) == STT_FUNC ||
@@@ -863,9 -864,10 +868,9 @@@ int dso__load_sym(struct dso *dso, stru
                /* Reject ARM ELF "mapping symbols": these aren't unique and
                 * don't identify functions, so will confuse the profile
                 * output: */
 -              if (ehdr.e_machine == EM_ARM) {
 -                      if (!strcmp(elf_name, "$a") ||
 -                          !strcmp(elf_name, "$d") ||
 -                          !strcmp(elf_name, "$t"))
 +              if (ehdr.e_machine == EM_ARM || ehdr.e_machine == EM_AARCH64) {
 +                      if (elf_name[0] == '$' && strchr("adtx", elf_name[1])
 +                          && (elf_name[2] == '\0' || elf_name[2] == '.'))
                                continue;
                }