1. 17 May, 2010 9 commits
    • Arnaldo Carvalho de Melo's avatar
      perf tui: Add explicit -lslang option · 63aa9e7e
      Arnaldo Carvalho de Melo authored
      At least on rawhide using -lnewt is not enough if we use SLang routines
      directly, so add an explicit -lslang since we use SLang routines.
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Tested-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      63aa9e7e
    • Arnaldo Carvalho de Melo's avatar
      perf options: Type check all the remaining OPT_ variants · edb7c60e
      Arnaldo Carvalho de Melo authored
      OPT_SET_INT was renamed to OPT_SET_UINT since the only use in these
      tools is to set something that has an enum type, that is builtin
      compatible with unsigned int.
      
      Several string constifications were done to make OPT_STRING require a
      const char * type.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      edb7c60e
    • Arnaldo Carvalho de Melo's avatar
      perf options: Type check OPT_BOOLEAN and fix the offenders · 8035458f
      Arnaldo Carvalho de Melo authored
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8035458f
    • Arnaldo Carvalho de Melo's avatar
      perf options: Check v type in OPT_U?INTEGER · 1967936d
      Arnaldo Carvalho de Melo authored
      To avoid problems like the one fixed by Stephane Eranian in 3de29cab, now
      we'll got this instead:
      
      	bench/sched-messaging.c:259: error: negative width in bit-field ‘<anonymous>’
      	bench/sched-messaging.c:261: error: negative width in bit-field ‘<anonymous>’
      
      Which is rather cryptic, but is how BUILD_BUG_ON_ZERO works, so kernel
      hackers should be already used to this.
      
      With it in place found some problems, fixed by changing the affected
      variables to sensible types or changed some OPT_INTEGER to OPT_UINTEGER.
      
      Next csets will go thru converting each of the remaining OPT_ so that
      review can be made easier by grouping changes per type per patch.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1967936d
    • Arnaldo Carvalho de Melo's avatar
      perf options: Introduce OPT_UINTEGER · c100edbe
      Arnaldo Carvalho de Melo authored
      For unsigned int options to be parsed, next patches will make use of it.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c100edbe
    • Arnaldo Carvalho de Melo's avatar
      perf tui: Add workaround for slang < 2.1.4 · dc4ff193
      Arnaldo Carvalho de Melo authored
      Older versions of the slang library didn't used the 'const' specifier,
      causing problems with modern compilers of this kind:
      
      util/newt.c:252: error: passing argument 1 of ‘SLsmg_printf’ discards
      qualifiers from pointer target type
      
      Fix it by using some wrappers that when needed const the affected
      parameters back to plain (char *).
      Reported-by: default avatarLin Ming <ming.m.lin@intel.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <20100517145421.GD29052@ghostprotocols.net>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dc4ff193
    • Stephane Eranian's avatar
      perf record: Fix bug mismatch with -c option definition · 3de29cab
      Stephane Eranian authored
      The -c option defines the user requested sampling period. It was implemented
      using an unsigned int variable but the type of the option was OPT_LONG. Thus,
      the option parser was overwriting memory belonging to other variables, namely
      the mmap_pages leading to a zero page sampling buffer. The bug was exposed only
      when compiling at -O0, probably because the compiler was padding variables at
      higher optimization levels.
      
      This patch fixes this problem by declaring user_interval as u64. This also
      avoids wrap-around issues for large period on 32-bit systems.
      
      Commiter note:
      
      Made it use OPT_U64(user_interval) after implementing OPT_U64 in the
      previous patch.
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <4bf11ae9.e88cd80a.06b0.ffffa8e3@mx.google.com>
      Signed-off-by: default avatarStephane Eranian <eranian@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3de29cab
    • Arnaldo Carvalho de Melo's avatar
      perf options: Introduce OPT_U64 · 6ba85cea
      Arnaldo Carvalho de Melo authored
      We have things like user_interval (-c/--count) in 'perf record' that
      needs this.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6ba85cea
    • Arnaldo Carvalho de Melo's avatar
      perf tui: Add help window to show key associations · a9a4ab74
      Arnaldo Carvalho de Melo authored
      Suggested-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a9a4ab74
  2. 16 May, 2010 3 commits
  3. 15 May, 2010 4 commits
  4. 14 May, 2010 4 commits
    • Arnaldo Carvalho de Melo's avatar
      perf newt: Make <- zoom out filters · 3e1bbdc3
      Arnaldo Carvalho de Melo authored
      After we use the filters to zoom into DSOs or threads, we can use <-
      (left arrow) to zoom out from the last filter applied.
      
      It is still possible to zoom out of order by using the popup menu.
      
      With this we now have the zoom out operation on the browsing fast path,
      by allowing fast navigation using just the four arrors and the enter key
      to expand collapse callchains.
      Suggested-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3e1bbdc3
    • Arnaldo Carvalho de Melo's avatar
      perf report: Report number of events, not samples · c82ee828
      Arnaldo Carvalho de Melo authored
      Number of samples is meaningless after we switched to auto-freq, so
      report the number of events, i.e. not the sum of the different periods,
      but the number PERF_RECORD_SAMPLE emitted by the kernel.
      
      While doing this I noticed that naming "count" to the sum of all the
      event periods can be confusing, so rename it to .period, just like in
      struct sample.data, so that we become more consistent.
      
      This helps with the next step, that was to record in struct hist_entry
      the number of sample events for each instance, we need that because we
      use it to generate the number of events when applying filters to the
      tree of hist entries like it is being done in the TUI report browser.
      Suggested-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c82ee828
    • Arnaldo Carvalho de Melo's avatar
      perf hist: Clarify events_stats fields usage · cee75ac7
      Arnaldo Carvalho de Melo authored
      The events_stats.total field is too generic, rename it to .total_period,
      and also add a comment explaining that it is the sum of all the .period
      fields in samples, that is needed because we use auto-freq to avoid
      sampling artifacts.
      
      Ditto for events_stats.lost, that is the sum of all lost_event.lost
      fields, i.e. the number of events the kernel dropped.
      
      Looking at the users, builtin-sched.c can make use of these fields and
      stop doing it again.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cee75ac7
    • Arnaldo Carvalho de Melo's avatar
      perf hist: Make event__totals per hists · c8446b9b
      Arnaldo Carvalho de Melo authored
      This is one more thing that started global but are more useful per hist
      or per session.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c8446b9b
  5. 13 May, 2010 5 commits
    • Kirill Smelkov's avatar
      perf trace scripts: Fix typos in perf-trace-python.txt · 5d2be7cb
      Kirill Smelkov authored
      option option   -> option
      special special -> special
      Signed-off-by: default avatarKirill Smelkov <kirr@mns.spb.ru>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <1273747165-17242-1-git-send-email-kirr@mns.spb.ru>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5d2be7cb
    • Stephane Eranian's avatar
      perf tools: change event inheritance logic in stat and record · 2e6cdf99
      Stephane Eranian authored
      By default, event inheritance across fork and pthread_create was on but the -i
      option of stat and record, which enabled inheritance, led to believe it was off
      by default.
      
      This patch fixes this logic by inverting the meaning of the -i option.  By
      default inheritance is on whether you attach to a process (-p), a thread (-t)
      or start a process. If you pass -i, then you turn off inheritance. Turning off
      inheritance if you don't need it, helps limit perf resource usage as well.
      
      The patch also fixes perf stat -t xxxx and perf record -t xxxx which did not
      start the counters.
      Acked-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <4bea9d2f.d60ce30a.0b5b.08e1@mx.google.com>
      Signed-off-by: default avatarStephane Eranian <eranian@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2e6cdf99
    • Frederic Weisbecker's avatar
      perf hist: Fix missing getline declaration · 8a0ecfb8
      Frederic Weisbecker authored
      hist.c needs to include util.h so that it gets stdio.h
      inclusion with __GNU_SOURCE defined.
      
      Fixes:
      	util/hist.c: In function ‘hist_entry__parse_objdump_line’:
      	util/hist.c:931: erreur: implicit declaration of function ‘getline’
      	util/hist.c:931: erreur: nested extern declaration of ‘getline’
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1273772836-11533-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8a0ecfb8
    • Frederic Weisbecker's avatar
      perf hist: Fix hists__browse no-newt case · 8769e1c7
      Frederic Weisbecker authored
      Fix mistake in a parameter type of the no-newt hists__browse()
      version.
      
      Fixes:
      	builtin-report.c: In function ‘__cmd_report’:
      	builtin-report.c:314: erreur: incompatible type for argument 1 of ‘hists__browse’
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1273771378-8577-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8769e1c7
    • Cyrill Gorcunov's avatar
      x86, perf: P4 PMU -- use hash for p4_get_escr_idx() · 72001990
      Cyrill Gorcunov authored
      Linear search over all p4 MSRs should be fine if only
      we would not use it in events scheduling routine which
      is pretty time critical. Lets use hashes. It should speed
      scheduling up significantly.
      
      v2: Steven proposed to use more gentle approach than issue
          BUG on error, so we use WARN_ONCE now
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Lin Ming <ming.m.lin@intel.com>
      LKML-Reference: <20100512174242.GA5190@lenovo>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      72001990
  6. 12 May, 2010 2 commits
    • Ingo Molnar's avatar
    • Arnaldo Carvalho de Melo's avatar
      perf report: Librarize the annotation code and use it in the newt browser · ef7b93a1
      Arnaldo Carvalho de Melo authored
      Now we don't anymore use popen to run 'perf annotate' for the selected
      symbol, instead we collect per address samplings when processing samples
      in 'perf report' if we're using the newt browser, then we use this data
      directly to do annotation.
      
      Done this way we can actually traverse the objdump_line objects
      directly, matching the addresses to the collected samples and colouring
      them appropriately using lower level slang routines.
      
      The new ui_browser class will be reused for the main, callchain aware,
      histogram browser, when it will be made generic and don't assume that
      the objects are always instances of the objdump_line class maintained
      using list_heads.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ef7b93a1
  7. 11 May, 2010 8 commits
  8. 10 May, 2010 5 commits