1. 08 9月, 2012 2 次提交
    • J
      perf tools: Replace sort's standalone field_sep with symbol_conf.field_sep · 0ca0c130
      Jiri Olsa 提交于
      The repsep_snprintf function was still using standalone field_sep, which
      not even set anymore.
      
      Replacing it with 'symbol_conf.field_sep'.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Andi Kleen <andi@firstfloor.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@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1346946426-13496-3-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0ca0c130
    • J
      perf diff: Make diff command work with evsel hists · 863e451f
      Jiri Olsa 提交于
      Putting 'perf diff' command back on track with the 'latest'
      evsel hists changes. Each evsel has its own 'hists' object
      gathering stats for the particular event.
      
      While currently counts are accumulated for the whole session
      regardless of the events diversification within compared
      sessions.
      
      The 'perf diff' command now outputs all matching events within
      compared sessions (with event name specified). The per event
      diff output stays the same.
      
        $ ./perf diff
        # Event 'cycles'
        #
        # Baseline  Delta          Shared Object                          Symbol
        # ........ ..........  .................  ..............................
        #
             0.00%    +15.14%  [kernel.kallsyms]  [k] __wake_up
             0.00%    +13.38%  [kernel.kallsyms]  [k] ext4fs_dirhash
      
      ... SNIP
      
             0.00%     +0.42%  [kernel.kallsyms]  [k] local_clock
             0.17%     -0.05%  [kernel.kallsyms]  [k] native_write_msr_safe
      
        # Event 'faults'
        #
        # Baseline  Delta          Shared Object                          Symbol
        # ........ ..........  .................  ..............................
        #
             0.00%    +79.12%  ld-2.15.so         [.] _dl_relocate_object
             0.00%    +11.62%  ld-2.15.so         [.] openaux
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Andi Kleen <andi@firstfloor.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@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1346946426-13496-2-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      863e451f
  2. 07 9月, 2012 10 次提交
  3. 06 9月, 2012 20 次提交
  4. 05 9月, 2012 1 次提交
  5. 29 8月, 2012 7 次提交
    • O
      uprobes: Remove "verify" argument from set_orig_insn() · ded86e7c
      Oleg Nesterov 提交于
      Nobody does set_orig_insn(verify => false), and I think nobody will.
      Remove this argument. IIUC set_orig_insn(verify => false) was needed
      to single-step without xol area.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      ded86e7c
    • O
      uprobes: Fold uprobe_reset_state() into uprobe_dup_mmap() · 61559a81
      Oleg Nesterov 提交于
      Now that we have uprobe_dup_mmap() we can fold uprobe_reset_state()
      into the new hook and remove it. mmput()->uprobe_clear_state() can't
      be called before dup_mmap().
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      61559a81
    • O
      uprobes: Introduce MMF_HAS_UPROBES · f8ac4ec9
      Oleg Nesterov 提交于
      Add the new MMF_HAS_UPROBES flag. It is set by install_breakpoint()
      and it is copied by dup_mmap(), uprobe_pre_sstep_notifier() checks
      it to avoid the slow path if the task was never probed. Perhaps it
      makes sense to check it in valid_vma(is_register => false) as well.
      
      This needs the new dup_mmap()->uprobe_dup_mmap() hook. We can't use
      uprobe_reset_state() or put MMF_HAS_UPROBES into MMF_INIT_MASK, we
      need oldmm->mmap_sem to avoid the race with uprobe_register() or
      mmap() from another thread.
      
      Currently we never clear this bit, it can be false-positive after
      uprobe_unregister() or uprobe_munmap() or if dup_mmap() hits the
      probed VM_DONTCOPY vma. But this is fine correctness-wise and has
      no effect unless the task hits the non-uprobe breakpoint.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      f8ac4ec9
    • O
      uprobes: Do not use -EEXIST in install_breakpoint() paths · 78f74116
      Oleg Nesterov 提交于
      -EEXIST from install_breakpoint() no longer makes sense, all
      callers should simply treat it as "success". Change the code
      to return zero and simplify register_for_each_vma().
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      78f74116
    • O
      uprobes: Change uprobe_mmap() to ignore the errors but check fatal_signal_pending() · 5e5be71a
      Oleg Nesterov 提交于
      Once install_breakpoint() fails uprobe_mmap() "ignores" all other
      uprobes and returns the error.
      
      It was never really needed to to stop after the first error, and
      in fact it was always wrong at least in -ENOTSUPP case.
      
      Change uprobe_mmap() to ignore the errors and always return 0.
      This is not what we want in the long term, but until we teach
      the callers to handle the failure it would be better to remove
      the pointless complications. And this doesn't look too bad, the
      only "reasonable" error is ENOMEM but in this case the caller
      should be oom-killed in the likely case or the system has more
      serious problems.
      
      However it makes sense to stop if fatal_signal_pending() == T.
      In particular this helps if the task was oom-killed.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      5e5be71a
    • O
      uprobes: Kill dup_mmap()->uprobe_mmap(), simplify uprobe_mmap/munmap · f1a45d02
      Oleg Nesterov 提交于
      1. Kill dup_mmap()->uprobe_mmap(), it was only needed to calculate
         new_mm->uprobes_state.count removed by the previous patch.
      
         If the forking process has a pending uprobe (int3) in vma, it will
         be copied by copy_page_range(), note that it checks vma->anon_vma
         so "Don't copy ptes" is not possible after install_breakpoint()
         which does anon_vma_prepare().
      
      2. Remove is_swbp_at_addr() and "int count" in uprobe_mmap(). Again,
         this was needed for uprobes_state.count.
      
         As a side effect this fixes the bug pointed out by Srikar,
         this code lacked the necessary put_uprobe().
      
      3. uprobe_munmap() becomes a nop after the previous patch. Remove the
         meaningless code but do not remove the helper, we will need it.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      f1a45d02
    • O
      uprobes: Kill uprobes_state->count · 647c42df
      Oleg Nesterov 提交于
      uprobes_state->count is only needed to avoid the slow path in
      uprobe_pre_sstep_notifier(). It is also checked in uprobe_munmap()
      but ironically its only goal to decrement this counter. However,
      it is very broken. Just some examples:
      
      - uprobe_mmap() can race with uprobe_unregister() and wrongly
        increment the counter if it hits the non-uprobe "int3". Note
        that install_breakpoint() checks ->consumers first and returns
        -EEXIST if it is NULL.
      
        "atomic_sub() if error" in uprobe_mmap() looks obviously wrong
        too.
      
      - uprobe_munmap() can race with uprobe_register() and wrongly
        decrement the counter by the same reason.
      
      - Suppose an appication tries to increase the mmapped area via
        sys_mremap(). vma_adjust() does uprobe_munmap(whole_vma) first,
        this can nullify the counter temporarily and race with another
        thread which can hit the bp, the application will be killed by
        SIGTRAP.
      
      - Suppose an application mmaps 2 consecutive areas in the same file
        and one (or both) of these areas has uprobes. In the likely case
        mmap_region()->vma_merge() suceeds. Like above, this leads to
        uprobe_munmap/uprobe_mmap from vma_merge()->vma_adjust() but then
        mmap_region() does another uprobe_mmap(resulting_vma) and doubles
        the counter.
      
      This patch only removes this counter and fixes the compile errors,
      then we will try to cleanup the changed code and add something else
      instead.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      647c42df