]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'perf-urgent-for-mingo-4.12-20170704' of git://git.kernel.org/pub/scm/linux...
authorIngo Molnar <mingo@kernel.org>
Wed, 5 Jul 2017 07:10:37 +0000 (09:10 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 5 Jul 2017 07:10:37 +0000 (09:10 +0200)
Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

User visible changes:

 - Fix max attr.precise_ip probing to make perf use the best cycles:p
   available in the processor for non root users (Arnaldo Carvalho de Melo)

 - Fix processing of MMAP events for 32-bit binaries on 64-bit systems
   when unwind support is not fully integrated, fixing DSO and symbol
   resolution (Jiri Olsa)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
tools/perf/util/evsel.c

diff --combined tools/perf/util/evsel.c
index 6f4882f8d61fb2e1f23000c581134f837722712c,91192415f38d58ab03a3122aec0c0d0eb4990b7f..87b43188667046c8a676b9bcbb3f2c7c315eb9bc
  #include <errno.h>
  #include <inttypes.h>
  #include <linux/bitops.h>
 +#include <api/fs/fs.h>
  #include <api/fs/tracing_path.h>
  #include <traceevent/event-parse.h>
  #include <linux/hw_breakpoint.h>
  #include <linux/perf_event.h>
 +#include <linux/compiler.h>
  #include <linux/err.h>
  #include <sys/ioctl.h>
  #include <sys/resource.h>
 +#include <sys/types.h>
 +#include <dirent.h>
  #include "asm/bug.h"
  #include "callchain.h"
  #include "cgroup.h"
@@@ -273,6 -269,7 +273,7 @@@ struct perf_evsel *perf_evsel__new_cycl
        struct perf_event_attr attr = {
                .type   = PERF_TYPE_HARDWARE,
                .config = PERF_COUNT_HW_CPU_CYCLES,
+               .exclude_kernel = 1,
        };
        struct perf_evsel *evsel;
  
@@@ -1445,7 -1442,7 +1446,7 @@@ int perf_event_attr__fprintf(FILE *fp, 
  }
  
  static int __open_attr__fprintf(FILE *fp, const char *name, const char *val,
 -                              void *priv __attribute__((unused)))
 +                              void *priv __maybe_unused)
  {
        return fprintf(fp, "  %-32s %s\n", name, val);
  }
@@@ -2475,42 -2472,6 +2476,42 @@@ bool perf_evsel__fallback(struct perf_e
        return false;
  }
  
 +static bool find_process(const char *name)
 +{
 +      size_t len = strlen(name);
 +      DIR *dir;
 +      struct dirent *d;
 +      int ret = -1;
 +
 +      dir = opendir(procfs__mountpoint());
 +      if (!dir)
 +              return false;
 +
 +      /* Walk through the directory. */
 +      while (ret && (d = readdir(dir)) != NULL) {
 +              char path[PATH_MAX];
 +              char *data;
 +              size_t size;
 +
 +              if ((d->d_type != DT_DIR) ||
 +                   !strcmp(".", d->d_name) ||
 +                   !strcmp("..", d->d_name))
 +                      continue;
 +
 +              scnprintf(path, sizeof(path), "%s/%s/comm",
 +                        procfs__mountpoint(), d->d_name);
 +
 +              if (filename__read_str(path, &data, &size))
 +                      continue;
 +
 +              ret = strncmp(name, data, len);
 +              free(data);
 +      }
 +
 +      closedir(dir);
 +      return ret ? false : true;
 +}
 +
  int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
                              int err, char *msg, size_t size)
  {