1. 05 Apr, 2011 5 commits
    • Masami Hiramatsu's avatar
      perf probe: Fix listing incorrect line number with inline function · 1d46ea2a
      Masami Hiramatsu authored
      Fix a bug showing incorrect line number when a probe is put on the head of an
      inline function. This patch updates find_perf_probe_point() and introduces new
      rules to get correct line number.
      
       - If debuginfo doesn't have a correct file name, we shouldn't return line
         number too, because, without file name, line number is meaningless.
      
       - If the address is in a function, it stores the function name and the offset
         from the function entry.
      
         - If the address is on a line, it tries to get the relative line number from
           the function entry line, except for the address is same as the entry
           address of the function (in this case, the relative line number should
           be 0).
      
           - If the address is in an inline function entry (call-site), it uses the
             inline function call line number as the line on which the address is.
      
         - If the address is in an inline function body, it stores the inline
           function name and offset from the inline function call site instead of the
           (non-inlined) function.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092605.2132.11629.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1d46ea2a
    • Masami Hiramatsu's avatar
      perf probe: Fix to find recursively inlined function · 1d878083
      Masami Hiramatsu authored
      Fix die_find_inlinefunc() to return correct innermost inlined function
      at given address. Without this fix, it returns the outermost inlined
      function.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092559.2132.78634.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1d878083
    • Masami Hiramatsu's avatar
      perf probe: Fix multiple --vars options behavior · cc446446
      Masami Hiramatsu authored
      Fix a bug that perf-probe fails to initialize libdwfl and shows incorrect error
      when user gives multiple --vars options.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092553.2132.42691.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cc446446
    • Masami Hiramatsu's avatar
      perf probe: Fix to remove redundant close · f0c4801a
      Masami Hiramatsu authored
      Since dwfl_end() closes given fd with dwfl, caller doesn't need to close its fd
      when finishing process.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092547.2132.93728.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f0c4801a
    • Masami Hiramatsu's avatar
      perf probe: Fix to ensure function declared file · 7d21635a
      Masami Hiramatsu authored
      Fix to ensure function declared file matches given file name. This fixes
      a potential bug.
      
      As I've commented on Lin Ming's fastpath enhancement, decl_file should
      be checked on each probe point if user gives a probe point as func@file.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092541.2132.3584.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7d21635a
  2. 31 Mar, 2011 4 commits
    • Peter Zijlstra's avatar
      perf: Fix task_struct reference leak · fd1edb3a
      Peter Zijlstra authored
      sys_perf_event_open() had an imbalance in the number of task refs it
      took causing memory leakage
      
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: stable@kernel.org # .37+
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      fd1edb3a
    • Peter Zijlstra's avatar
      perf: Fix task context scheduling · ab711fe0
      Peter Zijlstra authored
      Jiri reported:
      
       |
       | - once an event is created by sys_perf_event_open, task context
       |   is created and it stays even if the event is closed, until the
       |   task is finished ... thats what I see in code and I assume it's
       |   correct
       |
       | - when the task opens event, perf_sched_events jump label is
       |   incremented and following callbacks are started from scheduler
       |
       |         __perf_event_task_sched_in
       |         __perf_event_task_sched_out
       |
       |   These callback *in/out set/unset cpuctx->task_ctx value to the
       |   task context.
       |
       | - close is called on event on CPU 0:
       |         - the task is scheduled on CPU 0
       |         - __perf_event_task_sched_in is called
       |         - cpuctx->task_ctx is set
       |         - perf_sched_events jump label is decremented and == 0
       |         - __perf_event_task_sched_out is not called
       |         - cpuctx->task_ctx on CPU 0 stays set
       |
       | - exit is called on CPU 1:
       |         - the task is scheduled on CPU 1
       |         - perf_event_exit_task is called
       |         - task_ctx_sched_out unsets cpuctx->task_ctx on CPU 1
       |         - put_ctx destroys the context
       |
       | - another call of perf_rotate_context on CPU 0 will use invalid
       |   task_ctx pointer, and eventualy panic.
       |
      
      Cure this the simplest possibly way by partially reverting the
      jump_label optimization for the sched_out case.
      Reported-and-tested-by: default avatarJiri Olsa <jolsa@redhat.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: <stable@kernel.org> # .37+
      LKML-Reference: <1301520405.4859.213.camel@twins>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ab711fe0
    • Frederic Weisbecker's avatar
      perf: mmap 512 kiB by default · 800cd25c
      Frederic Weisbecker authored
      The default setting of perf record is to mmap 128 pages if the user
      did not override with -m.
      
      However the page size may vary accross different architecture
      settings, giving different default size between each.
      
      Moreover the kernel side still has a default max number of mlocked
      pages of 512 kiB + 1 page for unprivileged users. 128 + 1 pages
      with page size > 4096 overlaps this threshold.
      
      Thus, better adapt to this limitation and set the default number of
      pages to fit those 512 kiB + 1 page.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <1301535324-9735-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      800cd25c
    • Frederic Weisbecker's avatar
      perf: Rebase max unprivileged mlock threshold on top of page size · 20443384
      Frederic Weisbecker authored
      Ensure we allow 512 kiB + 1 page for user control without
      assuming a 4096 bytes page size.
      Reported-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: <stable@kernel.org>
      LKML-Reference: <1301535209-9679-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      20443384
  3. 30 Mar, 2011 2 commits
  4. 29 Mar, 2011 29 commits