1. 15 4月, 2010 17 次提交
    • M
      perf probe: Fix line range to show end line · dda4ab34
      Masami Hiramatsu 提交于
      Line range should reject the range if the number of lines is 0
      (e.g. "sched.c:1024+0"), and it should show the lines include
      the end of line number (e.g. "sched.c:1024-2048" should show
      2048th line).
      
      LKML-Reference: <20100414223950.14630.42263.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dda4ab34
    • M
      perf probe: Fix a bug that --line range can be overflow · d3b63d7a
      Masami Hiramatsu 提交于
      Since line_finder.lno_s/e are signed int but line_range.start/end
      are unsigned int, it is possible to be overflow when converting
      line_range->start/end to line_finder->lno_s/e.
      This changes line_range.start/end and line_list.line to signed int
      and adds overflow checks when setting line_finder.lno_s/e.
      
      LKML-Reference: <20100414223942.14630.72730.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d3b63d7a
    • M
      perf probe: Fix mis-estimation for shortening filename · dd259c5d
      Masami Hiramatsu 提交于
      Fix mis-estimation size for making a short filename.
      Since the buffer size is 32 bytes and there are '@' prefix and
      '\0' termination, maximum shorten filename length should be
      30. This means, before searching '/', it should be 31 bytes.
      
      LKML-Reference: <20100414223935.14630.11954.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dd259c5d
    • M
      perf probe: Fix to use correct debugfs path finder · 7ca5989d
      Masami Hiramatsu 提交于
      Instead of using debugfs_path, use debugfs_find_mountpoint()
      to find actual debugfs path.
      
      LKML-Reference: <20100414223928.14630.38326.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7ca5989d
    • M
      perf probe: Remove xstrdup()/xstrndup() from util/probe-{event, finder}.c · 02b95dad
      Masami Hiramatsu 提交于
      Remove all xstr*dup() calls from util/probe-{event,finder}.c since
      it may cause 'sudden death' in utility functions and it makes
      reusing it from other code difficult.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171756.3790.89607.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      02b95dad
    • M
      perf probe: Remove xzalloc() from util/probe-{event, finder}.c · e334016f
      Masami Hiramatsu 提交于
      Remove all xzalloc() calls from util/probe-{event,finder}.c since
      it may cause 'sudden death' in utility functions and it makes
      reusing it from other code difficult.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171749.3790.33303.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e334016f
    • M
      perf probe: Remove die() from probe-event code · 146a1439
      Masami Hiramatsu 提交于
      Remove die() and DIE_IF() code from util/probe-event.c since
      these 'sudden death' in utility functions make reusing it from
      other code (especially tui/gui) difficult.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171742.3790.33650.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      146a1439
    • M
      perf probe: Remove die() from probe-finder code · b55a87ad
      Masami Hiramatsu 提交于
      Remove die() and DIE_IF() code from util/probe-finder.c since
      these 'sudden death' in utility functions make reusing it from
      other code (especially tui/gui) difficult.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171735.3790.88853.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b55a87ad
    • M
      perf probe: Support DW_OP_call_frame_cfa in debuginfo · a34a9854
      Masami Hiramatsu 提交于
      When building kernel without CONFIG_FRAME_POINTER, gcc uses
      CFA (canonical frame address) for frame base. With this patch,
      perf probe just gets CFI (call frame information) from debuginfo
      and search corresponding CFA from the CFI. IOW, this allows
      perf probe works correctly on the kernel without CONFIG_FRAME_POINTER.
      
      <Before>
       ./perf probe -fn sched_slice:12 lw.weight
        Fatal: DW_OP 156 is not supported.
                    (^^^ DW_OP_call_frame_cfa)
      
      <After>
      ./perf probe -fn sched_slice:12 lw.weight
      Add new event:
        probe:sched_slice    (on sched_slice:12 with weight=lw.weight)
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171728.3790.98217.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a34a9854
    • M
      perf probe: Support basic type casting · 11a1ca35
      Masami Hiramatsu 提交于
      Add basic type casting for arguments to perf probe. This allows
      users to specify the actual type of arguments. Of course, if
      user sets invalid types, kprobe-tracer rejects that.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171722.3790.50372.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      11a1ca35
    • M
      perf probe: Query basic types from debuginfo · 4984912e
      Masami Hiramatsu 提交于
      Query the basic type information (byte-size and signed-flag) from
      debuginfo and pass that to kprobe-tracer. This is especially useful
      for tracing the members of data structure, because each member has
      different byte-size on the memory.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171715.3790.23730.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4984912e
    • M
      tracing/kprobes: Support basic types on dynamic events · 93ccae7a
      Masami Hiramatsu 提交于
      Support basic types of integer (u8, u16, u32, u64, s8, s16, s32, s64) in
      kprobe tracer. With this patch, users can specify above basic types on
      each arguments after ':'. If omitted, the argument type is set as
      unsigned long (u32 or u64, arch-dependent).
      
       e.g.
        echo 'p account_system_time+0 hardirq_offset=%si:s32' > kprobe_events
      
        adds a probe recording hardirq_offset in signed-32bits value on the
        entry of account_system_time.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171708.3790.18599.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      93ccae7a
    • M
      perf probe: Use the last field name as the argument name · df0faf4b
      Masami Hiramatsu 提交于
      Set the last field name to the argument name when the argument
      is refering a data-structure member.
      
      e.g.
       ./perf probe --add 'vfs_read file->f_mode'
       Add new event:
         probe:vfs_read       (on vfs_read with f_mode=file->f_mode)
      
       This probe records file->f_mode, but the argument name becomes "f_mode".
      
      This enables perf-trace command to parse trace event format correctly.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171700.3790.72961.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      df0faf4b
    • M
      perf probe: Support argument name · 48481938
      Masami Hiramatsu 提交于
      Set given names to event arguments. The syntax is same as kprobe-tracer,
      you can add 'NAME=' right before each argument.
      
      e.g.
        ./perf probe vfs_read foo=file
      
       then, 'foo' is set to the argument name as below.
      
        ./perf probe -l
        probe:vfs_read       (on vfs_read@linux-2.6-tip/fs/read_write.c with foo)
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171653.3790.74624.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      48481938
    • F
      perf tools: Fix accidentally preprocessed snprintf callback · fcd14984
      Frederic Weisbecker 提交于
      struct sort_entry has a callback named snprintf that turns an
      entry into a string result.
      But there are glibc versions that implement snprintf through a
      macro. The following expression is then going to get the snprintf
      call preprocessed:
      
              ent->snprintf(...)
      
      to finally end up in a build error:
      
              util/hist.c: Dans la fonction «hist_entry__snprintf» :
              util/hist.c:539: erreur: «struct sort_entry» has no member named «__builtin___snprintf_chk»
      
      To fix this, prepend struct sort_entry callbacks with an "se_"
      prefix.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fcd14984
    • F
      perf: Make clock software events consistent with general exclusion rules · df8290bf
      Frederic Weisbecker 提交于
      The cpu/task clock events implement their own version of exclusion
      on top of exclude_user and exclude_kernel.
      
      The result is that when the event triggered in the kernel but we
      have exclude_kernel set, we try to rewind using task_pt_regs.
      There are two side effects of this:
      
      - we call task_pt_regs even on kernel threads, which doesn't give
        us the desired result.
      - if the event occured in the kernel, we shouldn't rewind to the
        user context. We want to actually ignore the event.
      
      get_irq_regs() will always give us the right interrupted context, so
      use its result and submit it to perf_exclude_context() that knows
      when an event must be ignored.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      df8290bf
    • F
      perf: Store active software events in a hashlist · 76e1d904
      Frederic Weisbecker 提交于
      Each time a software event triggers, we need to walk through
      the entire list of events from the current cpu and task contexts
      to retrieve a running perf event that matches.
      We also need to check a matching perf event is actually counting.
      
      This walk is wasteful and makes the event fast path scaling
      down with a growing number of events running on the same
      contexts.
      
      To solve this, we store the running perf events in a hashlist to
      get an immediate access to them against their type:event_id when
      they trigger.
      
      v2: - Fix SWEVENT_HLIST_SIZE definition (and re-learn some basic
            maths along the way)
          - Only allocate hlist for online cpus, but keep track of the
            refcount on offline possible cpus too, so that we allocate it
            if needed when it becomes online.
          - Drop the kref use as it's not adapted to our tricks anymore.
      
      v3: - Fix bad refcount check (address instead of value). Thanks to
            Eric Dumazet who spotted this.
          - While exiting cpu, move the hlist release out of the IPI path
            to lock the hlist mutex sanely.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      76e1d904
  2. 14 4月, 2010 1 次提交
    • I
      perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() · c0555642
      Ian Munsie 提交于
      Parsing an option from the command line with OPT_BOOLEAN on a
      bool data type would not work on a big-endian machine due to the
      manner in which the boolean was being cast into an int and
      incremented. For example, running 'perf probe --list' on a
      PowerPC machine would fail to properly set the list_events bool
      and would therefore print out the usage information and
      terminate.
      
      This patch makes OPT_BOOLEAN work as expected with a bool
      datatype. For cases where the original OPT_BOOLEAN was
      intentionally being used to increment an int each time it was
      passed in on the command line, this patch introduces OPT_INCR
      with the old behaviour of OPT_BOOLEAN (the verbose variable is
      currently the only such example of this).
      
      I have reviewed every use of OPT_BOOLEAN to verify that a true
      C99 bool was passed. Where integers were used, I verified that
      they were only being used for boolean logic and changed them to
      bools to ensure that they would not be mistakenly used as ints.
      The major exception was the verbose variable which now uses
      OPT_INCR instead of OPT_BOOLEAN.
      Signed-off-by: NIan Munsie <imunsie@au.ibm.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: <stable@kernel.org> # NOTE: wont apply to .3[34].x cleanly, please backport
      Cc: Git development list <git@vger.kernel.org>
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Eric B Munson <ebmunson@us.ibm.com>
      Cc: Valdis.Kletnieks@vt.edu
      Cc: WANG Cong <amwang@redhat.com>
      Cc: Thiago Farina <tfransosi@gmail.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1271147857-11604-1-git-send-email-imunsie@au.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0555642
  3. 10 4月, 2010 1 次提交
  4. 08 4月, 2010 19 次提交
  5. 07 4月, 2010 2 次提交
    • L
      Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze · addb2d6c
      Linus Torvalds 提交于
      * 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze:
        microblaze: Remove unused variable from ptrace
        microblaze: io.h: Add io big-endian function
        microblaze: Enable memory leak detector
        microblaze: Fix futex code
        microblaze: Fix ftrace_update_ftrace_func panic
      addb2d6c
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 · 84db18bb
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
        ALSA: mixart: range checking proc file
        ALSA: hda - Fix a wrong array range check in patch_realtek.c
        ALSA: ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream
        ALSA: hda - Enable amplifiers on Acer Inspire 6530G
        ASoC: Only do WM8994 bias off transition from standby
        ASoC: Don't use DCS_DATAPATH_BUSY for WM hubs devices
        ASoC: Don't do runtime wm_hubs DC servo updates if using offset correction
        ASoC: Support second DC servo readback method for wm_hubs
        ASoC: Avoid wraparound in wm_hubs DC servo correction
        ALSA: echoaudio - Eliminate use after free
        ALSA: i2c: cleanup: change parameter to pointer
        ALSA: hda - Add MSI blacklist for Aopen MZ915-M
        ASoC: OMAP: Fix capture pointer handling for OMAP1510 to work correctly with recent ALSA PCM code
        ALSA: hda - Update document about MSI and interrupts
        ALSA: hda: Fix 0 dB offset for Lenovo Thinkpad models using AD1981
        ALSA: hda - Add missing printk argument in previous patch
        ASoC: Fix passing platform_data to ac97 bus users and fix a leak
        ALSA: hda - Fix ADC/MUX assignment of ALC269 codec
        ALSA: hda - Fix invalid bit values passed to snd_hda_codec_amp_stereo()
        ASoC: wm8994: playback => capture
      84db18bb