1. 15 4月, 2010 20 次提交
    • F
      perf: Make the trace events sample period default to 1 · f9212819
      Frederic Weisbecker 提交于
      Trace events are mostly used for tracing and then require not to
      be lost when possible. As opposite to hardware events that really
      require to trigger after a given sample period, trace events mostly
      need to trigger everytime.
      
      It is a frustrating experience to trace with perf and realize we
      lost a lot of events because we forgot the "-c 1" option.
      
      Then default sample_period to 1 for trace events but let the user
      override it.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      f9212819
    • F
      perf: Always record tracepoints raw samples from perf record · bdef3b02
      Frederic Weisbecker 提交于
      Trace events are mostly used for tracing rather than simple
      counting. Don't bother anymore with adding -R when using them,
      just record raw samples of trace events every time.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      bdef3b02
    • F
      perf: Make -f the default for perf record · 7865e817
      Frederic Weisbecker 提交于
      Force the overwriting mode by default if append mode is not explicit.
      Adding -f every time one uses perf on a daily basis quickly becomes a
      burden.
      
      Keep the -f among the options though to avoid breaking some random
      users scripts.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      7865e817
    • T
      perf: Fix dynamic field detection · a1e2f60e
      Thomas Gleixner 提交于
      Checking if a tracing field is an array with a dynamic length
      requires to check the field type and seek the "__data_loc"
      string that prepends the actual type, as can be found in a trace
      event format file:
      
      	field:__data_loc char[] name;	offset:16;	size:4;	signed:1;
      
      But we actually use strcmp() to check if the field type fully
      matches "__data_loc", which may fail as we trip over the rest of
      the type.
      
      To fix this, use strncmp to only check if it starts with
      "__data_loc".
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1271282283-23721-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a1e2f60e
    • M
      perf probe: Show function entry line as probe-able · f6c903f5
      Masami Hiramatsu 提交于
      Function entry line should be shown as probe-able line,
      because each function has declared line attribute.
      
      LKML-Reference: <20100414224007.14630.96915.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f6c903f5
    • M
      perf probe: Support DW_OP_plus_uconst in DW_AT_data_member_location · de1439d8
      Masami Hiramatsu 提交于
      DW_OP_plus_uconst can be used for DW_AT_data_member_location.
      This patch adds DW_OP_plus_uconst support when getting
      structure member offset.
      
      Commiter note:
      
      Fixed up the size_t format specifier in one case:
      
      cc1: warnings being treated as errors
      util/probe-finder.c: In function ‘die_get_data_member_location’:
      util/probe-finder.c:270: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
      make: *** [/home/acme/git/build/perf/util/probe-finder.o] Error 1
      
      LKML-Reference: <20100414223958.14630.5230.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      de1439d8
    • M
      perf probe: Fix line range to show end line · dda4ab34
      Masami Hiramatsu 提交于
      Line range should reject the range if the number of lines is 0
      (e.g. "sched.c:1024+0"), and it should show the lines include
      the end of line number (e.g. "sched.c:1024-2048" should show
      2048th line).
      
      LKML-Reference: <20100414223950.14630.42263.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dda4ab34
    • M
      perf probe: Fix a bug that --line range can be overflow · d3b63d7a
      Masami Hiramatsu 提交于
      Since line_finder.lno_s/e are signed int but line_range.start/end
      are unsigned int, it is possible to be overflow when converting
      line_range->start/end to line_finder->lno_s/e.
      This changes line_range.start/end and line_list.line to signed int
      and adds overflow checks when setting line_finder.lno_s/e.
      
      LKML-Reference: <20100414223942.14630.72730.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d3b63d7a
    • M
      perf probe: Fix mis-estimation for shortening filename · dd259c5d
      Masami Hiramatsu 提交于
      Fix mis-estimation size for making a short filename.
      Since the buffer size is 32 bytes and there are '@' prefix and
      '\0' termination, maximum shorten filename length should be
      30. This means, before searching '/', it should be 31 bytes.
      
      LKML-Reference: <20100414223935.14630.11954.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dd259c5d
    • M
      perf probe: Fix to use correct debugfs path finder · 7ca5989d
      Masami Hiramatsu 提交于
      Instead of using debugfs_path, use debugfs_find_mountpoint()
      to find actual debugfs path.
      
      LKML-Reference: <20100414223928.14630.38326.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7ca5989d
    • M
      perf probe: Remove xstrdup()/xstrndup() from util/probe-{event, finder}.c · 02b95dad
      Masami Hiramatsu 提交于
      Remove all xstr*dup() calls from util/probe-{event,finder}.c since
      it may cause 'sudden death' in utility functions and it makes
      reusing it from other code difficult.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171756.3790.89607.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      02b95dad
    • M
      perf probe: Remove xzalloc() from util/probe-{event, finder}.c · e334016f
      Masami Hiramatsu 提交于
      Remove all xzalloc() calls from util/probe-{event,finder}.c since
      it may cause 'sudden death' in utility functions and it makes
      reusing it from other code difficult.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171749.3790.33303.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e334016f
    • M
      perf probe: Remove die() from probe-event code · 146a1439
      Masami Hiramatsu 提交于
      Remove die() and DIE_IF() code from util/probe-event.c since
      these 'sudden death' in utility functions make reusing it from
      other code (especially tui/gui) difficult.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171742.3790.33650.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      146a1439
    • M
      perf probe: Remove die() from probe-finder code · b55a87ad
      Masami Hiramatsu 提交于
      Remove die() and DIE_IF() code from util/probe-finder.c since
      these 'sudden death' in utility functions make reusing it from
      other code (especially tui/gui) difficult.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171735.3790.88853.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b55a87ad
    • M
      perf probe: Support DW_OP_call_frame_cfa in debuginfo · a34a9854
      Masami Hiramatsu 提交于
      When building kernel without CONFIG_FRAME_POINTER, gcc uses
      CFA (canonical frame address) for frame base. With this patch,
      perf probe just gets CFI (call frame information) from debuginfo
      and search corresponding CFA from the CFI. IOW, this allows
      perf probe works correctly on the kernel without CONFIG_FRAME_POINTER.
      
      <Before>
       ./perf probe -fn sched_slice:12 lw.weight
        Fatal: DW_OP 156 is not supported.
                    (^^^ DW_OP_call_frame_cfa)
      
      <After>
      ./perf probe -fn sched_slice:12 lw.weight
      Add new event:
        probe:sched_slice    (on sched_slice:12 with weight=lw.weight)
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171728.3790.98217.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a34a9854
    • M
      perf probe: Support basic type casting · 11a1ca35
      Masami Hiramatsu 提交于
      Add basic type casting for arguments to perf probe. This allows
      users to specify the actual type of arguments. Of course, if
      user sets invalid types, kprobe-tracer rejects that.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171722.3790.50372.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      11a1ca35
    • M
      perf probe: Query basic types from debuginfo · 4984912e
      Masami Hiramatsu 提交于
      Query the basic type information (byte-size and signed-flag) from
      debuginfo and pass that to kprobe-tracer. This is especially useful
      for tracing the members of data structure, because each member has
      different byte-size on the memory.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171715.3790.23730.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4984912e
    • M
      perf probe: Use the last field name as the argument name · df0faf4b
      Masami Hiramatsu 提交于
      Set the last field name to the argument name when the argument
      is refering a data-structure member.
      
      e.g.
       ./perf probe --add 'vfs_read file->f_mode'
       Add new event:
         probe:vfs_read       (on vfs_read with f_mode=file->f_mode)
      
       This probe records file->f_mode, but the argument name becomes "f_mode".
      
      This enables perf-trace command to parse trace event format correctly.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171700.3790.72961.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      df0faf4b
    • M
      perf probe: Support argument name · 48481938
      Masami Hiramatsu 提交于
      Set given names to event arguments. The syntax is same as kprobe-tracer,
      you can add 'NAME=' right before each argument.
      
      e.g.
        ./perf probe vfs_read foo=file
      
       then, 'foo' is set to the argument name as below.
      
        ./perf probe -l
        probe:vfs_read       (on vfs_read@linux-2.6-tip/fs/read_write.c with foo)
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171653.3790.74624.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      48481938
    • F
      perf tools: Fix accidentally preprocessed snprintf callback · fcd14984
      Frederic Weisbecker 提交于
      struct sort_entry has a callback named snprintf that turns an
      entry into a string result.
      But there are glibc versions that implement snprintf through a
      macro. The following expression is then going to get the snprintf
      call preprocessed:
      
              ent->snprintf(...)
      
      to finally end up in a build error:
      
              util/hist.c: Dans la fonction «hist_entry__snprintf» :
              util/hist.c:539: erreur: «struct sort_entry» has no member named «__builtin___snprintf_chk»
      
      To fix this, prepend struct sort_entry callbacks with an "se_"
      prefix.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fcd14984
  2. 14 4月, 2010 12 次提交
    • T
      perf trace: Invoke live mode automatically if record/report not specified · a0cccc2e
      Tom Zanussi 提交于
      Currently, live mode is invoked by explicitly invoking the
      record and report sides and connecting them with a pipe e.g.
      
       $ perf trace record rwtop -o - | perf trace report rwtop 5 -i -
      
      In terms of usability, it's not that bad, but it does require
      the user to type and remember more than necessary.
      
      This patch allows the user to accomplish the same thing without
      specifying the separate record/report steps or the pipe.  So the
      same command as above can be accomplished more simply as:
      
       $ perf trace rwtop 5
      
      Notice that the '-i -' and '-o -' aren't required in this case -
      they're added internally, and that any extra arguments are
      passed along to the report script (but not to the record
      script).
      
      The overall effect is that any of the scripts listed in 'perf
      trace -l' can now be used directly in live mode, with the
      expected arguments, by simply specifying the script and args to
      'perf trace'.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-12-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a0cccc2e
    • T
      perf trace/scripting: Enable scripting shell scripts for live mode · 00b21a01
      Tom Zanussi 提交于
      It should be possible to run any perf trace script in 'live
      mode'. This requires being able to pass in e.g. '-i -' or other
      args, which the current shell scripts aren't equipped to handle.
       In a few cases, there are required or optional args that also
      need special handling. This patch makes changes the current set
      of shell scripts as necessary.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-11-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      00b21a01
    • T
      perf trace/scripting: Add rwtop and sctop scripts · 47902f36
      Tom Zanussi 提交于
      A couple of scripts, one in Python and the other in Perl, that
      demonstrate 'live mode' tracing.  For each, the output of the
      perf event stream is fed continuously to the script, which
      continuously aggregates the data and reports the current results
      every 3 seconds, or at the optionally specified interval.  After
      the current results are displayed, the aggregations are cleared
      and the cycle begins anew.
      
      To run the scripts, simply pipe the output of the 'perf trace
      record' step as input to the corresponding 'perf trace report'
      step, using '-' as the filename to -o and -i:
      
       $ perf trace record sctop -o - | perf trace report sctop -i -
      
      Also adds clear_term() utility functions to the Util.pm and
      Util.py utility modules, for use by any script to clear the
      screen.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-10-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      47902f36
    • T
      perf: Convert perf header build_ids into build_id events · c7929e47
      Tom Zanussi 提交于
      Bypasses the build_id perf header code and replaces it with a
      synthesized event and processing function that accomplishes the
      same thing, used when reading/writing perf data to/from a pipe.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-9-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c7929e47
    • T
      perf: Convert perf tracing data into a tracing_data event · 9215545e
      Tom Zanussi 提交于
      Bypasses the tracing_data perf header code and replaces it with
      a synthesized event and processing function that accomplishes
      the same thing, used when reading/writing perf data to/from a
      pipe.
      
      The tracing data is pretty large, and this patch doesn't attempt
      to break it down into component events.  The tracing_data event
      itself doesn't actually contain the tracing data, rather it
      arranges for the event processing code to skip over it after
      it's read, using the skip return value added to the event
      processing loop in a previous patch.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-8-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9215545e
    • T
      perf: Convert perf event types into event type events · cd19a035
      Tom Zanussi 提交于
      Bypasses the event type perf header code and replaces it with a
      synthesized event and processing function that accomplishes the
      same thing, used when reading/writing perf data to/from a pipe.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-7-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cd19a035
    • T
      perf: Convert perf header attrs into attr events · 2c46dbb5
      Tom Zanussi 提交于
      Bypasses the attr perf header code and replaces it with a
      synthesized event and processing function that accomplishes the
      same thing, used when reading/writing perf data to/from a pipe.
      
      Making the attrs into events allows them to be streamed over a
      pipe along with the rest of the header data (in later patches).
      It also paves the way to allowing events to be added and removed
      from perf sessions dynamically.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-6-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2c46dbb5
    • T
      perf trace: Introduce special handling for pipe input · c239da3b
      Tom Zanussi 提交于
      Adds special treatment for stdin - if the user specifies '-i -'
      to perf trace, the intent is that the event stream be read from
      stdin rather than from a disk file.
      
      The actual handling of the '-' filename is done by the session;
      this just adds a signal handler to stop reporting, and turns off
      interference by the pager.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-5-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c239da3b
    • T
      perf report: Introduce special handling for pipe input · 46656ac7
      Tom Zanussi 提交于
      Adds special treatment for stdin - if the user specifies '-i -'
      to perf report, the intent is that the event stream be written
      to stdin rather than from a disk file.
      
      The actual handling of the '-' filename is done by the session;
      this just adds a signal handler to stop reporting, and turns off
      interference by the pager.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-4-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      46656ac7
    • T
      perf record: Introduce special handling for pipe output · 529870e3
      Tom Zanussi 提交于
      Adds special treatment for stdout - if the user specifies '-o -'
      to perf record, the intent is that the event stream be written
      to stdout rather than to a disk file.
      
      Also, redirect stdout of forked child to stderr - in pipe mode,
      stdout of the forked child interferes with the stdout perf
      stream, so redirect it to stderr where it can still be seen but
      won't be mixed in with the perf output.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-3-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      529870e3
    • T
      perf: Add pipe-specific header read/write and event processing code · 8dc58101
      Tom Zanussi 提交于
      This patch makes several changes to allow the perf event stream
      to be sent and received over a pipe:
      
      - adds pipe-specific versions of the header read/write code
      
      - adds pipe-specific version of the event processing code
      
      - adds a range of event types to be used for header or other
        pseudo events, above the range used by the kernel
      
      - checks the return value of event handlers, which they can use
        to skip over large events during event processing rather than actually
        reading them into event objects.
      
      - unifies the multiple do_read() functions and updates its
        users.
      
      Note that none of these changes affect the existing perf data
      file format or processing - this code only comes into play if
      perf output is sent to stdout (or is read from stdin).
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-2-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8dc58101
    • I
      perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() · c0555642
      Ian Munsie 提交于
      Parsing an option from the command line with OPT_BOOLEAN on a
      bool data type would not work on a big-endian machine due to the
      manner in which the boolean was being cast into an int and
      incremented. For example, running 'perf probe --list' on a
      PowerPC machine would fail to properly set the list_events bool
      and would therefore print out the usage information and
      terminate.
      
      This patch makes OPT_BOOLEAN work as expected with a bool
      datatype. For cases where the original OPT_BOOLEAN was
      intentionally being used to increment an int each time it was
      passed in on the command line, this patch introduces OPT_INCR
      with the old behaviour of OPT_BOOLEAN (the verbose variable is
      currently the only such example of this).
      
      I have reviewed every use of OPT_BOOLEAN to verify that a true
      C99 bool was passed. Where integers were used, I verified that
      they were only being used for boolean logic and changed them to
      bools to ensure that they would not be mistakenly used as ints.
      The major exception was the verbose variable which now uses
      OPT_INCR instead of OPT_BOOLEAN.
      Signed-off-by: NIan Munsie <imunsie@au.ibm.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: <stable@kernel.org> # NOTE: wont apply to .3[34].x cleanly, please backport
      Cc: Git development list <git@vger.kernel.org>
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Eric B Munson <ebmunson@us.ibm.com>
      Cc: Valdis.Kletnieks@vt.edu
      Cc: WANG Cong <amwang@redhat.com>
      Cc: Thiago Farina <tfransosi@gmail.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1271147857-11604-1-git-send-email-imunsie@au.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0555642
  3. 10 4月, 2010 1 次提交
  4. 08 4月, 2010 6 次提交
    • A
      perf trace: Ignore "overwrite" field if present in /events/header_page · e9e94e3b
      Arnaldo Carvalho de Melo 提交于
      That is not used in perf where we have the LOST events.
      
      Without this patch we get:
      
      [root@doppio ~]# perf lock report | head -3
        Warning: Error: expected 'data' but read 'overwrite'
      
      So, to make the same perf command work with kernels with and without
      this field, introduce variants for the parsing routines to not warn the
      user in such case.
      
      Discussed-with: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e9e94e3b
    • R
      perf: cleanup some Documentation · 854c5548
      Randy Dunlap 提交于
      Correct typos in perf bench & perf sched help text.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <20100331113100.cc898487.randy.dunlap@oracle.com>
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      854c5548
    • R
      perf bench: fix spello · f0e9c4fc
      Randy Dunlap 提交于
      Fix spello in user message.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
      Cc: Paul Mackerra <paulus@samba.org>s
      LKML-Reference: <20100331113056.2c7df509.randy.dunlap@oracle.com>
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      f0e9c4fc
    • A
      perf tools: Reorganize some structs to save space · eed05fe7
      Arnaldo Carvalho de Melo 提交于
      Using 'pahole --packable' I found some structs that could be reorganized
      to eliminate alignment holes, in some cases getting them to be cacheline
      multiples.
      
      [acme@doppio linux-2.6-tip]$ codiff perf.old ~/bin/perf
      builtin-annotate.c:
        struct perf_session    |   -8
        struct perf_header     |   -8
       2 structs changed
      
      builtin-diff.c:
        struct sample_data         |   -8
       1 struct changed
        diff__process_sample_event |   -8
       1 function changed, 8 bytes removed, diff: -8
      
      builtin-sched.c:
        struct sched_atom      |   -8
       1 struct changed
      
      builtin-timechart.c:
        struct per_pid         |   -8
       1 struct changed
        cmd_timechart          |  -16
       1 function changed, 16 bytes removed, diff: -16
      
      builtin-probe.c:
        struct perf_probe_point |   -8
        struct perf_probe_event |   -8
       2 structs changed
        opt_add_probe_event     |   -3
       1 function changed, 3 bytes removed, diff: -3
      
      util/probe-finder.c:
        struct probe_finder      |   -8
       1 struct changed
        find_kprobe_trace_events |  -16
       1 function changed, 16 bytes removed, diff: -16
      
      /home/acme/bin/perf:
       4 functions changed, 43 bytes removed, diff: -43
      [acme@doppio linux-2.6-tip]$
      
      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: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eed05fe7
    • A
      perf TUI: Move "Yes" button to before "No" · c0ed55d2
      Arnaldo Carvalho de Melo 提交于
      Esc + Enter should be enough warning to avoid accidentaly exiting from
      the browser.
      
      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: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c0ed55d2
    • A
      perf TUI: Show filters on the title and add help line about how to zoom out · 6e7ab4c6
      Arnaldo Carvalho de Melo 提交于
      Suggested-by: NIngo Molnar <molnar@elte.hu>
      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: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6e7ab4c6
  5. 06 4月, 2010 1 次提交
    • A
      perf kmem: Fix breakage introduced by 5a0e3ad6 slab.h script · 8c40041f
      Arnaldo Carvalho de Melo 提交于
      Commit 5a0e3ad6 ("include cleanup: Update gfp.h and slab.h
      includes to prepare for breaking implicit slab.h inclusion
      from percpu.h") added a '#include <linux/slab.h>' to
      tools/perf/builtin-kmem.h because: that tool has lines like
      this:
      
              if (!strcmp(event->name, "kmalloc") ||
                  !strcmp(event->name, "kmem_cache_alloc")) {
                      process_alloc_event(data, event, cpu, timestamp, thread, 0);
                      return;
              }
      
      So, using the script regex:
      
      >>> import re
      >>> s = re.compile(r'^(|.*[^a-zA-Z0-9_])_*(slab_is_available|kmem_cache_|k[mzc]alloc|krealloc|kz?free|ksize|__getname|putname)')
      >>> l = '   !strcmp(event->name, "kmem_cache_alloc")) {'
      >>> s.search(l)
      <_sre.SRE_Match object at 0xb77b1ad0>
      >>>
      
      Remove that file that is not available in the tools/perf include
      path and thus builtin-kmem.c couldn't be compiled.
      Reported-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1270561053-14308-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8c40041f