Skip to content
  1. Aug 12, 2014
    • Namhyung Kim's avatar
      perf tools: Fix column alignment when headers aren't shown on TUI · 59dc9f25
      Namhyung Kim authored
      
      
      If user sets ui.show-headers config option to false, it didn't calculate
      default column width so it broke the alignment.  This is because it does
      the calculation just before showing headers.
      
      Move it to the beginning of the hist browser so that it can be called
      regardless of the config option.
      
      Reported-by: default avatarJiri Olsa <jolsa@redhat.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1406785662-5534-8-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      59dc9f25
    • Namhyung Kim's avatar
      perf tools: Add name field into perf_hpp_fmt · 1ecd4453
      Namhyung Kim authored
      
      
      It makes the code a bit simpler and easier to debug IMHO.
      
      I guess it can also remove similar code in perf diff, but let's keep
      it for a future work. :)
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1406785662-5534-7-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1ecd4453
    • Namhyung Kim's avatar
      perf top: Add -w option for setting column width · cf59002f
      Namhyung Kim authored
      
      
      Add -w/--column-widths option like perf report does so that users are
      able to see symbols even with some very long C++ library/functions.
      
      It can be a list separated by comma for each column.
      
        $ perf top -w 0,20,30
      
      The value of 0 means there's no limit.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1406785662-5534-6-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cf59002f
    • Namhyung Kim's avatar
      perf report: Honor column width setting · 5b591669
      Namhyung Kim authored
      
      
      Set column width and do not change it if user gives -w/--column-widths
      option.  It'll truncate longer symbols than the width if exists.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1406785662-5534-5-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5b591669
    • Namhyung Kim's avatar
      perf tools: Save column length in perf_hpp_fmt · e0d66c74
      Namhyung Kim authored
      
      
      Save column length in the hpp format and pass it to print functions.
      This is a preparation for users to control column width in the output.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1406785662-5534-4-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e0d66c74
    • Namhyung Kim's avatar
      perf tools: Make __hpp__fmt() receive an additional len argument · d675107c
      Namhyung Kim authored
      
      
      So that it can properly handle alignment requirements later.  To do
      that, add percent_color_len_snprintf() fucntion to help coloring of
      overhead columns.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1406785662-5534-3-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d675107c
    • Namhyung Kim's avatar
      perf tools: Left-align output contents · 8246de88
      Namhyung Kim authored
      
      
      Now perf left-aligns column headers but the contents does not.  It
      should have same alignment.  This requires a change in pid sort key - it
      consists of two part (pid and comm).  As length of comm can be vary it'd
      be better to change the order of them.
      
      Thanks to Jiri Olsa for pointing this out.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1406785662-5534-2-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8246de88
    • Namhyung Kim's avatar
      perf tools: Fix make PYTHON override · 56c7d79e
      Namhyung Kim authored
      
      
      Thomas reported that make PYTHON=python2 is not work on some systems.  I
      can reproduce it on my ArchLinux box too.
      
      This is because it's overridden by config/feature-checks/Makefile
      regardless of PYTHON setting.  I guess it's a bug slipped into during
      the feature checking change.
      
      Actually, we don't need to check python-config in the feature-checks.
      We can just pass appropriate FEATURE_CHECK_*FLAGS.
      
      Reported-by: default avatarThomas Ilsche <thomas.ilsche@tu-dresden.de>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarThomas Ilsche <thomas.ilsche@tu-dresden.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
      Link: http://lkml.kernel.org/r/1406617040-26909-1-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      56c7d79e
    • Namhyung Kim's avatar
      perf kmem: Do not ignore mmap events · 64c40908
      Namhyung Kim authored
      The perf kmem command didn't process mmap events for some unknown reason
      and it instead gets symbol info from a running kernel.  This is
      problematic if perf kmem record was run on a different kernel.
      
      This patch adds the mmap event handlers and reverts the commit
      e727ca73
      
       ("perf kmem: Resolve kernel symbols again").
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1406872771-23933-1-git-send-email-namhyung@kernel.org
      [ Fixed up merge conflict with Jiri's ordered_events rename patch set ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      64c40908
    • Jiri Olsa's avatar
      perf tools: Show better error message in case we fail to open counters due to EBUSY error · 63914aca
      Jiri Olsa authored
      
      
      Showing better error message in case we fail to open counters due to the
      EBUSY error. If we detect oprofile daemon process running, we now
      display following message for EBUSY error:
      
        $ perf record ls
        Error:
        The PMU counters are busy/taken by another profiler.
        We found oprofile daemon running, please stop it and try again.
      
      In case oprofiled was not detected the current error message stays:
      
        $ perf record ls
        Error:
        The sys_perf_event_open() syscall returned with 16 (Device or resource busy) for event (cycles).
        /bin/dmesg may provide additional information.
        No CONFIG_PERF_EVENTS=y kernel support configured?
      
      Also changing PERF_FLAG_FD_CLOEXEC detection code not to display error
      in case of EBUSY error, as it currently does:
      
        $ perf record ls
        Error:
        perf_event_open(..., PERF_FLAG_FD_CLOEXEC) failed with unexpected error 16 (Device or resource busy)
        perf_event_open(..., 0) failed unexpectedly with error 16 (Device or resource busy)
        The PMU counters are busy/taken by another profiler.
        We found oprofile daemon running, please stop it and try again.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Yann Droneaud <ydroneaud@opteya.com>
      Link: http://lkml.kernel.org/r/1406908014-8312-1-git-send-email-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      63914aca
    • Jiri Olsa's avatar
      perf tools: Allow out of order messages in forced flush · b0a45203
      Jiri Olsa authored
      
      
      In forced flush (OE_FLUSH__HALF) we break the rules of the flush
      timestamp via PERF_RECORD_FINISHED_ROUND event, so we could get out of
      order event.
      
      Do not force error in this case plus changing the output warning to use
      WARN_ONCE.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-8q8794a8nlmpd1u8xrqmcyd2@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b0a45203
    • Jiri Olsa's avatar
      perf tools: Add debug prints for ordered events queue · cee3ab9c
      Jiri Olsa authored
      
      
      Adding some prints for ordered events queue, to help debug issues.
      
      Adding debug_ordered_events debug variable to be able to enable ordered
      events debug messages using:
      
        $ perf --debug ordered-events=2 report ...
      
      Also using oe pointer in perf_session__queue_event instead of chained
      session variable dereferencing.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-7p3mnnopjvsp9nmk9msqcfkm@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cee3ab9c
    • Jiri Olsa's avatar
      perf tools: Add report.queue-size config file option · 94786b67
      Jiri Olsa authored
      
      
      Adding report.queue-size config file option to setup the maximum
      allocation size for session's struct ordered_events object.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-lm42mbpu0cwljpyy8vw5y26n@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      94786b67
    • Jiri Olsa's avatar
      perf tools: Add perf_config_u64 function · 94c0655f
      Jiri Olsa authored
      
      
      Adding perf_config_u64 function to be able to parse 'llong' values out
      of config file.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-ni6gqdlvw7khp74r9htvklkb@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      94c0655f
    • Jiri Olsa's avatar
      perf tools: Add ordered_events__free function · adc56ed1
      Jiri Olsa authored
      
      
      Adding ordered_events__free function to release all the struct
      ordered_events data. It's replacement for former
      perf_session_free_sample_buffers function.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-urraa8ccay4o14wambjraws7@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      adc56ed1
    • Jiri Olsa's avatar
      perf tools: Add ordered_events__init function · 36522f5c
      Jiri Olsa authored
      
      
      Adding ordered_events__init function for struct ordered_events struct
      initialization.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-g6dx35hed8g14eh1ygx4uzp6@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      36522f5c
    • Jiri Olsa's avatar
      perf tools: Use list_move in ordered_events_delete function · fa4e5c67
      Jiri Olsa authored
      
      
      As Namhyung pointed out we can use list_move in ordered_events_delete.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Suggested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-m8ae5s5cuwyytitgb6iqilid@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fa4e5c67
    • Jiri Olsa's avatar
      perf tools: Create ordered-events object · 5f86b80b
      Jiri Olsa authored
      
      
      Move ordered events code into separated object ordered-events.[ch].
      
      No functional change was intended.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-1ge3rilgudszbl87cejm1tfg@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5f86b80b
    • Jiri Olsa's avatar
      perf tools: Make perf_session__deliver_event global · 79a30fe4
      Jiri Olsa authored
      
      
      Making perf_session__deliver_event global function, as it will be called
      from another object in following patch.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-rz7s2b8uwv567bigckh75gvk@git.kernel.org
      [ Fixup naming to match class__method schema, as now is more widely exposed ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      79a30fe4
    • Jiri Olsa's avatar
      perf tools: Flush ordered events in case of allocation failure · d40b4a15
      Jiri Olsa authored
      
      
      In previous patches we added a limit for ordered events queue allocation
      size. If we reach this size we need to flush (part of) the queue to get
      some free buffers.
      
      The current functionality is not affected, because the limit is hard
      coded to (u64) -1. The configuration code for size will come in
      following patches.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-ggcas0xdq847fi85bz73do2e@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d40b4a15
    • Jiri Olsa's avatar
      perf tools: Limit ordered events queue size · 8d99a6ce
      Jiri Olsa authored
      
      
      Add limit to the ordered events queue allocation. This way we will be
      able to control the size of the queue buffers.
      
      There's no limit at the moment (it's set to (u64) -1). The config code
      will come in following patches.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-lw1ny3mk4ctb6su5ght5rsng@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8d99a6ce
    • Jiri Olsa's avatar
      perf tools: Factor ordered_events__flush to be more generic · d8836b5d
      Jiri Olsa authored
      
      
      Centralizing the next_flush calculation under the ordered_events__flush
      function.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-srwunsy7o5wl17vpt4a10oxp@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d8836b5d
    • Jiri Olsa's avatar
      perf tools: Add ordered_events__(new|delete) interface · c64c7e1a
      Jiri Olsa authored
      
      
      Adding new ordered events interface to new|delete event buffer:
      
        ordered_events__new    - allocate event buffer from the cache
        ordered_events__delete - return event buffer to the cache
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-srwunsy7o5wl17vpt4a10oxp@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c64c7e1a
    • Jiri Olsa's avatar
      perf tools: Rename ordered_events members · fc12482f
      Jiri Olsa authored
      
      
      Rename 'struct ordered_events' members to fit better the ordered events
      style.
      
      No functional change was intended.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-v0eb2hsmrxbolnoawu5fn92z@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fc12482f
    • Jiri Olsa's avatar
      perf tools: Rename ordered_samples struct to ordered_events · 37e39aa8
      Jiri Olsa authored
      
      
      Following up with ordered_samples rename for ordered_samples and
      sample_queue structs to ordered_events and ordered_event structs
      respectively.
      
      Also changing flush_sample_queue function name to ordered_events_flush.
      
      No functional change was intended.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-2dkrdvh0bbmzxdse437fcgls@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      37e39aa8
    • Jiri Olsa's avatar
      perf tools: Rename ordered_samples bool to ordered_events · 0a8cb85c
      Jiri Olsa authored
      
      
      The time ordering is generic for all kinds of events, so using generic
      name 'ordered_events' for ordered_samples bool in perf_tool struct.
      
      No functional change was intended.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.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: 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-07mrqzcuhsks9wfmxrzsvemz@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0a8cb85c
    • Andi Kleen's avatar
      perf record: Honour --no-time command line option · 8affc2b8
      Andi Kleen authored
      
      
      Time stamps are always implicitely enabled for record currently.  The
      old --time/-T option is a nop.
      
      Allow the user to disable timestamps by using --no-time, honouring the
      existing option.
      
      The defaults are unchanged.
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1406789104-25863-10-git-send-email-zheng.z.yan@intel.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8affc2b8
  2. Aug 02, 2014
  3. Jul 31, 2014
    • Arnaldo Carvalho de Melo's avatar
      perf symbols: Make sure --symfs usage includes the path separator · 972f393b
      Arnaldo Carvalho de Melo authored
      
      
      Minchan reported that perf failed to load vmlinux if --symfs argument
      doesn't end with '/' character.
      
      Fix it by making sure that the '/' path separator is used when composing
      pathnames with a --symfs provided directory name.
      
      Reported-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Minchan Kim <minchan@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-8n4s6b6zvsez5ktanw006125@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      972f393b
    • Arnaldo Carvalho de Melo's avatar
      perf evlist: Don't run workload if not told to · 5f1c4225
      Arnaldo Carvalho de Melo authored
      
      
      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: default avatarJiri 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.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5f1c4225
  4. Jul 30, 2014
  5. Jul 28, 2014
    • Jiri Olsa's avatar
      Revert "perf tools: Fix jump label always changing during tracing" · 8578b891
      Jiri Olsa authored
      This reverts commit deaff8b6
      
      .
      
      This commit makes CLOEXEC feature undetected for normal users,
      because per-cpu events are priviledged.
      
      Reported-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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/20140728065844.GK6758@twins.programming.kicks-ass.net
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      8578b891
    • Jiri Olsa's avatar
      perf tools: Fix perf usage string leftover · 78a1b503
      Jiri Olsa authored
      
      
      Fixing perf usage string leftover pointed out by Namhyung.
      
      Reported-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      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: 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-vkcf53oultknsh3ue9fhin94@git.kernel.org
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      78a1b503
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 068f1d3f
      Ingo Molnar authored
      
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      Infrastructure changes:
      
       o More prep work to support Intel PT: (Adrian Hunter)
         - Polishing 'script' BTS output
         - 'inject' can specify --kallsym
         - VDSO is per machine, not a global var
         - Expose data addr lookup functions previously private to 'script'
         - Large mmap fixes in events processing
      
       o Fix build on gcc 4.4.7 (Arnaldo Carvalho de Melo)
      
       o Event ordering fixes (Jiri Olsa)
      
       o Include standard stringify macros in power pc code (Sukadev Bhattiprolu)
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      068f1d3f
    • Jiri Olsa's avatar
      perf: Check permission only for parent tracepoint event · f4be073d
      Jiri Olsa authored
      
      
      There's no need to check cloned event's permission once the
      parent was already checked.
      
      Also the code is checking 'current' process permissions, which
      is not owner process for cloned events, thus could end up with
      wrong permission check result.
      
      Reported-by: default avatarAlexander Yarygin <yarygin@linux.vnet.ibm.com>
      Tested-by: default avatarAlexander Yarygin <yarygin@linux.vnet.ibm.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1405079782-8139-1-git-send-email-jolsa@kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f4be073d
    • Ingo Molnar's avatar
    • Linus Torvalds's avatar
      Linux 3.16-rc7 · 64aa90f2
      Linus Torvalds authored
      v3.16-rc7
      64aa90f2
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9dae0a3f
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "A bunch of fixes for perf and kprobes:
         - revert a commit that caused a perf group regression
         - silence dmesg spam
         - fix kprobe probing errors on ia64 and ppc64
         - filter kprobe faults from userspace
         - lockdep fix for perf exit path
         - prevent perf #GP in KVM guest
         - correct perf event and filters"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        kprobes: Fix "Failed to find blacklist" probing errors on ia64 and ppc64
        kprobes/x86: Don't try to resolve kprobe faults from userspace
        perf/x86/intel: Avoid spamming kernel log for BTS buffer failure
        perf/x86/intel: Protect LBR and extra_regs against KVM lying
        perf: Fix lockdep warning on process exit
        perf/x86/intel/uncore: Fix SNB-EP/IVT Cbox filter mappings
        perf/x86/intel: Use proper dTLB-load-misses event on IvyBridge
        perf: Revert ("perf: Always destroy groups on exit")
      9dae0a3f
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 43a255c2
      Linus Torvalds authored
      Pull x86 fixes from Peter Anvin:
       "A couple of crash fixes, plus a fix that on 32 bits would cause a
        missing -ENOSYS for nonexistent system calls"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, cpu: Fix cache topology for early P4-SMT
        x86_32, entry: Store badsys error code in %eax
        x86, MCE: Robustify mcheck_init_device
      43a255c2