1. 27 4月, 2011 2 次提交
  2. 20 4月, 2011 1 次提交
  3. 19 4月, 2011 6 次提交
  4. 15 4月, 2011 2 次提交
  5. 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
  6. 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
  7. 31 3月, 2011 4 次提交
    • L
      Fix common misspellings · 25985edc
      Lucas De Marchi 提交于
      Fixes generated by 'codespell' and manually reviewed.
      Signed-off-by: NLucas De Marchi <lucas.demarchi@profusion.mobi>
      25985edc
    • F
      perf: mmap 512 kiB by default · 800cd25c
      Frederic Weisbecker 提交于
      The default setting of perf record is to mmap 128 pages if the user
      did not override with -m.
      
      However the page size may vary accross different architecture
      settings, giving different default size between each.
      
      Moreover the kernel side still has a default max number of mlocked
      pages of 512 kiB + 1 page for unprivileged users. 128 + 1 pages
      with page size > 4096 overlaps this threshold.
      
      Thus, better adapt to this limitation and set the default number of
      pages to fit those 512 kiB + 1 page.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <1301535324-9735-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      800cd25c
    • A
      perf script: Add more documentation about the -f/--fields parameters · 176fcc5c
      Arnaldo Carvalho de Melo 提交于
      Using the commit log for 2c9e45f7.
      
      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>
      176fcc5c
    • D
      perf script: If type not given fields apply to all event types · 2c9e45f7
      David Ahern 提交于
      Allow:
        perf script -f <fields>
      
      to be equivalent to:
        perf script -f trace:<fields> -f sw:<fields> -f hw:<fields>
      
      i.e., the specified fields apply to all event types if the type string
      is not given.
      
      The field (-f) arguments are processed in the order received. A later
      usage can reset a prior request. e.g.,
      
        -f trace: -f comm,tid,time,sym
      
      The first -f suppresses trace events (field list is ""), but then the second
      invocation sets the fields to comm,tid,time,sym. In this case a warning is
      given to the user:
      
        "Overriding previous field request for all events."
      
      Alternativey, consider the order:
      
        -f comm,tid,time,sym -f trace:
      
      The first -f sets the fields for all events and the second -f suppresses trace
      events. The user is given a warning message about the override, and the result
      of the above is that only S/W and H/W events are displayed with the given
      fields.
      
      For the 'wildcard' option if a user selected field is invalid for an event
      type, a message is displayed to the user that the option is ignored for that
      type. For example:
      
        perf script -f comm,tid,trace 2>&1 | less
        'trace' not valid for hardware events. Ignoring.
        'trace' not valid for software events. Ignoring.
      
      Alternatively, if the type is given an invalid field is specified it is an
      error. For example:
      
          perf script -v -f sw:comm,tid,trace 2>&1 | less
          'trace' not valid for software events.
      
      At this point usage is displayed, and perf-script exits.
      
      Finally, a user may not set fields to none for all event types.
      i.e., -f "" is not allowed.
      
      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: linux-kernel@vger.kernel.org
      LPU-Reference: <1300377801-27246-1-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2c9e45f7
  8. 30 3月, 2011 5 次提交
    • 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
    • L
      perf probe: Add fastpath to do lookup by function name · cd25f8bc
      Lin Ming 提交于
      v3 -> v2:
      - Make pubname_search_cb more generic
      - Add fastpath to find_probes also
      
      v2 -> v1:
      - Don't compare file names with cu_find_realpath(...), instead, compare
        them with the name returned by dwarf_decl_file(sp_die)
      
      The vmlinux file may have thousands of CUs.
      We can lookup function name from .debug_pubnames section
      to avoid the slow loop on CUs.
      
      1. Improvement data for find_line_range
      
      ./perf stat -e cycles -r 10 -- ./perf probe -k /home/mlin/vmlinux \
              -s /home/mlin/linux-2.6 \
              --line csum_partial_copy_to_user > tmp.log
      
      before patch applied
      =====================
             847,988,276 cycles
      
              0.355075856  seconds time elapsed
      
      after patch applied
      =====================
             206,102,622 cycles
      
              0.086883555  seconds time elapsed
      
      2. Improvement data for find_probes
      
      ./perf stat -e cycles -r 10 -- ./perf probe -k /home/mlin/vmlinux \
              -s /home/mlin/linux-2.6 \
              --vars csum_partial_copy_to_user > tmp.log
      
      before patch applied
      =====================
             848,490,844 cycles
      
              0.355307901  seconds time elapsed
      
      after patch applied
      =====================
             205,684,469 cycles
      
              0.086694010  seconds time elapsed
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: linux-kernel <linux-kernel@vger.kernel.org>
      LKML-Reference: <1301041668.14111.52.camel@minggr.sh.intel.com>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cd25f8bc
    • 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 15 3月, 2011 6 次提交
    • 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