1. 17 12月, 2014 4 次提交
    • A
      perf evlist: Do not use hard coded value for a mmap_pages default · 8185e881
      Arnaldo Carvalho de Melo 提交于
      So far what is in there by default is what we were using: 512KB + the
      control page, but the admin may change that, and if it does to a smaller
      value, all calls to tooling for non root users start failing, requiring
      that the user manually set --mmap_pages/-m.
      
      Use instead what is in /proc/sys/kernel/perf_event_mlock_kb.
      
      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: 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-2f6mtm8xu3wo5lhkql6jdblh@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8185e881
    • A
      perf evlist: Improve the strerror_mmap method · e965bea1
      Arnaldo Carvalho de Melo 提交于
      Considering the per user locked pages limit, improve the message when a
      user uses multiple simultaneous perf mmap calls:
      
      When the request is more than the current maximum:
      
        [acme@ssdandy linux]$ trace -m 128 usleep 1
        Error: Operation not permitted.
        Hint:  Check /proc/sys/kernel/perf_event_mlock_kb (516 kB) setting.
        Hint:  Tried using 516 kB.
        Hint:  Try 'sudo sh -c "echo 1032 > /proc/sys/kernel/perf_event_mlock_kb"', or
        Hint:  Try using a smaller -m/--mmap-pages value.
        [acme@ssdandy linux]$
      
      And when the limit is less than that:
      
        [acme@ssdandy linux]$ trace -m 512 usleep 1
        Error: Operation not permitted.
        Hint:  Check /proc/sys/kernel/perf_event_mlock_kb (2056 kB) setting.
        Hint:  Tried using 2052 kB.
        Hint:  Try using a smaller -m/--mmap-pages value.
        [acme@ssdandy linux]$
      
      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: 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-yqdie3c8qvdgenwleri267d4@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e965bea1
    • A
      perf evlist: Clarify sterror_mmap variable names · e5d4a290
      Arnaldo Carvalho de Melo 提交于
      Prep patch for doing further checks like when the number of pages that
      is being attempted is actually below /proc/sys/kernel/perf_event_mlock_kb but
      the operation fails because the user doesn't have CAP_IPC_LOCK.
      
      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: 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-wetzlux7mzvofu5cuji5i71i@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e5d4a290
    • A
      perf evlist: Fixup brown paper bag on "hint" for --mmap-pages cmdline arg · 0a2138b2
      Arnaldo Carvalho de Melo 提交于
      When failing due to asking for a number of mmap pages that is more than
      the max, it was suggesting that an even bigger number of mmap pages
      should be specified, doh, au contraire!
      
      Before:
      
        [acme@ssdandy linux]$ trace -m 128 usleep 1
        Error:	Operation not permitted.
        Hint:	Check /proc/sys/kernel/perf_event_mlock_kb (516 kB) setting.
        Hint:	Tried using 516 kB.
        Hint:	Try using a bigger -m/--mmap-pages value.
        [acme@ssdandy linux]$
      
      After:
      
        [acme@ssdandy linux]$ trace -m 128 usleep 1
        Error:	Operation not permitted.
        Hint:	Check /proc/sys/kernel/perf_event_mlock_kb (516 kB) setting.
        Hint:	Tried using 516 kB.
        Hint:	Try using a smaller -m/--mmap-pages value.
        [acme@ssdandy linux]$
      
      And to (really) clarify what happens above, when what the user requests
      is <= max and even then it fails, a changeset is being made to tell that
      this is a per user limit, not per process (in the above example there
      was another 'perf trace' running for this user, which was using all the
      pages it could use).
      
      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: 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-8qope8lxb898narnq5kmu2gf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0a2138b2
  2. 12 12月, 2014 1 次提交
  3. 19 11月, 2014 1 次提交
  4. 29 10月, 2014 2 次提交
    • A
      perf tools: Use evlist__for_each in a few remaining places · cba9b847
      Arnaldo Carvalho de Melo 提交于
      Where direct use of the longer form using list_for_entry() was being
      used.
      
      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: 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-v4fw80flg25nkl8jgeod3ot9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cba9b847
    • A
      perf tools: Add id index · 3c659eed
      Adrian Hunter 提交于
      Add an index of the event identifiers, in preparation for Intel PT.
      
      The event id (also called the sample id) is a unique number
      allocated by the kernel to the event created by perf_event_open().  Events
      can include the event id by having a sample type including PERF_SAMPLE_ID or
      PERF_SAMPLE_IDENTIFIER.
      
      Currently the main use of the event id is to match an event back to the
      evsel to which it belongs i.e. perf_evlist__id2evsel()
      
      The purpose of this patch is to make it possible to match an event back to
      the mmap from which it was read.  The reason that is useful is because the
      mmap represents a time-ordered context (either for a cpu or for a thread).
      Intel PT decodes trace information on that basis.  In full-trace mode, that
      information can be recorded when the Intel PT trace is read, but in
      sample-mode the Intel PT trace data is embedded in a sample and it is in
      that case that the "id index" is needed.
      
      So the mmaps are numbered (idx) and the cpu and tid recorded against the id
      by perf_evlist__set_sid_idx() which is called by perf_evlist__mmap_per_evsel().
      
      That information is recorded on the perf.data file in the new "id index".
      idx, cpu and tid are added to struct perf_sample_id (which is the node of
      evlist's hash table to match ids to evsels).  The information can be
      retrieved using perf_evlist__id2sid().  Note however this all depends on
      having a sample type including PERF_SAMPLE_ID or PERF_SAMPLE_IDENTIFIER,
      otherwise ids are not recorded.
      
      The "id index" is a synthesized event record which will be created when
      Intel PT sampling is used by calling perf_event__synthesize_id_index().
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414417770-18602-2-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3c659eed
  5. 16 10月, 2014 1 次提交
  6. 15 10月, 2014 2 次提交
  7. 26 9月, 2014 9 次提交
    • A
      perf evlist: Unmap when all refcounts to fd are gone and events drained · e4b356b5
      Arnaldo Carvalho de Melo 提交于
      As noticed by receiving a POLLHUP for all its pollfd entries.
      
      That will remove the refcount taken in perf_evlist__mmap_per_evsel(),
      and when all events are consumed via perf_evlist__mmap_read() +
      perf_evlist__mmap_consume(), the ring buffer will be unmap'ed.
      
      Thanks to Jiri Olsa for pointing out that we must wait till all events
      are consumed, not being ok to unmmap just when receiving all the
      POLLHUPs.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-t10w1xk4myp7ca7m9fvip6a0@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e4b356b5
    • A
      tools lib fd array: Allow associating an integer cookie with each entry · 2171a925
      Arnaldo Carvalho de Melo 提交于
      We will use this in perf's evlist class so that it can, at
      fdarray__filter() time, to unmap the associated ring buffer.
      
      We may need to have further info associated with each fdarray entry, in
      that case we'll make that int array a 'union fdarray_priv' one and put a
      pointer there so that users can stash whatever they want there. For now,
      an int is enough tho.
      
      v2: Add clarification to the per array entry priv area, as well as make
          it a union, which makes usage a bit longer, but if/when we make it
          use more space by allowing per entry pointers existing users source
          code will not have to be changed, just rebuilt.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      
      Link: http://lkml.kernel.org/n/tip-0p00bn83quck3fio3kcs9vca@git.kernel.org
      2171a925
    • A
      perf evlist: Refcount mmaps · 82396986
      Arnaldo Carvalho de Melo 提交于
      We need to know how many fds are using a perf mmap via
      PERF_EVENT_IOC_SET_OUTPUT, so that we can know when to ditch an mmap,
      refcount it.
      
      v2: Automatically unmap it when the refcount hits one, which will happen
      when all fds are filtered by perf_evlist__filter_pollfd(), in later
      patches.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20140908153824.GG2773@kernel.org
      Link: http://lkml.kernel.org/n/tip-cpv7v2lw0g74ucmxa39xdpms@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      82396986
    • A
      tools lib api: Adopt fdarray class from perf's evlist · 1b85337d
      Arnaldo Carvalho de Melo 提交于
      The extensible file description array that grew in the perf_evlist class
      can be useful for other tools, as it is not something that only evlists
      need, so move it to tools/lib/api/fd to ease sharing it.
      
      v2: Don't use {} like in:
      
       libapi_dirs:
      	$(QUIET_MKDIR)mkdir -p $(OUTPUT){fs,fd}/
      
      in Makefiles, as it will not work in some systems, as in ubuntu13.10.
      
      v3: Add fd/*.[ch] to LIBAPIKFS_SOURCES (Fix from Jiri Olsa)
      
      v4: Leave the fcntl(fd, O_NONBLOCK) in the evlist layer, remains to
          be checked if it is really needed there, but has no place in the
          fdarray class (Fix from Jiri Olsa)
      
      v5: Remove evlist details from fdarray grow/filter tests. Improve it a
          bit doing more tests about expected internal state.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-kleuni3hckbc3s0lu6yb9x40@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1b85337d
    • A
      perf evlist: Introduce poll method for common code idiom · f66a889d
      Arnaldo Carvalho de Melo 提交于
      Since we have access two evlist members in all these poll calls, provide
      a helper.
      
      This will also help to make the patch introducing the pollfd class more
      clear, as the evlist specific uses will be hiden away
      perf_evlist__poll().
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-jr9d4aop4lvy9453qahbcgp0@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f66a889d
    • A
      perf evlist: Allow growing pollfd on add method · ad6765dd
      Arnaldo Carvalho de Melo 提交于
      This way we will be able to add more file descriptors to be polled,
      like stdin or some timer fd.
      
      At this point we might as well yank the pollfd class from evlist so that
      it can be used in other places.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-o2mzsjl7taumsoc35ryol00i@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ad6765dd
    • A
      perf evlist: We need to poll all event file descriptors · 033fa713
      Arnaldo Carvalho de Melo 提交于
      Because we want to notice when they get POLLHUP'ed, so that we can
      figure out when all threads exited in a workload being monitored.
      
      We can't just monitor the fds that were mmaped, we need to notice when
      all the fds that were PERF_EVENT_IOC_SET_OUTPUT'ed too, because the mmap
      stays even after the fd that originally was used to do the mmap call
      went away, its only when all the set-output fds for a mmap are gone that
      the mmap is.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      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/r/20140908151016.GH17728@krava.brq.redhat.com
      Link: http://lkml.kernel.org/n/tip-24omlq5asrfg4uo3muuzn2bl@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      033fa713
    • A
      perf evlist: Monitor POLLERR and POLLHUP events too · 8179672c
      Arnaldo Carvalho de Melo 提交于
      We want to know when the fd went away, like when a monitored thread
      exits.
      
      If we do not monitor such events, then the tools will wait forever on
      events from a vanished thread, like when running:
      
       $ sleep 5s &
       $ perf record -p `pidof sleep`
      
      This builds upon the kernel patch by Jiri Olsa that actually makes a
      poll on those file descriptors to return POLLHUP.
      
      It is also needed to change the tools to use
      perf_evlist__filter_pollfd() to check if there are remainings fds to
      monitor or if all are gone, in which case they will exit the
      poll/mmap/read loop.
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      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-a4fslwspov0bs69nj825hqpq@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8179672c
    • A
      perf evlist: Introduce perf_evlist__filter_pollfd method · 1ddec7f0
      Arnaldo Carvalho de Melo 提交于
      To remove all entries in evlist->pollfd[] that have revents matching at
      least one of the bits in the specified mask.
      
      It'll adjust evlist->nr_fds to the number of unfiltered fds and will
      return this value, as a convenience and to avoid requiring direct access
      to internal state of perf_evlist objects.
      
      This will be used after polling the evlist fds so that we remove fds
      that were closed by the kernel.
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      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-y2sca7z3wicvvy40a50lozwm@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1ddec7f0
  8. 15 8月, 2014 1 次提交
  9. 14 8月, 2014 3 次提交
  10. 31 7月, 2014 1 次提交
    • A
      perf evlist: Don't run workload if not told to · 5f1c4225
      Arnaldo Carvalho de Melo 提交于
      The perf_evlist__prepare_workload() method works by forking and then
      waiting on a fd that must be written to to allow the workload to be
      exec()ed.
      
      But if the tool calling it fails to, say, set up the events with which
      it wants to sample the workload for, it will not call
      perf_evlist__start_workload(), but even in this case the workload ended
      up running:
      
        [acme@zoo linux]$ trace /bin/echo workload ends up running, it should not...
        Couldn't mmap the events: Operation not permitted
        workload ends up running, it should not...
        [acme@zoo linux]$
      
      So check if at least one byte was written before letting exec() be
      called.
      
      Now the expected behaviour:
      
        [acme@zoo linux]$ trace /bin/echo workload ends up running, it should not...
        Couldn't mmap the events: Operation not permitted
        [acme@zoo linux]$
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      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-oh1ixo8m74rf295a05gfjw8b@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5f1c4225
  11. 17 7月, 2014 1 次提交
  12. 20 6月, 2014 1 次提交
  13. 21 1月, 2014 1 次提交
    • S
      perf stat: Fix memory corruption of xyarray when cpumask is used · 8ad9219e
      Stephane Eranian 提交于
      This patch fixes a memory corruption problem with the xyarray when the
      evsel fds get closed at the end of the run_perf_stat() call.
      
      It could be triggered with:
      
       # perf stat -a -e power/energy-cores/ ls
      
      When cpumask are used by events (.e.g, RAPL or uncores) then the evsel
      fds are allocated based on the actual number of CPUs monitored. That
      number can be smaller than the total number of CPUs on the system.
      
      The problem arises at the end by perf stat closes the fds twice. When
      fds are closed, their entry in the xyarray are set to -1.
      
      The first close() on the evsel is made from __run_perf_stat() and it
      uses the actual number of CPUS for the event which is how the xyarray
      was allocated for.
      
      The second is from perf_evlist_close() but that one is on the total
      number of CPUs in the system, so it assume the xyarray was allocated to
      cover it. However it was not, and some writes corrupt memory.
      
      The fix is in perf_evlist_close() is to first try with the evsel->cpus
      if present, if not use the evlist->cpus. That fixes the problem.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1389972846-6566-3-git-send-email-eranian@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8ad9219e
  14. 13 1月, 2014 6 次提交
  15. 28 12月, 2013 1 次提交
  16. 17 12月, 2013 1 次提交
    • B
      tools/: Convert to new topic libraries · 553873e1
      Borislav Petkov 提交于
      Move debugfs.* to api/fs/. We have a common tools/lib/api/ place where
      the Makefile lives and then we place the headers in subdirs.
      
      For example, all the fs-related stuff goes to tools/lib/api/fs/ from
      which we get libapikfs.a (acme got almost the naming he wanted :-)) and
      we link it into the tools which need it - in this case perf and
      tools/vm/page-types.
      
      acme:
      
      "Looking at the implementation, I think some tools can even link
      directly to the .o files, avoiding the .a file altogether.
      
      But that is just an optimization/finer granularity tools/lib/
      cherrypicking that toolers can make use of."
      
      Fixup documentation cleaning target while at it.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Stanislav Fomichev <stfomichev@yandex-team.ru>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386605664-24041-2-git-send-email-bp@alien8.deSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      553873e1
  17. 13 12月, 2013 2 次提交
  18. 10 12月, 2013 2 次提交