1. 07 Oct, 2012 4 commits
    • Oleg Nesterov's avatar
      uprobes: Fix handle_swbp() vs unregister() + register() race · 142b18dd
      Oleg Nesterov authored
      Strictly speaking this race was added by me in 56bb4cf6. However
      I think that this bug is just another indication that we should
      move copy_insn/uprobe_analyze_insn code from install_breakpoint()
      to uprobe_register(), there are a lot of other reasons for that.
      Until then, add a hack to close the race.
      
      A task can hit uprobe U1, but before it calls find_uprobe() this
      uprobe can be unregistered *AND* another uprobe U2 can be added to
      uprobes_tree at the same inode/offset. In this case handle_swbp()
      will use the not-fully-initialized U2, in particular its arch.insn
      for xol.
      
      Add the additional !UPROBE_COPY_INSN check into handle_swbp(),
      if this flag is not set we simply restart as if the new uprobe was
      not inserted yet. This is not very nice, we need barriers, but we
      will remove this hack when we change uprobe_register().
      
      Note: with or without this patch install_breakpoint() can race with
      itself, yet another reson to kill UPROBE_COPY_INSN altogether. And
      even the usage of uprobe->flags is not safe. See the next patches.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      142b18dd
    • Oleg Nesterov's avatar
      uprobes: Do not delete uprobe if uprobe_unregister() fails · 076a365b
      Oleg Nesterov authored
      delete_uprobe() must not be called if register_for_each_vma(false)
      fails to remove all breakpoints, __uprobe_unregister() is correct.
      The problem is that register_for_each_vma(false) always returns 0
      and thus this logic does not work.
      
      1. Change verify_opcode() to return 0 rather than -EINVAL when
         unregister detects the !is_swbp insn, we can treat this case
         as success and currently unregister paths ignore the error
         code anyway.
      
      2. Change remove_breakpoint() to propagate the error code from
         write_opcode().
      
      3. Change register_for_each_vma(is_register => false) to remove
         as much breakpoints as possible but return non-zero if
         remove_breakpoint() fails at least once.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      076a365b
    • Oleg Nesterov's avatar
      uprobes: Don't return success if alloc_uprobe() fails · a5f658b7
      Oleg Nesterov authored
      If alloc_uprobe() fails uprobe_register() should return ENOMEM, not 0.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      a5f658b7
    • Oleg Nesterov's avatar
      uprobes/x86: Only rep+nop can be emulated correctly · b64b9c93
      Oleg Nesterov authored
      __skip_sstep() correctly detects the "nontrivial" nop insns,
      but since it doesn't update regs->ip we can not really skip
      "0x0f 0x1f | 0x0f 0x19 | 0x87 0xc0", the probed application
      is killed by SIGILL'ed handle_swbp().
      
      Remove these additional checks. If we want to implement this
      correctly we need to know the full insn length to update ->ip.
      
      rep* + nop is fine even without updating ->ip.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      b64b9c93
  2. 29 Sep, 2012 12 commits
  3. 28 Sep, 2012 1 commit
  4. 27 Sep, 2012 3 commits
  5. 26 Sep, 2012 15 commits
  6. 25 Sep, 2012 2 commits
  7. 24 Sep, 2012 3 commits
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · f74eb728
      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:
      
       * Convert the trace builtins to use the growing evsel/evlist
         tracepoint infrastructure, removing several open coded constructs
         like switch like series of strcmp to dispatch events, etc.
         Basically what had already been showcased in 'perf sched'.
      
       * Add evsel constructor for tracepoints, that uses libtraceevent
         just to parse the /format events file, use it in a new 'perf test'
         to make sure the libtraceevent format parsing regressions can
         be more readily caught.
      
       * Some strange errors were happening in some builds, but not on the
         next, reported by several people, problem was some parser related
         files, generated during the build, didn't had proper make deps,
         fix from Eric Sandeen.
      
       * Fix some compiling errors on 32-bit, from Feng Tang.
      
       * Don't use sscanf extension %as, not available on bionic, reimplementation
         by Irina Tirdea.
      
       * Fix bfd.h/libbfd detection with recent binutils, from Markus Trippelsdorf.
      
       * Introduce struct and cache information about the environment where a
         perf.data file was captured, from Namhyung Kim.
      
       * Fix several error paths in libtraceevent, from Namhyung Kim.
      
         Print event causing perf_event_open() to fail in 'perf record',
         from Stephane Eranian.
      
       * New 'kvm' analysis tool, from Xiao Guangrong.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f74eb728
    • Ezequiel Garcia's avatar
      trace: Move trace event enable from fs_initcall to core_initcall · 8781915a
      Ezequiel Garcia authored
      This patch splits trace event initialization in two stages:
       * ftrace enable
       * sysfs event entry creation
      
      This allows to capture trace events from an earlier point
      by using 'trace_event' kernel parameter and is important
      to trace boot-up allocations.
      
      Note that, in order to enable events at core_initcall,
      it's necessary to move init_ftrace_syscalls() from
      core_initcall to early_initcall.
      
      Link: http://lkml.kernel.org/r/1347461277-25302-1-git-send-email-elezegarcia@gmail.comSigned-off-by: default avatarEzequiel Garcia <elezegarcia@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      8781915a
    • Mandeep Singh Baines's avatar
      tracing: Add an option for disabling markers · 5224c3a3
      Mandeep Singh Baines authored
      In our application, we have trace markers spread through user-space.
      We have markers in GL, X, etc. These are super handy for Chrome's
      about:tracing feature (Chrome + system + kernel trace view), but
      can be very distracting when you're trying to debug a kernel issue.
      
      I normally, use "grep -v tracing_mark_write" but it would be nice
      if I could just temporarily disable markers all together.
      
      Link: http://lkml.kernel.org/r/1347066739-26285-1-git-send-email-msb@chromium.org
      
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarMandeep Singh Baines <msb@chromium.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      5224c3a3