xref: /linux/tools/perf/scripts/perl/Perf-Trace-Util/README (revision d1b93772be78486397693fc39d3ddea3fda90105)
1bcefe12eSTom ZanussiPerf-Trace-Util version 0.01
2bcefe12eSTom Zanussi============================
3bcefe12eSTom Zanussi
4bcefe12eSTom ZanussiThis module contains utility functions for use with perf trace.
5bcefe12eSTom Zanussi
6*d1b93772STom ZanussiCore.pm and Util.pm are pure Perl modules; Core.pm contains routines
7*d1b93772STom Zanussithat the core perf support for Perl calls on and should always be
8*d1b93772STom Zanussi'used', while Util.pm contains useful but optional utility functions
9*d1b93772STom Zanussithat scripts may want to use.  Context.pm contains the Perl->C
10*d1b93772STom Zanussiinterface that allows scripts to access data in the embedding perf
11*d1b93772STom Zanussiexecutable; scripts wishing to do that should 'use Context.pm'.
12*d1b93772STom Zanussi
13*d1b93772STom ZanussiThe Perl->C perf interface is completely driven by Context.xs.  If you
14*d1b93772STom Zanussiwant to add new Perl functions that end up accessing C data in the
15*d1b93772STom Zanussiperf executable, you add desciptions of the new functions here.
16*d1b93772STom Zanussiscripting_context is a pointer to the perf data in the perf executable
17*d1b93772STom Zanussithat you want to access - it's passed as the second parameter,
18*d1b93772STom Zanussi$context, to all handler functions.
19*d1b93772STom Zanussi
20*d1b93772STom ZanussiAfter you do that:
21*d1b93772STom Zanussi
22*d1b93772STom Zanussi  perl Makefile.PL   # to create a Makefile for the next step
23*d1b93772STom Zanussi  make               # to create Context.c
24*d1b93772STom Zanussi
25*d1b93772STom Zanussi  edit Context.c to add const to the char* file = __FILE__ line in
26*d1b93772STom Zanussi  XS(boot_Perf__Trace__Context) to silence a warning/error.
27*d1b93772STom Zanussi
28*d1b93772STom Zanussi  You can delete the Makefile, object files and anything else that was
29*d1b93772STom Zanussi  generated e.g. blib and shared library, etc, except for of course
30*d1b93772STom Zanussi  Context.c
31*d1b93772STom Zanussi
32*d1b93772STom Zanussi  You should then be able to run the normal perf make as usual.
33*d1b93772STom Zanussi
34bcefe12eSTom ZanussiINSTALLATION
35bcefe12eSTom Zanussi
36bcefe12eSTom ZanussiBuilding perf with perf trace Perl scripting should install this
37bcefe12eSTom Zanussimodule in the right place.
38bcefe12eSTom Zanussi
39bcefe12eSTom ZanussiYou should make sure libperl is installed first e.g. apt-get install
40bcefe12eSTom Zanussilibperl-dev.
41bcefe12eSTom Zanussi
42bcefe12eSTom ZanussiDEPENDENCIES
43bcefe12eSTom Zanussi
44bcefe12eSTom ZanussiThis module requires these other modules and libraries:
45bcefe12eSTom Zanussi
46*d1b93772STom Zanussi  None
47bcefe12eSTom Zanussi
48bcefe12eSTom ZanussiCOPYRIGHT AND LICENCE
49bcefe12eSTom Zanussi
50bcefe12eSTom ZanussiCopyright (C) 2009 by Tom Zanussi <tzanussi@gmail.com>
51bcefe12eSTom Zanussi
52bcefe12eSTom ZanussiThis library is free software; you can redistribute it and/or modify
53bcefe12eSTom Zanussiit under the same terms as Perl itself, either Perl version 5.10.0 or,
54bcefe12eSTom Zanussiat your option, any later version of Perl 5 you may have available.
55bcefe12eSTom Zanussi
56bcefe12eSTom ZanussiAlternatively, this software may be distributed under the terms of the
57bcefe12eSTom ZanussiGNU General Public License ("GPL") version 2 as published by the Free
58bcefe12eSTom ZanussiSoftware Foundation.
59bcefe12eSTom Zanussi
60