1. 16 10月, 2014 14 次提交
  2. 15 10月, 2014 14 次提交
    • I
      Merge tag 'perf-core-for-mingo' of... · ec4212d8
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      Infrastructure fixes and changes:
      
        * Fix off-by-one bugs in map->end handling (Stephane Eranian)
      
        * Fix off-by-one bug in maps__find(), also related to map->end handling (Namhyung Kim)
      
        * Make struct symbol->end be the first addr after the symbol range, to make it
          match the convention used for struct map->end. (Arnaldo Carvalho de Melo)
      
        * Fix perf_evlist__add_pollfd() error handling in 'perf kvm stat live' (Jiri Olsa)
      
        * Fix python test build by moving callchain_param to an object linked into the
          python binding (Jiri Olsa)
      
        * Do not include a struct hists per perf_evsel, untangling the histogram code
          from perf_evsel, to pave the way for exporting a minimalistic
          tools/lib/api/perf/ library usable by tools/perf and initially by the rasd
          daemon being developed by Borislav Petkov, Robert Richter and Jean Pihet.
          (Arnaldo Carvalho de Melo)
      
        * Make perf_evlist__open(evlist, NULL, NULL), i.e. without cpu and thread
          maps mean syswide monitoring, reducing the boilerplate for tools that
          only want system wide mode. (Arnaldo Carvalho de Melo)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      ec4212d8
    • A
      perf symbols: Make sym->end be the first address after the symbol range · 2c241bd3
      Arnaldo Carvalho de Melo 提交于
      To follow vm_area_struct->vm_end convention.
      
      By adhering to the convention that ->end is the first address outside
      the symbol's range we can do things like:
      
      	sym->end = start + len;
      	len = sym->end - sym->start;
      
      This is also now the convention used for struct map->end, fixing some
      off-by-one bugs.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Chuck Ebbert <cebbert.lkml@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-agomujr7tuqaq6lu7kr6z7h6@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2c241bd3
    • A
      perf symbols: Fix map->end fixup · eba85230
      Arnaldo Carvalho de Melo 提交于
      When synthesizing maps from files that have incomplete symbol
      information, like kallsyms, we need to fixup the end of maps by seting
      its end from the ->start of the next map, fix it to set prev_map->end to
      curr_map->start, since ->end is the first byte outside prev_map address
      range.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-ivbrj08sjakxdwkrcndbkoig@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eba85230
    • N
      perf tools: Fixup off-by-one comparision in maps__find · 4955ea22
      Namhyung Kim 提交于
      map->end is the first addr _outside_ the a map, following the convention
      of vm_area_struct->vm_end.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NStephane Eranian <eranian@google.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/8761fwh1nc.fsf@sejong.aot.lge.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4955ea22
    • S
      perf tools: fix off-by-one error in maps · 77faf4d0
      Stephane Eranian 提交于
      This patch fixes off-by-one errors in the management of maps.
      
      A map is defined by start address and length as implemented by
      map__new():
      
        map__init(map, type, start, start + len, pgoff, dso);
      
        map->start = addr;
        map->end = end;
      
      Consequently, the actual address range is [start; end[ map->end is the
      first byte outside the range.
      
      This patch fixes two bugs where upper bound checking was off-by-one.
      
      In V2, we fix map_groups__fixup_overlappings() some more where
      map->start was off-by-one as reported by Jiri.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20141006083532.GA4850@quadSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      77faf4d0
    • A
      perf machine: Add missing dsos->root rbtree root initialization · e167f995
      Arnaldo Carvalho de Melo 提交于
      A segfault happens on 'perf test hists_link' because we end up using a
      struct machines on the stack, and then machines__init() was not
      initializing the newly introduced rb_root, just the existing list_head.
      
      When we introduced struct dsos, to group the two ways to store dsos,
      i.e. the linked list and the rbtree, we didn't turned the initialization
      done in:
      
      	machines__init(machines->host) ->
      		machine__init() ->
      			INIT_LIST_HEAD
      
      into a dsos__init() to keep on initializing the list_head but _as well_
      initializing the rb_root, oops.
      
      All worked because outside perf-test we probably zalloc the whole thing
      which ends up initializing it in to NULL.
      
      So the problem looks contained to 'perf test' that uses it on stack,
      etc.
      Reported-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: Waiman Long <Waiman.Long@hp.com>,
      Cc: Adrian Hunter <adrian.hunter@intel.com>,
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Douglas Hatch <doug.hatch@hp.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Waiman Long <Waiman.Long@hp.com>,
      Link: http://lkml.kernel.org/r/20141014180353.GF3198@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e167f995
    • A
      perf evsel: Make some exit routines static · 8885846f
      Arnaldo Carvalho de Melo 提交于
      Since they are automatically called by other methods used by tools.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-ne3g4any7q6ty5d6yv8t1wws@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8885846f
    • A
      perf evsel: Add missing 'target' struct forward declaration · 80b2210c
      Arnaldo Carvalho de Melo 提交于
      We use it in evsel.h but were getting it indirectly, fix it.
      
      Noticed while working on having evsel.h usable by rasd.c.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-94t3jvw4tmzrq3dnovvpl65e@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      80b2210c
    • A
      perf evlist: Default to syswide target when no thread/cpu maps set · 4112eb18
      Arnaldo Carvalho de Melo 提交于
      If all a tool wants is to do system wide event monitoring, there is no
      more the need to setup thread_map and cpu_map objects, just call
      perf_evlist__open() and it will do create one fd per CPU monitoring all
      threads.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-poovolkigu72brx4783uq4cf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4112eb18
    • A
      perf evlist: Check that there is a thread_map when preparing a workload · 1aaf63b1
      Arnaldo Carvalho de Melo 提交于
      The perf_evlist__prepare_workload expects a thread map to be in place
      so that it can store the pid of the workload being started, so check it
      and tell the developer about it instead of segfaulting.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-jvlz2f264e7kpmhjmwltikqw@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1aaf63b1
    • A
      perf thread_map: Create dummy constructor out of open coded equivalent · 641556c9
      Arnaldo Carvalho de Melo 提交于
      Create a dummy thread_map, one that has just one entry and it is -1,
      meaning 'all threads', as this ends up going down to perf_event_open().
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-8av26cz8uxmbnihl5mmrygp9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      641556c9
    • A
      perf tools: Remove hists from evsel · a635fc51
      Arnaldo Carvalho de Melo 提交于
      Now tools that deals want to have an hists per evsel need to call
      hists__init() before creating any evsels, which can be as early as when
      parsing the command line, so do it before calling parse_options().
      
      The current tools using hists/hist_entries are report, top and annotate,
      change them to request per evsel hists.
      
      This is in preparation for making evsels usable by 3rd party tools, that
      not necessarily live in perf's source code repository.
      Acked-by: NBorislav Petkov <bp@suse.de>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-usjx2la743f10ippj7p1b20x@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a635fc51
    • A
      perf callchain: Move the callchain_param extern to callchain.h · 8f651eae
      Arnaldo Carvalho de Melo 提交于
      It was lost in hist.h, move it to where it belongs, callchain.h, as
      there are places that gets hist.h by means of evsel.h, and since evsel.h
      is being untangled from hist.h...
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-0rg7ji1jnbm6q6gj35j37jby@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8f651eae
    • A
      perf evsel: Subclassing · ce8ccff5
      Arnaldo Carvalho de Melo 提交于
      Provide a method to be called at tool start to config the perf_evsel
      instance size, together with optional constructor and destructor.
      
      This will be used so that perf_evsel doesn't always include a struct
      hists, tools that works with hists/hist_entries, like report, top and
      annotate, will, at start, tell the evsel class the size they need per
      instance.
      
      v2: Don't use exit as a name of a member of function parameter, as this
          breaks the build on at least fedora14 and rhel6.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-7t8cay0ieryox4gqosie85ek@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ce8ccff5
  3. 14 10月, 2014 12 次提交