25 Feb, 2010

2 commits

  • Adds a set of scripts that aggregate system call totals and system
    call errors. Most are Python scripts that also test basic
    functionality of the new Python engine, but there's also one Perl
    script added for comparison and for reference in some new
    Documentation contained in a later patch.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • Add base support for Python scripting to perf trace.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     

24 Feb, 2010

3 commits

  • The check-perf-trace script only checks Perl functionality, and
    doesn't really need to be listed as as user script anyway.

    This only removes the '-report' shell script, so although it doesn't
    appear in the listing, the '-record' shell script and the check perf
    trace perl script itself is still available and can still be run
    manually as such:

    $ libexec/perf-core/scripts/perl/bin/check-perf-trace-record
    $ perf trace -s libexec/perf-core/scripts/perl/check-perf-trace.pl

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • This stuff is needed by all scripting engines; move it from the Perl
    engine source to a more common place.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • Fix bogus calculation.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     

15 Dec, 2009

2 commits

  • Lists the available perf trace scripts, one per line e.g.:

    root@tropicana:~# perf trace -l
    List of available trace scripts:
    workqueue-stats workqueue stats (ins/exe/create/destroy)
    wakeup-latency system-wide min/max/avg wakeup latency
    rw-by-file r/w activity for a program, by file
    check-perf-trace useless but exhaustive test script
    rw-by-pid system-wide r/w activity

    To be consistent with the other listing options in perf, the
    current latency trace option was changed to '-L', and '-l' is
    now used to access the script listing as:

    To create the list, it searches each scripts/*/bin directory for
    files ending with "-report" and reads information found in
    certain comment lines contained in those shell scripts:

    - if the comment line starts with "description:", the rest of the
    line is used as a 'half-line' description. To keep each line in
    the list to a single line, the description should be limited to 40
    characters (the rest of the line contains the script name and
    args)

    - if the comment line starts with "args:", the rest of the line
    names the args the script supports. Required args should be
    surrounded by <> brackets, optional args by [] brackets.

    The current scripts in scripts/perl/bin have also been updated
    with description: and args: comments.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • One oversight of the original scripting_ops patch was a lack of
    support for passing args to handler scripts. This adds
    argc/argv to the start_script() scripting_op, and changes the
    rw-by-file script to take 'comm' arg rather than the 'perf'
    value currently hard-coded. It also takes the opportunity to do
    some related minor cleanup.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     

30 Nov, 2009

2 commits

  • Fedora needs perl-ExtUtils-Embed for Perl scripting, which also
    brings along libperl-devel; note this info for the convenience
    of Fedora users.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    Cc: anton@samba.org
    Cc: hch@infradead.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • The common_* functions (e.g. common_pc(), etc) are exported as
    common_* but named get_common_*, resulting in unresolved
    subroutine errors when executing scripts.

    Make the internal and external names match.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    Cc: anton@samba.org
    Cc: hch@infradead.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     

28 Nov, 2009

3 commits

  • To capture the relevant events for a given Perl script and to
    avoid having to continually remember and type in long
    command-lines, add a scripts/perl/bin directory containing two
    simple shell scripts for each Perl script, one for recording and
    one for processing/display. For example, to record perf data for
    the rw-by-pid.pl script, run scripts/perl/bin/rw-by-pid-record
    and to actually run the script and display the output run
    scripts/perl/bin/rw-by-pid-report.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    Cc: anton@samba.org
    Cc: hch@infradead.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • The Perl scripting support for perf trace allows most of a trace
    event's data to be accessed directly as handler arguments, but
    not all of it e.g. the less common fields aren't passed in. To
    give scripts access to the other fields and/or any other data or
    metadata in the main perf executable that might be useful, a way
    to access the C data in perf from Perl is needed; this patch
    uses the Perl XS facility to do it for the common_xxx event
    fields not passed to handler functions.

    Context.pm exports three functions to Perl scripts that access
    fields for the current event by calling back into perf:
    common_pc(), common_flags() and common_lock_depth(). Support
    for common_flags() field values was added to Core.pm and a
    script used to sanity check these and other basic scripting
    features, check-perf-trace.pl, was also added.

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    Cc: anton@samba.org
    Cc: hch@infradead.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi
     
  • Add Perf-Trace-Util Perl module and some scripts that use it.
    Core.pm contains Perl code to define and access flag and
    symbolic fields. Util.pm contains general-purpose utility
    functions.

    Also adds some makefile bits to install them in
    libexec/perf-core/scripts/perl (or wherever perfexec_instdir
    points).

    Signed-off-by: Tom Zanussi
    Cc: fweisbec@gmail.com
    Cc: rostedt@goodmis.org
    Cc: anton@samba.org
    Cc: hch@infradead.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tom Zanussi