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