aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/perl/Perf-Trace-Util/README
diff options
context:
space:
mode:
authorTom Zanussi <tzanussi@gmail.com>2009-11-25 02:15:50 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-28 04:04:27 -0500
commitd1b93772be78486397693fc39d3ddea3fda90105 (patch)
treefc4387cf44de336e655d03ee488a83cadde22e04 /tools/perf/scripts/perl/Perf-Trace-Util/README
parentbcefe12eff5dca6fdfa94ed85e5bee66380d5cd9 (diff)
perf trace: Add interface to access perf data from Perl handlers
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 <tzanussi@gmail.com> Cc: fweisbec@gmail.com Cc: rostedt@goodmis.org Cc: anton@samba.org Cc: hch@infradead.org LKML-Reference: <1259133352-23685-6-git-send-email-tzanussi@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/scripts/perl/Perf-Trace-Util/README')
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/README34
1 files changed, 29 insertions, 5 deletions
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/README b/tools/perf/scripts/perl/Perf-Trace-Util/README
index 0a58378f0836..adb99aa3a7b8 100644
--- a/tools/perf/scripts/perl/Perf-Trace-Util/README
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/README
@@ -3,6 +3,34 @@ Perf-Trace-Util version 0.01
3 3
4This module contains utility functions for use with perf trace. 4This module contains utility functions for use with perf trace.
5 5
6Core.pm and Util.pm are pure Perl modules; Core.pm contains routines
7that the core perf support for Perl calls on and should always be
8'used', while Util.pm contains useful but optional utility functions
9that scripts may want to use. Context.pm contains the Perl->C
10interface that allows scripts to access data in the embedding perf
11executable; scripts wishing to do that should 'use Context.pm'.
12
13The Perl->C perf interface is completely driven by Context.xs. If you
14want to add new Perl functions that end up accessing C data in the
15perf executable, you add desciptions of the new functions here.
16scripting_context is a pointer to the perf data in the perf executable
17that you want to access - it's passed as the second parameter,
18$context, to all handler functions.
19
20After you do that:
21
22 perl Makefile.PL # to create a Makefile for the next step
23 make # to create Context.c
24
25 edit Context.c to add const to the char* file = __FILE__ line in
26 XS(boot_Perf__Trace__Context) to silence a warning/error.
27
28 You can delete the Makefile, object files and anything else that was
29 generated e.g. blib and shared library, etc, except for of course
30 Context.c
31
32 You should then be able to run the normal perf make as usual.
33
6INSTALLATION 34INSTALLATION
7 35
8Building perf with perf trace Perl scripting should install this 36Building perf with perf trace Perl scripting should install this
@@ -15,12 +43,10 @@ DEPENDENCIES
15 43
16This module requires these other modules and libraries: 44This module requires these other modules and libraries:
17 45
18 blah blah blah 46 None
19 47
20COPYRIGHT AND LICENCE 48COPYRIGHT AND LICENCE
21 49
22Put the correct copyright and licence information here.
23
24Copyright (C) 2009 by Tom Zanussi <tzanussi@gmail.com> 50Copyright (C) 2009 by Tom Zanussi <tzanussi@gmail.com>
25 51
26This library is free software; you can redistribute it and/or modify 52This library is free software; you can redistribute it and/or modify
@@ -31,5 +57,3 @@ Alternatively, this software may be distributed under the terms of the
31GNU General Public License ("GPL") version 2 as published by the Free 57GNU General Public License ("GPL") version 2 as published by the Free
32Software Foundation. 58Software Foundation.
33 59
34
35