1. 29 Jan, 2010 11 commits
  2. 28 Jan, 2010 1 commit
    • Anton Blanchard's avatar
      perf: Fix inconsistency between IP and callchain sampling · 339ce1a4
      Anton Blanchard authored
      When running perf across all cpus with backtracing (-a -g), sometimes we
      get samples without associated backtraces:
      
          23.44%         init  [kernel]                     [k] restore
          11.46%         init                       eeba0c  [k] 0x00000000eeba0c
           6.77%      swapper  [kernel]                     [k] .perf_ctx_adjust_freq
           5.73%         init  [kernel]                     [k] .__trace_hcall_entry
           4.69%         perf  libc-2.9.so                  [.] 0x0000000006bb8c
                             |
                             |--11.11%-- 0xfffa941bbbc
      
      It turns out the backtrace code has a check for the idle task and the IP
      sampling does not. This creates problems when profiling an interrupt
      heavy workload (in my case 10Gbit ethernet) since we get no backtraces
      for interrupts received while idle (ie most of the workload).
      
      Right now x86 and sh check that current is not NULL, which should never
      happen so remove that too.
      
      Idle task's exclusion must be performed from the core code, on top
      of perf_event_attr:exclude_idle.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      LKML-Reference: <20100118054707.GT12666@kryten>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      339ce1a4
  3. 27 Jan, 2010 6 commits
  4. 21 Jan, 2010 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf buildid-cache: Add new command to manage build-id cache · ef12a141
      Arnaldo Carvalho de Melo authored
      For now it just has operations to examine a given file, find its
      build-id and add or remove it to/from the cache.
      
      Useful, for instance, when adding binaries sent together with a
      perf.data file, so that we can add them to the cache and have
      the tools find it when resolving symbols.
      
      It'll also manage the size of the cache like 'ccache' does.
      Signed-off-by: default avatarArnaldo 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: <1264008525-29025-1-git-send-email-acme@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ef12a141
  5. 20 Jan, 2010 6 commits
  6. 18 Jan, 2010 1 commit
  7. 17 Jan, 2010 7 commits
    • Frederic Weisbecker's avatar
      perf: Better order flexible and pinned scheduling · 329c0e01
      Frederic Weisbecker authored
      When a task gets scheduled in. We don't touch the cpu bound events
      so the priority order becomes:
      
      	cpu pinned, cpu flexible, task pinned, task flexible.
      
      So schedule out cpu flexibles when a new task context gets in
      and correctly order the groups to schedule in:
      
      	task pinned, cpu flexible, task flexible.
      
      Cpu pinned groups don't need to be touched at this time.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      329c0e01
    • Frederic Weisbecker's avatar
      perf: Don't schedule out/in pinned events on task tick · 7defb0f8
      Frederic Weisbecker authored
      We don't need to schedule in/out pinned events on task tick,
      now that pinned and flexible groups can be scheduled separately.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      7defb0f8
    • Frederic Weisbecker's avatar
      perf: Allow pinned and flexible groups to be scheduled separately · 5b0311e1
      Frederic Weisbecker authored
      Tune the scheduling helpers so that we can choose to schedule either
      pinned and/or flexible groups from a context.
      
      And while at it, refactor a bit the naming of these helpers to make
      these more consistent and flexible.
      
      There is no (intended) change in scheduling behaviour in this
      patch.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      5b0311e1
    • Frederic Weisbecker's avatar
      perf: Make __perf_event_sched_out static · 42cce92f
      Frederic Weisbecker authored
      __perf_event_sched_out doesn't need to be globally available, make
      it static.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      42cce92f
    • Masami Hiramatsu's avatar
      tracing/kprobe: Update kprobe tracing self test for new syntax · 231e36f4
      Masami Hiramatsu authored
      Update kprobe tracing self test for new syntax (it supports
      deleting individual probes, and drops $argN support)
      and behavior change (new probes are disabled in default).
      
      This selftest includes the following checks:
      
       - Adding function-entry probe and return probe with arguments.
       - Enabling these probes.
       - Deleting it individually.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100114051211.7814.29436.stgit@localhost6.localdomain6>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      231e36f4
    • Hitoshi Mitake's avatar
      perf probe: Fix build error of builtin-probe.c · 0eda7385
      Hitoshi Mitake authored
      I got this build error when building tip tree:
      
      | cc1: warnings being treated as errors
      | builtin-probe.c:123: error: 'opt_show_lines' defined but not used
      
      This error is caused by:
      
      | #ifndef NO_LIBDWARF
      |	OPT_CALLBACK('L', "line", NULL,
      |		     "FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]",
      |		     "Show source code lines.", opt_show_lines),
      | #endif
      
      My environment defines NO_LIBDWARF, so gcc treated
      opt_show_lines() as garbage. So I moved opt_show_lines() into
      #ifndef NO_LIBDWARF ... #endif block.
      Signed-off-by: default avatarHitoshi 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>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <1263645076-9993-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0eda7385
    • Frederic Weisbecker's avatar
      perf: Fix implicit declaration of getline in util.c · 69e3f52d
      Frederic Weisbecker authored
      getline() is considered as undeclared in util/util.c because
      it includes string.h, that in turn includes stdio.h, without
      having defined _GNU_SOURCE.
      
      But util.c also includes util.h that handles the _GNU_SOURCE and
      all the needed inclusions already. Let's include only util.h
      and sys/mman.h which is the only one header not handled by
      util.h
      
      This fixes the following build error:
      
       util/util.c: In function 'slow_copyfile':
       util/util.c:49: erreur: implicit declaration of function
       'getline' util/util.c:49: erreur: nested extern declaration of 'getline'
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1263648075-3858-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      69e3f52d
  8. 16 Jan, 2010 7 commits
    • Frederic Weisbecker's avatar
      perf: Export software-only event group characteristic as a flag · d6f962b5
      Frederic Weisbecker authored
      Before scheduling an event group, we first check if a group can go
      on. We first check if the group is made of software only events
      first, in which case it is enough to know if the group can be
      scheduled in.
      
      For that purpose, we iterate through the whole group, which is
      wasteful as we could do this check when we add/delete an event to
      a group.
      
      So we create a group_flags field in perf event that can host
      characteristics from a group of events, starting with a first
      PERF_GROUP_SOFTWARE flag that reduces the check on the fast path.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      d6f962b5
    • Frederic Weisbecker's avatar
      perf: Round robin flexible groups of events using list_rotate_left() · e2864173
      Frederic Weisbecker authored
      This is more proper that doing it through a list_for_each_entry()
      that breaks after the first entry.
      
      v2: Don't rotate pinned groups as its not needed to time share
      them.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      e2864173
    • Frederic Weisbecker's avatar
      list: Introduce list_rotate_left() · 5908cdc8
      Frederic Weisbecker authored
      Bring a new list_rotate_left() helper that rotates a list to
      the left. This is useful for codes that need to round roubin
      elements which queue priority increases from tail to head.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      5908cdc8
    • Frederic Weisbecker's avatar
      perf/core: Split context's event group list into pinned and non-pinned lists · 889ff015
      Frederic Weisbecker authored
      Split-up struct perf_event_context::group_list into pinned_groups
      and flexible_groups (non-pinned).
      
      This first appears to be useless as it duplicates various loops around
      the group list handlings.
      
      But it scales better in the fast-path in perf_sched_in(). We don't
      anymore iterate twice through the entire list to separate pinned and
      non-pinned scheduling. Instead we interate through two distinct lists.
      
      The another desired effect is that it makes easier to define distinct
      scheduling rules on both.
      
      Changes in v2:
      - Respectively rename pinned_grp_list and
        volatile_grp_list into pinned_groups and flexible_groups as per
        Ingo suggestion.
      - Various cleanups
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      889ff015
    • Arnaldo Carvalho de Melo's avatar
      perf symbols: Accept an alias when looking for "_text" · 881516eb
      Arnaldo Carvalho de Melo authored
      As it is in PARISC64:
      
      parisc:~# uname -a
      Linux parisc 2.6.33-rc4-tip+ #1 SMP Thu Jan 14 13:33:34 BRST
      2010 parisc64 GNU/Linux parisc:~# grep -w _text /proc/kallsyms
      0000000040100000 A _text
      parisc:~# grep 0000000040100000 /proc/kallsyms
      0000000040100000 T stext
      0000000040100000 T _stext
      0000000040100000 A _text
      parisc:~#
      Signed-off-by: default avatarArnaldo 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: <1263586107-1756-2-git-send-email-acme@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      881516eb
    • Arnaldo Carvalho de Melo's avatar
      perf record: Intercept all events · f5a2c3dc
      Arnaldo Carvalho de Melo authored
      The event interception we need to do in 'perf record' to create
      a list of all DSOs in PERF_RECORD_MMAP events wasn't seeing all
      events, make sure that happens by checking size agains
      event_t->header.size.
      Signed-off-by: default avatarArnaldo 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: <1263586107-1756-1-git-send-email-acme@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f5a2c3dc
    • Arnaldo Carvalho de Melo's avatar
      perf archive: Add helper script to package files needed to do analysis · 2c585174
      Arnaldo Carvalho de Melo authored
      It uses 'perf buildid-list --with-hits' to create a tarball with
      what is needed to have in the destination machine ~/.debug
      hierarchy to properly decode the perf.data file specified.
      
      Here is an example where a perf.data file collected on a x86-64
      machine running Fedora 12 is used and then the data is packaged,
      transferred and decoded on a PARISC64 machine running Debian
      Testing, 32-bit userspace:
      
      [root@doppio linux-2.6-tip]# uname -a
      Linux doppio.ghostprotocols.net 2.6.33-rc4-tip+ #3 SMP Wed Jan 13 11:58:15 BRST 2010 x86_64 x86_64 x86_64 GNU/Linux
      [root@doppio linux-2.6-tip]# perf archive
      [root@doppio linux-2.6-tip]# ls -la perf.data*
      -rw------- 1 root root  737696 2010-01-14 23:36 perf.data
      -rw-r--r-- 1 root root 8840025 2010-01-15 12:27 perf.data.tar.bz2
      [root@doppio linux-2.6-tip]# scp perf.data.* parisc64:.
      Password:
      perf.data.tar.bz2                                      100% 8633KB   1.4MB/s   00:06
      [root@doppio linux-2.6-tip]# ssh parisc64
      Password:
      Linux parisc 2.6.19-g2bbf29ac-dirty #1 Sun Dec 3 17:24:04 BRST 2006 parisc64
      
      The programs included with the Debian GNU/Linux system are free software;
      the exact distribution terms for each program are described in the
      individual files in /usr/share/doc/*/copyright.
      
      Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
      permitted by applicable law.
      Last login: Thu Jan 14 11:23:24 2010 from d
      parisc:~# uname -a
      Linux parisc 2.6.19-g2bbf29ac-dirty #1 Sun Dec 3 17:24:04 BRST 2006 parisc64 GNU/Linux
      parisc:~# mkdir .debug
      parisc:~# tar xvf perf.data.tar.bz2 -C ~/.debug
      tar: Record size = 8 blocks
      .build-id/74/f9930ee94475b6b3238caf3725a50d59cb994b
      [kernel.kallsyms]/74f9930ee94475b6b3238caf3725a50d59cb994b
      .build-id/9f/fdcac0a7935922d1f04b6cc9029dfef0f066ef
      lib/modules/2.6.33-rc4-tip+/kernel/arch/x86/crypto/aes-x86_64.ko/9ffdcac0a7935922d1f04b6cc9029dfef0f066ef
      .build-id/3a/af89c32ebfc438ff546c93597d41788e3e65f3
      lib/modules/2.6.33-rc4-tip+/kernel/drivers/net/wireless/iwlwifi/iwl3945.ko/3aaf89c32ebfc438ff546c93597d41788e3e65f3
      .build-id/19/f46033f73e1ec612937189bb118c5daba5a0c8
      lib/modules/2.6.33-rc4-tip+/kernel/net/mac80211/mac80211.ko/19f46033f73e1ec612937189bb118c5daba5a0c8
      .build-id/17/72f014a7a7272859655acb0c64a20ab20b75ee
      lib/modules/2.6.33-rc4-tip+/kernel/drivers/net/e1000e/e1000e.ko/1772f014a7a7272859655acb0c64a20ab20b75ee
      .build-id/eb/4ec8fa8b2a5eb18cad173c92f27ed8887ed1c1
      lib64/libc-2.10.2.so/eb4ec8fa8b2a5eb18cad173c92f27ed8887ed1c1
      .build-id/5c/68f7afeb33309c78037e374b0deee84dd441f6
      lib64/libpthread-2.10.2.so/5c68f7afeb33309c78037e374b0deee84dd441f6
      .build-id/e9/c9ad5c138ef882e4507d2605645b597da43873
      bin/dbus-daemon/e9c9ad5c138ef882e4507d2605645b597da43873
      .build-id/bc/da7d09eb6c9ee380dae0ed3d591d4311decc31
      lib64/libdbus-1.so.3.4.0/bcda7d09eb6c9ee380dae0ed3d591d4311decc31
      .build-id/7c/c449a77f48b85d6088114000e970ced613bed8
      usr/lib64/libcrypto.so.0.9.8k/7cc449a77f48b85d6088114000e970ced613bed8
      .build-id/fd/d1ccd1ff7917ab020653147ab3bacf0a85b5b9
      lib64/libglib-2.0.so.0.2000.5/fdd1ccd1ff7917ab020653147ab3bacf0a85b5b9
      .build-id/e4/417ebb8762e5f2eee93c8011a71115ff5edad8
      lib64/libgobject-2.0.so.0.2000.5/e4417ebb8762e5f2eee93c8011a71115ff5edad8
      .build-id/93/1e49461f6df99104f0febcc52f6fed5e2efce6
      usr/sbin/sshd/931e49461f6df99104f0febcc52f6fed5e2efce6
      .build-id/da/b5f724c088f89fbd8304da553ed6cb30bbec96
      usr/lib64/libgdk-x11-2.0.so.0.1600.6/dab5f724c088f89fbd8304da553ed6cb30bbec96
      .build-id/f2/037a091ef36b591187a858d75e203690ea9409
      usr/sbin/openvpn/f2037a091ef36b591187a858d75e203690ea9409
      .build-id/a8/e4f743b40fb1fd8b85e2f9b88d93b661472b8f
      bin/find/a8e4f743b40fb1fd8b85e2f9b88d93b661472b8f
      .build-id/81/120aada06e68b1e85882925a0fc6d7345ef59a
      home/acme/bin/perf/81120aada06e68b1e85882925a0fc6d7345ef59a
      parisc:~# perf report 2> /dev/null | head -25
           9.07%             find  find                               [.] 0x0000000000fb0e
           3.29%             perf  libc-2.10.2.so                     [.] __GI_strcmp
           3.19%             find  [kernel.kallsyms]                  [k] _raw_spin_unlock_irqrestore
           2.70%             find  libc-2.10.2.so                     [.] __GI_memmove
           2.62%             perf  [kernel.kallsyms]                  [k] vsnprintf
           2.03%             find  libc-2.10.2.so                     [.] _int_malloc
           2.02%             perf  [kernel.kallsyms]                  [k] format_decode
           1.70%             find  [kernel.kallsyms]                  [k] n_tty_write
           1.70%             find  [kernel.kallsyms]                  [k] half_md4_transform
           1.67%             find  libc-2.10.2.so                     [.] _IO_vfprintf_internal
           1.66%             perf  [kernel.kallsyms]                  [k] audit_free_aux
           1.62%          swapper  [kernel.kallsyms]                  [k] mwait_idle_with_hints
           1.58%             find  [kernel.kallsyms]                  [k] __kmalloc
           1.35%             find  [kernel.kallsyms]                  [k] sched_clock_local
           1.35%             find  [kernel.kallsyms]                  [k] ext4_check_dir_entry
           1.35%             find  [kernel.kallsyms]                  [k] ext4_htree_store_dirent
           1.35%             find  [kernel.kallsyms]                  [k] sys_write
           1.35%             find  [e1000e]                           [k] e1000_clean
           1.35%             find  [kernel.kallsyms]                  [k] _atomic_dec_and_lock
           1.34%             find  [kernel.kallsyms]                  [k] __d_lookup
      parisc:~#
      
      Probably the next step is to have 'perf report' notice that there is a
      perf.data.tar.bz2 file in the same directory and look if it was already
      added to ~/.debug/.
      Signed-off-by: default avatarArnaldo 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: <1263568672-30323-2-git-send-email-acme@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      2c585174