15 Dec, 2009

2 commits

  • The return value from perl_run() is currently ignored, but it
    should be checked and used to exit perf if there are problems
    loading the script.

    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
     

07 Dec, 2009

2 commits


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

2 commits

  • 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
     
  • Implement trace_scripting_ops to make Perl a supported perf
    trace scripting language.

    Additionally adds code that allows Perl trace scripts to access
    the 'flag' and 'symbolic' (__print_flags(), __print_symbolic())
    field information parsed from the trace format files.

    Also adds the Perl implementation of the generate_script()
    trace_scripting_op, which creates a ready-to-run perf trace Perl
    script based on existing trace data. Scripts generated by this
    implementation print out all the fields for each event mentioned
    in perf.data (and will detect and generate the proper scripting
    code for 'flag' and 'symbolic' fields), and will additionally
    generate handlers for the special 'trace_unhandled',
    'trace_begin' and 'trace_end' handlers. Script authors can
    simply remove the printing code to implement their own custom
    event handling.

    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