1. 15 4月, 2011 1 次提交
  2. 08 4月, 2011 1 次提交
    • E
      perf: Fix a build error with some GCC versions · 621d2656
      Eric Dumazet 提交于
      Fix this:
      
       util/cgroup.c: In function ‘open_cgroup’:
       util/cgroup.c:16:16: error: ‘saved_ptr’ may be used uninitialized in this function
       util/cgroup.c:16:16: note: ‘saved_ptr’ was declared here
      
      Apparently newer GCC (4.6) can figure out that this variable is properly
      initialized - but some versions of GCC (such as 4.5.2) need help.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      621d2656
  3. 06 4月, 2011 5 次提交
    • M
      perf probe: Fix listing incorrect line number with inline function · 1d46ea2a
      Masami Hiramatsu 提交于
      Fix a bug showing incorrect line number when a probe is put on the head of an
      inline function. This patch updates find_perf_probe_point() and introduces new
      rules to get correct line number.
      
       - If debuginfo doesn't have a correct file name, we shouldn't return line
         number too, because, without file name, line number is meaningless.
      
       - If the address is in a function, it stores the function name and the offset
         from the function entry.
      
         - If the address is on a line, it tries to get the relative line number from
           the function entry line, except for the address is same as the entry
           address of the function (in this case, the relative line number should
           be 0).
      
           - If the address is in an inline function entry (call-site), it uses the
             inline function call line number as the line on which the address is.
      
         - If the address is in an inline function body, it stores the inline
           function name and offset from the inline function call site instead of the
           (non-inlined) function.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092605.2132.11629.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d46ea2a
    • M
      perf probe: Fix to find recursively inlined function · 1d878083
      Masami Hiramatsu 提交于
      Fix die_find_inlinefunc() to return correct innermost inlined function
      at given address. Without this fix, it returns the outermost inlined
      function.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092559.2132.78634.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d878083
    • M
      perf probe: Fix multiple --vars options behavior · cc446446
      Masami Hiramatsu 提交于
      Fix a bug that perf-probe fails to initialize libdwfl and shows incorrect error
      when user gives multiple --vars options.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092553.2132.42691.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cc446446
    • M
      perf probe: Fix to remove redundant close · f0c4801a
      Masami Hiramatsu 提交于
      Since dwfl_end() closes given fd with dwfl, caller doesn't need to close its fd
      when finishing process.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092547.2132.93728.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f0c4801a
    • M
      perf probe: Fix to ensure function declared file · 7d21635a
      Masami Hiramatsu 提交于
      Fix to ensure function declared file matches given file name. This fixes
      a potential bug.
      
      As I've commented on Lin Ming's fastpath enhancement, decl_file should
      be checked on each probe point if user gives a probe point as func@file.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110330092541.2132.3584.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7d21635a
  4. 31 3月, 2011 2 次提交
  5. 30 3月, 2011 4 次提交
    • R
      perf tools: Fix NO_NEWT=1 python build error · 1b7155f7
      Robert Richter 提交于
      Fix the following build error:
      
           GEN python/perf.so
       In file included from util/evsel.h:10,
                        from util/python.c:6:
       util/hist.h:106:18: error: newt.h: No such file or directory
       error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
       make: *** [python/perf.so] Error 1
      
      by passing BASIC_CFLAGS to setup.py. BASIC_CFLAGS variable contains
      the -DNO_NEWT_SUPPORT switch which prevents building python c
      extension with newt.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <20110329180236.GA19366@erda.amd.com>
      Signed-off-by: NRobert Richter <robert.richter@amd.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1b7155f7
    • D
      perf symbols: Properly align symbol_conf.priv_size · 4d439517
      David S. Miller 提交于
      If symbol_conf.priv_size is not a multiple of "sizeof(u64)" we'll bus
      error on sparc64 in symbol__new because the "struct symbol *" pointer
      is computed by adding symbol_conf.priv_size to the memory allocated.
      
      We cannot isolate the fix to symbol__new and symbol__delete since the
      private area is computed by subtracting the priv_size value from a
      "struct symbol" pointer, so then the private area can still be
      potentially unaligned.
      
      So, simply align the symbol_conf.priv_size value in symbol__init()
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20110328.175849.112593455.davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4d439517
    • D
      perf tools: Emit clearer message for sys_perf_event_open ENOENT return · ca6a4258
      David Ahern 提交于
      Resend of patch sent back in January 2011 in light of recent confusion around
      unsupported events for a given platform.
      
      Improve sys_perf_event_open ENOENT return handling in top and record, just
      like 5a3446bc does for stat.
      
      Retry of Arnaldo's patch using ui_warning instead of die which allows the
      fallback from hardware cycles to software clock.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      LKML-Reference: <1301080271-20945-1-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      [ committer note: Some adjustments to make it apply to newer codebase ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ca6a4258
    • A
      perf tools: Fixup exit path when not able to open events · c286c419
      Arnaldo Carvalho de Melo 提交于
      We have to deal with the TUI mode in perf top, so that we don't end up
      with a garbled screen when, say, a non root user on a machine with a
      paranoid setting (the default) tries to use 'perf top'.
      
      Introduce a ui__warning_paranoid() routine shared by top and record that
      tells the user the valid values for /proc/sys/kernel/perf_event_paranoid.
      
      Cc: David Ahern <daahern@cisco.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c286c419
  6. 29 3月, 2011 1 次提交
    • A
      perf symbols: Fix vsyscall symbol lookup · 6c6804fb
      Andrew Lutomirski 提交于
      Perf can't currently trace into the vsyscall page.  It looks like it was
      meant to work.
      
      Tested on 2.6.38 and today's -git.
      
      The bug is easy to reproduce.  Compile this:
      
      int main()
      {
      	int i;
      	struct timespec t;
      	for(i = 0; i < 10000000; i++)
      		clock_gettime(CLOCK_MONOTONIC, &t);
      	return 0;
      }
      
      and run it through perf record; perf report.  The top entry shows
      "[unknown]" and you can't zoom in.
      
      It looks like there are two issues.  The first is a that a test for user
      mode executing in kernel space is backwards.  (That's the first hunk
      below).  The second (I think) is that something's wrong with the code
      that generates lots of little struct dso objects for different sections
      -- when it runs on vmlinux it results in bogus long_name values which
      cause objdump to fail.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LPU-Reference: <AANLkTikxSw5+wJZUWNz++nL7mgivCh_Zf=2Kq6=f9Ce_@mail.gmail.com>
      Signed-off-by: NAndy Lutomirski <luto@mit.edu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6c6804fb
  7. 24 3月, 2011 3 次提交
    • A
      perf symbols: Look at .dynsym again if .symtab not found · 60e4b10c
      Arnaldo Carvalho de Melo 提交于
      The original intent of the code was to repeat the search with
      want_symtab = 0. But as the code stands now, we never hit the "default"
      case of the switch statement. Which means we never repeat the search.
      Tested-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Reported-by: NArun Sharma <asharma@fb.com>
      Reported-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Dave Martin <dave.martin@linaro.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      60e4b10c
    • A
      perf build-id: Add quirk to deal with perf.data file format breakage · b2511481
      Arnaldo Carvalho de Melo 提交于
      The a1645ce1 changeset:
      
      "perf: 'perf kvm' tool for monitoring guest performance from host"
      
      Added a field to struct build_id_event that broke the file format.
      
      Since the kernel build-id is the first entry, process the table using
      the old format if the well known '[kernel.kallsyms]' string for the
      kernel build-id has the first 4 characters chopped off (where the pid_t
      sits).
      Reported-by: NHan Pingtian <phan@redhat.com>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Zhang Yanmin <yanmin_zhang@linux.intel.com>
      Cc: stable@kernel.org
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b2511481
    • A
      perf session: Pass evsel in event_ops->sample() · 9e69c210
      Arnaldo Carvalho de Melo 提交于
      Resolving the sample->id to an evsel since the most advanced tools,
      report and annotate, and the others will too when they evolve to
      properly support multi-event perf.data files.
      
      Good also because it does an extra validation, checking that the ID is
      valid when present. When that is not the case, the overhead is just a
      branch + function call (perf_evlist__id2evsel).
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9e69c210
  8. 23 3月, 2011 1 次提交
    • A
      perf top: Fix uninitialized 'counter' variable · ce2d17ca
      Akihiro Nagai 提交于
      builtin-top.c has an uninitialized variable.
      gcc(version 4.5.1) warns about it and it results in build failure:
      
       builtin-top.c: In function 'display_thread':
       builtin-top.c:518:9: error: 'counter' may be used uninitialized
      
      This situation can indeed trigger, if the getline() call in
      prompt_integer() fails.
      Signed-off-by: NAkihiro Nagai <akihiro.nagai.hw@hitachi.com>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110323072939.11638.50173.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ce2d17ca
  9. 16 3月, 2011 3 次提交
    • M
      perf lock: Fix sorting by wait_min · 9df03abe
      Marcin Slusarz 提交于
      If lock was uncontended, wait_time_min == ULLONG_MAX, so we need to
      handle this case differently to show high wait times first
      Acked-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20110222174715.GC9687@joi.lan>
      Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9df03abe
    • J
      perf tools: Version incorrect with some versions of grep · 58d406ed
      Josh Hunt 提交于
      Some versions of grep don't treat '\s' properly. When building perf on such
      systems and using a kernel tarball the perf version is unable to be determined
      from the main kernel Makefile and the user is left with a version of '..'.
      Replacing the use of '\s' with '[[:space:]]', which should work in all grep
      versions, gives a usable version number.
      Reported-by: NTapan Dhimant <tdhimant@akamai.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tapan Dhimant <tdhimant@akamai.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: stable@kernel.org
      LKML-Reference: <1300241800-30281-1-git-send-email-johunt@akamai.com>
      Signed-off-by: NJosh Hunt <johunt@akamai.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      58d406ed
    • I
      perf probe: Clean up probe_point_lazy_walker() return value · 5e814dd5
      Ingo Molnar 提交于
      Newer compilers (gcc 4.6) complains about:
      
              return ret < 0 ?: 0;
      
      For the following reason:
      
        util/probe-finder.c: In function ‘probe_point_lazy_walker’:
        util/probe-finder.c:1331:18: error: the omitted middle operand in ?: will always be ‘true’, suggest explicit middle operand [-Werror=parentheses]
      
      And indeed the return value is a somewhat obscure (but correct) value
      of 'true', so return 'ret' instead - this is cleaner and unconfuses
      GCC as well.
      
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5e814dd5
  10. 15 3月, 2011 8 次提交
    • A
      perf evlist: New command to list the names of events present in a perf.data file · 43adec95
      Arnaldo Carvalho de Melo 提交于
      [root@emilia ~]# perf record -a -e sched:* -e timer:timer* sleep 5
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.172 MB perf.data (~7530 samples) ]
      [root@emilia ~]# perf evlist
      sched:sched_kthread_stop
      sched:sched_kthread_stop_ret
      sched:sched_wakeup
      sched:sched_wakeup_new
      sched:sched_switch
      sched:sched_migrate_task
      sched:sched_process_free
      sched:sched_process_exit
      sched:sched_wait_task
      sched:sched_process_wait
      sched:sched_process_fork
      sched:sched_stat_wait
      sched:sched_stat_sleep
      sched:sched_stat_iowait
      sched:sched_stat_runtime
      sched:sched_pi_setprio
      timer:timer_init
      timer:timer_start
      timer:timer_expire_entry
      timer:timer_expire_exit
      timer:timer_cancel
      [root@emilia ~]#
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      43adec95
    • D
      perf script: Add support for H/W and S/W events · 1424dc96
      David Ahern 提交于
      Custom fields set for each type by prepending field argument with type.
      For file with multiple event types (e.g., trace and S/W) display of an
      event type suppressed by setting output fields to "".
      
      e.g.,
      perf record -ga -e sched:sched_switch -e cpu-clock -c 10000000 -R -- sleep 1
      perf script
      
      openssl 11496 [000]  9711.807107: cpu-clock-msecs:
              ffffffff810c22dc arch_local_irq_restore ([kernel.kallsyms])
              ffffffff810c518c __alloc_pages_nodemask ([kernel.kallsyms])
              ffffffff810297b2 pte_alloc_one ([kernel.kallsyms])
              ffffffff810d8b98 __pte_alloc ([kernel.kallsyms])
              ffffffff810daf07 handle_mm_fault ([kernel.kallsyms])
              ffffffff8138763a do_page_fault ([kernel.kallsyms])
              ffffffff81384a65 page_fault ([kernel.kallsyms])
                  7f6130507d70 asn1_check_tlen (/lib64/libcrypto.so.1.0.0c)
                             0  ()
      
               openssl 11496 [000]  9711.808042: sched_switch: prev_comm=openssl ...
           kworker/0:0     4 [000]  9711.808067: sched_switch: prev_comm=kworker/...
               swapper     0 [001]  9711.808090: sched_switch: prev_comm=kworker/...
                  sshd 11451 [001]  9711.808185: sched_switch: prev_comm=sshd pre...
      swapper     0 [001]  9711.816155: cpu-clock-msecs:
              ffffffff81023609 native_safe_halt ([kernel.kallsyms])
              ffffffff8100132a cpu_idle ([kernel.kallsyms])
              ffffffff8137cf9b start_secondary ([kernel.kallsyms])
      
      openssl 11496 [000]  9711.817104: cpu-clock-msecs:
                  7f61304ad723 AES_cbc_encrypt (/lib64/libcrypto.so.1.0.0c)
                  7fff3402f950  ()
              12f0debc9a785634  ()
      
      swapper     0 [001]  9711.826155: cpu-clock-msecs:
              ffffffff81023609 native_safe_halt ([kernel.kallsyms])
              ffffffff8100132a cpu_idle ([kernel.kallsyms])
              ffffffff8137cf9b start_secondary ([kernel.kallsyms])
      
      To suppress trace events within the file and use default output for S/W events:
      perf script -f trace:
      
      or to suppress S/W events and do default display for trace events:
      perf script -f sw:
      
      Custom field selections:
      perf script -f sw:comm,tid,time -f trace:time,trace
      
               openssl 11496  9711.797162:
               swapper     0  9711.807071:
               openssl 11496  9711.807107:
       9711.808042: prev_comm=openssl prev_pid=11496 prev_prio=120 prev_state=R ...
       9711.808067: prev_comm=kworker/0:0 prev_pid=4 prev_prio=120 prev_state=S ...
       9711.808090: prev_comm=kworker/0:0 prev_pid=0 prev_prio=120 prev_state=R ...
       9711.808185: prev_comm=sshd prev_pid=11451 prev_prio=120 prev_state=S ==>...
               swapper     0  9711.816155:
               openssl 11496  9711.817104:
               swapper     0  9711.826155:
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1299734608-5223-7-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1424dc96
    • D
      perf script: Add support for dumping symbols · c0230b2b
      David Ahern 提交于
      Add option to dump symbols found in events.
      
      e.g., perf script -f comm,pid,tid,time,trace,sym
      
      swapper     0/0       537.037184: prev_comm=swapper prev_pid=0 prev_prio=120...
              ffffffff81030350 perf_trace_sched_switch ([kernel.kallsyms])
              ffffffff81382ac5 schedule ([kernel.kallsyms])
              ffffffff8100134a cpu_idle ([kernel.kallsyms])
              ffffffff81370b39 rest_init ([kernel.kallsyms])
              ffffffff81696c23 start_kernel ([kernel.kallsyms].init.text)
              ffffffff816962af x86_64_start_reservations ([kernel.kallsyms].init.text)
              ffffffff816963b9 x86_64_start_kernel ([kernel.kallsyms].init.text)
      
      sshd  1675/1675    537.037309: prev_comm=sshd prev_pid=1675 prev_prio=120...
              ffffffff81030350 perf_trace_sched_switch ([kernel.kallsyms])
              ffffffff81382ac5 schedule ([kernel.kallsyms])
              ffffffff813837aa schedule_hrtimeout_range_clock ([kernel.kallsyms])
              ffffffff81383886 schedule_hrtimeout_range ([kernel.kallsyms])
              ffffffff8110c4f9 poll_schedule_timeout ([kernel.kallsyms])
              ffffffff8110cd20 do_select ([kernel.kallsyms])
              ffffffff8110ced8 core_sys_select ([kernel.kallsyms])
              ffffffff8110d00d sys_select ([kernel.kallsyms])
              ffffffff81002bc2 system_call ([kernel.kallsyms])
                  7f1647e56e93 __GI_select (/lib64/libc-2.12.90.so)
      
      netstat  1692/1692    537.038664: prev_comm=netstat prev_pid=1692 prev_prio=...
              ffffffff81030350 perf_trace_sched_switch ([kernel.kallsyms])
              ffffffff81382ac5 schedule ([kernel.kallsyms])
              ffffffff81002c3a sysret_careful ([kernel.kallsyms])
                  7f7a6cd1b210 __GI___libc_read (/lib64/libc-2.12.90.so)
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1299734608-5223-6-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c0230b2b
    • D
      perf script: Support custom field selection for output · 745f43e3
      David Ahern 提交于
      Allow a user to select which fields to print to stdout for event data.
      Options include comm (command name), tid (thread id), pid (process id),
      time (perf timestamp), cpu, event (for event name), and trace (for
      trace data).
      
      Default is set to maintain compatibility with current output; this
      feature does alter output format slightly -- no '-' between command
      and pid/tid.
      
      Thanks to Frederic Weisbecker for detailed suggestions on this approach.
      
      Examples (output compressed)
      
      1. trace, default format
      
      perf record -ga -e sched:sched_switch
      perf script
      
      swapper    0 [000] 537.037184: sched_switch: prev_comm=swapper prev_pid=0...
         sshd 1675 [000] 537.037309: sched_switch: prev_comm=sshd prev_pid=1675...
      netstat 1692 [001] 537.038664: sched_switch: prev_comm=netstat prev_pid=1692...
      
      2. trace, custom format
      
      perf record -ga -e sched:sched_switch
      perf script -f comm,pid,time,trace     <--- omitting cpu and event name
      
      swapper    0 537.037184: prev_comm=swapper prev_pid=0 prev_prio=120 ...
         sshd 1675 537.037309: prev_comm=sshd prev_pid=1675 prev_prio=120 ...
      netstat 1692 537.038664: prev_comm=netstat prev_pid=1692 prev_prio=120 ...
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1299734608-5223-5-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      745f43e3
    • D
      perf script: Move printing of 'common' data from print_event and rename · c70c94b4
      David Ahern 提交于
      This change does impact output: latency data is trace specific and is
      now printed after the common data - comm, tid, cpu, time and event name.
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1299734608-5223-4-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c70c94b4
    • D
      perf tracing: Remove print_graph_cpu and print_graph_proc from trace-event-parse · 2ee7a49f
      David Ahern 提交于
      Next patch moves printing of 'common' data into perf-script which
      removes the need for these functions.
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1299734608-5223-3-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2ee7a49f
    • D
      perf script: Change process_event prototype · be6d842a
      David Ahern 提交于
      Prepare for handling of samples for any event type.
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1299734608-5223-2-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      be6d842a
    • F
      perf stat: Provide support for filters · cfd748ae
      Frederic Weisbecker 提交于
      Now the --filter option is usable with perf stat too.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <1300117230-8404-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cfd748ae
  11. 12 3月, 2011 4 次提交
    • A
      perf symbol: Move sym_entry->skip to symbol->ignore · 171b3be9
      Arnaldo Carvalho de Melo 提交于
      While going thru each of the sym_entry fields looking to reduce it to
      the set of entries needed when in an active symbols list, 'skip' should
      really be in symbol, as we set it when loading the symtab.
      
      And the space used by the basic symbol allocation remains the same as
      we had 5 bytes of padding.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      171b3be9
    • A
      perf symbols: Rename dso->origin to dso->symtab_type · 878b439d
      Arnaldo Carvalho de Melo 提交于
      And the DSO__ORIG_ enum to SYMTAB__, to clarify that this is about from
      where the symtab was obtained.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      878b439d
    • A
      perf top: Remove redundant syme->origin field · 8b8ba4a9
      Arnaldo Carvalho de Melo 提交于
      We can get it from syme->map->dso->kernel (that should be renamed to
      origin, but leave this for another patch).
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8b8ba4a9
    • A
      perf top: Remove redundant perf_top->sym_counter · ec52d976
      Arnaldo Carvalho de Melo 提交于
      We can get that counter index from perf_top->sym_evsel->idx instead.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ec52d976
  12. 10 3月, 2011 5 次提交
    • A
      perf header: Stop using 'self' · 1c0b04d1
      Arnaldo Carvalho de Melo 提交于
      Stop using this python/OOP convention, doesn't really helps. Will do
      more from time to time till we get it cleaned up in all of tools/perf.
      Suggested-by: NThomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <new-submission>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1c0b04d1
    • A
      perf session: Use evlist/evsel for managing perf.data attributes · a91e5431
      Arnaldo Carvalho de Melo 提交于
      So that we can reuse things like the id to attr lookup routine
      (perf_evlist__id2evsel) that uses a hash table instead of the linear
      lookup done in the older perf_header_attr routines, etc.
      
      Also to make evsels/evlist more pervasive an API, simplyfing using the
      emerging perf lib.
      
      cc: Arun Sharma <arun@sharma-home.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a91e5431
    • J
      perf top: Don't let events to eat up whole header line · 65472503
      Jiri Olsa 提交于
      Passing multiple events might force out information about pid/tid/cpu.
      Attached patch leaves 30 characters for this info at the expense of the
      events' names.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Han Pingtian <phan@redhat.com>
      LKML-Reference: <1299528821-17521-3-git-send-email-jolsa@redhat.com>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      65472503
    • J
      perf top: Fix events overflow in top command · b9a46bba
      Jiri Olsa 提交于
      The snprintf function returns number of printed characters even if it
      cross the size parameter. So passing enough events via '-e' parameter
      will cause segmentation fault.
      
      It's reproduced by following command:
      
      perf top -e `perf list | grep Tracepoint | awk -F'[' '\
      {gsub(/[[:space:]]+/,"",$1);array[FNR]=$1}END{outputs=array[1];\
      for (i=2;i<=FNR;i++){ outputs=outputs "," array[i];};print outputs}'`
      
      Attached patch is adding SNPRINTF macro that provides the overflow check
      and returns actuall number of printed characters.
      Reported-by: NHan Pingtian <phan@redhat.com>
      Cc: Han Pingtian <phan@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <1299528821-17521-2-git-send-email-jolsa@redhat.com>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b9a46bba
    • L
      perf symbols: Avoid resolving [kernel.kallsyms] to real path for buildid cache · 7ee235ef
      Lin Ming 提交于
      kallsyms has a virtual file name [kernel.kallsyms].  Currently, it can't
      be added to buildid cache successfully because the code
      (build_id_cache__add_s) tries to resolve [kernel.kallsyms] to a real
      absolute pathname and that fails.
      
      Fixes it by not resolving it and just use the name [kernel.kallsyms].
      So dir ~/.debug/[kernel.kallsyms] is created.
      
      Original bug report at:
      https://lkml.org/lkml/2011/3/1/524Tested-by: NHan Pingtian <phan@redhat.com>
      Cc: Han Pingtian <phan@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <1299165837-27817-1-git-send-email-ming.m.lin@intel.com>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7ee235ef
  13. 07 3月, 2011 2 次提交
    • A
      perf report tui: Improve multi event session support · 7f0030b2
      Arnaldo Carvalho de Melo 提交于
      When multiple events were used in 'perf record', allow the user to
      choose which one is wanted before showing the per event histograms.
      
      Annotations will be performed on the chosen event.
      
      Allow going back and forth from event to event quickly using just the
      arrow keys and enter.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: William Cohen <wcohen@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7f0030b2
    • A
      perf tools: Improve support for sessions with multiple events · e248de33
      Arnaldo Carvalho de Melo 提交于
      By creating an perf_evlist out of the attributes in the perf.data file
      header, so that we can use evlists and evsels when reading recorded
      sessions in addition to when we record sessions.
      
      More work is needed to allow tools to allow the user to select which
      events are wanted when browsing sessions, be it just one or a subset of
      them, aggregated or showed at the same time but with different
      indications on the UI to allow seeing workloads thru different views at
      the same time.
      
      But the overall goal/trend is to more uniformly use evsels and evlists.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e248de33