1. 08 Sep, 2012 2 commits
    • Jiri Olsa's avatar
      perf tools: Replace sort's standalone field_sep with symbol_conf.field_sep · 0ca0c130
      Jiri Olsa authored
      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: default avatarJiri 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0ca0c130
    • Jiri Olsa's avatar
      perf diff: Make diff command work with evsel hists · 863e451f
      Jiri Olsa authored
      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: default avatarJiri 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      863e451f
  2. 07 Sep, 2012 5 commits
  3. 06 Sep, 2012 8 commits
  4. 05 Sep, 2012 18 commits
  5. 28 Aug, 2012 7 commits
    • Oleg Nesterov's avatar
      uprobes: Remove "verify" argument from set_orig_insn() · ded86e7c
      Oleg Nesterov authored
      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: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      ded86e7c
    • Oleg Nesterov's avatar
      uprobes: Fold uprobe_reset_state() into uprobe_dup_mmap() · 61559a81
      Oleg Nesterov authored
      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: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      61559a81
    • Oleg Nesterov's avatar
      uprobes: Introduce MMF_HAS_UPROBES · f8ac4ec9
      Oleg Nesterov authored
      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: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      f8ac4ec9
    • Oleg Nesterov's avatar
      uprobes: Do not use -EEXIST in install_breakpoint() paths · 78f74116
      Oleg Nesterov authored
      -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: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      78f74116
    • Oleg Nesterov's avatar
      uprobes: Change uprobe_mmap() to ignore the errors but check fatal_signal_pending() · 5e5be71a
      Oleg Nesterov authored
      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: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      5e5be71a
    • Oleg Nesterov's avatar
      uprobes: Kill dup_mmap()->uprobe_mmap(), simplify uprobe_mmap/munmap · f1a45d02
      Oleg Nesterov authored
      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: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      f1a45d02
    • Oleg Nesterov's avatar
      uprobes: Kill uprobes_state->count · 647c42df
      Oleg Nesterov authored
      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: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      647c42df