1. 04 2月, 2010 17 次提交
    • P
      bitops: Ensure the compile time HWEIGHT is only used for such · fce877e3
      Peter Zijlstra 提交于
      Avoid accidental misuse by failing to compile things
      Suggested-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fce877e3
    • P
      perf_events, x86: Implement intel core solo/duo support · 8c48e444
      Peter Zijlstra 提交于
      Implement Intel Core Solo/Duo, aka.
      Intel Architectural Performance Monitoring Version 1.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8c48e444
    • P
      perf_events: Optimize perf_event_task_tick() · 9717e6cd
      Peter Zijlstra 提交于
      Pretty much all of the calls do perf_disable/perf_enable cycles, pull
      that out to cut back on hardware programming.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9717e6cd
    • M
      ftrace: Remove record freezing · f24bb999
      Masami Hiramatsu 提交于
      Remove record freezing. Because kprobes never puts probe on
      ftrace's mcount call anymore, it doesn't need ftrace to check
      whether kprobes on it.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: przemyslaw@pawelczyk.it
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100202214925.4694.73469.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f24bb999
    • M
      kprobes: Check probe address is reserved · 4554dbcb
      Masami Hiramatsu 提交于
      Check whether the address of new probe is already reserved by
      ftrace or alternatives (on x86) when registering new probe.
      If reserved, it returns an error and not register the probe.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: przemyslaw@pawelczyk.it
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Jason Baron <jbaron@redhat.com>
      LKML-Reference: <20100202214918.4694.94179.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4554dbcb
    • M
      ftrace/alternatives: Introducing *_text_reserved functions · 2cfa1978
      Masami Hiramatsu 提交于
      Introducing *_text_reserved functions for checking the text
      address range is partially reserved or not. This patch provides
      checking routines for x86 smp alternatives and dynamic ftrace.
      Since both functions modify fixed pieces of kernel text, they
      should reserve and protect those from other dynamic text
      modifier, like kprobes.
      
      This will also be extended when introducing other subsystems
      which modify fixed pieces of kernel text. Dynamic text modifiers
      should avoid those.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: przemyslaw@pawelczyk.it
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Jason Baron <jbaron@redhat.com>
      LKML-Reference: <20100202214911.4694.16587.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2cfa1978
    • M
      kprobes: Disable booster when CONFIG_PREEMPT=y · 615d0ebb
      Masami Hiramatsu 提交于
      Disable kprobe booster when CONFIG_PREEMPT=y at this time,
      because it can't ensure that all kernel threads preempted on
      kprobe's boosted slot run out from the slot even using
      freeze_processes().
      
      The booster on preemptive kernel will be resumed if
      synchronize_tasks() or something like that is introduced.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20100202214904.4694.24330.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      615d0ebb
    • M
      perf annotate: Fix perf top module symbol annotation · 57d81889
      Mike Galbraith 提交于
      Signed-off-by: NMike Galbraith <efault@gmx.de>
      Cc: Kirill Smelkov <kirr@landau.phys.spbu.ru>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1265265106.6364.5.camel@marge.simson.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      57d81889
    • K
      perf top: Teach it to autolocate vmlinux · 6cff0e8d
      Kirill Smelkov 提交于
      By relying on logic in dso__load_kernel_sym(), we can
      automatically load vmlinux.
      
      The only thing which needs to be adjusted, is how --sym-annotate
      option is handled - now we can't rely on vmlinux been loaded
      until full successful pass of dso__load_vmlinux(), but that's
      not the case if we'll do sym_filter_entry setup in
      symbol_filter().
      
      So move this step right after event__process_sample() where we
      know the whole dso__load_kernel_sym() pass is done.
      
      By the way, though conceptually similar `perf top` still can't
      annotate userspace - see next patches with fixes.
      Signed-off-by: NKirill Smelkov <kirr@landau.phys.spbu.ru>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <1265223128-11786-9-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6cff0e8d
    • K
      perf annotate: Fix it for non-prelinked *.so · 7a2b6209
      Kirill Smelkov 提交于
      The problem was we were incorrectly calculating objdump
      addresses for sym->start and sym->end, look:
      
      For simple ET_DYN type DSO (*.so) with one function, objdump -dS
      output is something like this:
      
          000004ac <my_strlen>:
          int my_strlen(const char *s)
           4ac:   55                      push   %ebp
           4ad:   89 e5                   mov    %esp,%ebp
           4af:   83 ec 10                sub    $0x10,%esp
          {
      
      i.e. we have relative-to-dso-mapping IPs (=RIP) there.
      
      For ET_EXEC type and probably for prelinked libs as well (sorry
      can't test - I don't use prelink) objdump outputs absolute IPs,
      e.g.
      
          08048604 <zz_strlen>:
          extern "C"
          int zz_strlen(const char *s)
           8048604:       55                      push   %ebp
           8048605:       89 e5                   mov    %esp,%ebp
           8048607:       83 ec 10                sub    $0x10,%esp
          {
      
      So, if sym->start is always relative to dso mapping(*), we'll
      have to unmap it for ET_EXEC like cases, and leave as is for
      ET_DYN cases.
      
      (*) and it is - we've explicitely made it relative. Look for
          adjust_symbols handling in dso__load_sym()
      
      Previously we were always unmapping sym->start and for ET_DYN
      dsos resulting addresses were wrong, and so objdump output was
      empty.
      
      The end result was that perf annotate output for symbols from
      non-prelinked *.so had always 0.00% percents only, which is
      wrong.
      
      To fix it, let's introduce a helper for converting rip to
      objdump address, and also let's document what map_ip() and
      unmap_ip() do -- I had to study sources for several hours to
      understand it.
      Signed-off-by: NKirill Smelkov <kirr@landau.phys.spbu.ru>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <1265223128-11786-8-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7a2b6209
    • A
      perf tools: Adjust some verbosity levels · 29a9f66d
      Arnaldo Carvalho de Melo 提交于
      Not to pollute too much 'perf annotate' debugging sessions.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1265223128-11786-7-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      29a9f66d
    • A
      perf record: Stop intercepting events, use postprocessing to get build-ids · 6122e4e4
      Arnaldo Carvalho de Melo 提交于
      We want to stream events as fast as possible to perf.data, and
      also in the future we want to have splice working, when no
      interception will be possible.
      
      Using build_id__mark_dso_hit_ops to create the list of DSOs that
      back MMAPs we also optimize disk usage in the build-id cache by
      only caching DSOs that had hits.
      Suggested-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1265223128-11786-6-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6122e4e4
    • A
      perf build-id: Move the routine to find DSOs with hits to the lib · 7b2567c1
      Arnaldo Carvalho de Melo 提交于
      Because 'perf record' will have to find the build-ids in after
      we stop recording, so as to reduce even more the impact in the
      workload while we do the measurement.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1265223128-11786-5-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7b2567c1
    • A
      perf probe: Don't use a perf_session instance just to resolve symbols · 8ad94c60
      Arnaldo Carvalho de Melo 提交于
      With the recent modifications done to untie the session and
      symbol layers, 'perf probe' now can use just the symbols layer.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8ad94c60
    • A
      perf symbols: Ditch vdso global variable · 8d92c02a
      Arnaldo Carvalho de Melo 提交于
      We can check using strcmp, most DSOs don't start with '[' so the
      test is cheap enough and we had to test it there anyway since
      when reading perf.data files we weren't calling the routine that
      created this global variable and thus weren't setting it as
      "loaded", which was causing a bogus:
      
        Failed to open [vdso], continuing without symbols
      
      Message as the first line of 'perf report'.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1265223128-11786-3-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8d92c02a
    • A
      perf symbols: Fixup vsyscall maps · 6275ce2d
      Arnaldo Carvalho de Melo 提交于
      While debugging a problem reported by Pekka Enberg by printing
      the IP and all the maps for a thread when we don't find a map
      for an IP I noticed that dso__load_sym needs to fixup these
      extra maps it creates to hold symbols in different ELF sections
      than the main kernel one.
      
      Now we're back showing things like:
      
      [root@doppio linux-2.6-tip]# perf report | grep vsyscall
           0.02%             mutt  [kernel.kallsyms].vsyscall_fn  [.] vread_hpet
           0.01%            named  [kernel.kallsyms].vsyscall_fn  [.] vread_hpet
           0.01%   NetworkManager  [kernel.kallsyms].vsyscall_fn  [.] vread_hpet
           0.01%         gconfd-2  [kernel.kallsyms].vsyscall_0   [.] vgettimeofday
           0.01%  hald-addon-rfki  [kernel.kallsyms].vsyscall_fn  [.] vread_hpet
           0.00%      dbus-daemon  [kernel.kallsyms].vsyscall_fn  [.] vread_hpet
      [root@doppio linux-2.6-tip]#
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1265223128-11786-2-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6275ce2d
    • A
      perf symbols: Remove perf_session usage in symbols layer · 9de89fe7
      Arnaldo Carvalho de Melo 提交于
      I noticed while writing the first test in 'perf regtest' that to
      just test the symbol handling routines one needs to create a
      perf session, that is a layer centered on a perf.data file,
      events, etc, so I untied these layers.
      
      This reduces the complexity for the users as the number of
      parameters to most of the symbols and session APIs now was
      reduced while not adding more state to all the map instances by
      only having data that is needed to split the kernel (kallsyms
      and ELF symtab sections) maps and do vmlinux relocation on the
      main kernel map.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1265223128-11786-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9de89fe7
  2. 03 2月, 2010 1 次提交
    • X
      perf tools: Use O_LARGEFILE to open perf data file · b8f46c5a
      Xiao Guangrong 提交于
      Open perf data file with O_LARGEFILE flag since its size is
      easily larger that 2G.
      
      For example:
      
       # rm -rf perf.data
       # ./perf kmem record sleep 300
      
       [ perf record: Woken up 0 times to write data ]
       [ perf record: Captured and wrote 3142.147 MB perf.data
       (~137282513 samples) ]
      
       # ll -h perf.data
       -rw------- 1 root root 3.1G .....
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <4B68F32A.9040203@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b8f46c5a
  3. 31 1月, 2010 6 次提交
    • I
      perf lock: Clean up various details · 59f411b6
      Ingo Molnar 提交于
      Fix up a few small stylistic details:
      
       - use consistent vertical spacing/alignment
       - remove line80 artifacts
       - group some global variables better
       - remove dead code
      
      Plus rename 'prof' to 'report' to make it more in line with other
      tools, and remove the line/file keying as we really want to use
      IPs like the other tools do.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1264851813-8413-12-git-send-email-mitake@dcl.info.waseda.ac.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      59f411b6
    • H
      perf lock: Introduce new tool "perf lock", for analyzing lock statistics · 9b5e350c
      Hitoshi Mitake 提交于
      Adding new subcommand "perf lock" to perf.
      
      I have a lot of remaining ToDos, but for now perf lock can
      already provide minimal functionality for analyzing lock
      statistics.
      Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1264851813-8413-12-git-send-email-mitake@dcl.info.waseda.ac.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9b5e350c
    • H
      perf lock: Enhance information of lock trace events · c965be10
      Hitoshi Mitake 提交于
      Add wait time and lock identification details.
      Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1264851813-8413-11-git-send-email-mitake@dcl.info.waseda.ac.jp>
      [ removed the file/line bits as we can do that better via IPs ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c965be10
    • H
      perf: Add util/include/linuxhash.h to include hash.h of kernel · 18e97e06
      Hitoshi Mitake 提交于
      linux/hash.h, hash header of kernel, is also useful for perf.
      
      util/include/linuxhash.h includes linux/hash.h, so we can use
      hash facilities (e.g. hash_long()) in perf now.
      Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1264851813-8413-3-git-send-email-mitake@dcl.info.waseda.ac.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      18e97e06
    • H
      perf tools: Add __data_loc support · 86d8d296
      Hitoshi Mitake 提交于
      This patch is required to test the next patch for perf lock.
      
      At 064739bc ,
      support for the modifier "__data_loc" of format is added.
      
      But, when I wanted to parse format of lock_acquired (or some
      event else), raw_field_ptr() did not returned correct pointer.
      
      So I modified raw_field_ptr() like this patch. Then
      raw_field_ptr() works well.
      Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <srostedt@redhat.com>
      LKML-Reference: <1264851813-8413-2-git-send-email-mitake@dcl.info.waseda.ac.jp>
      [ v3: fixed minor stylistic detail ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      86d8d296
    • H
      Revert "perf record: Intercept all events" · a8e6f734
      Hitoshi Mitake 提交于
      This reverts commit f5a2c3dc.
      
      This patch is required for making "perf lock rec" work.
      The commit f5a2c3dc changes write_event() of builtin-record.c
      . And changed write_event() sometimes doesn't stop with perf
      lock rec.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      [ that commit also causes perf record to not be Ctrl-C-able,
        and it's concetually wrong to parse the data at record time
        (unconditionally - even when not needed), as we eventually
        want to be able to do zero-copy recording, at least for
        non-archive recordings.  ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a8e6f734
  4. 29 1月, 2010 16 次提交