18c2ecf20Sopenharmony_ciPerf-Trace-Util version 0.01 28c2ecf20Sopenharmony_ci============================ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciThis module contains utility functions for use with perf script. 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciCore.pm and Util.pm are pure Perl modules; Core.pm contains routines 78c2ecf20Sopenharmony_cithat the core perf support for Perl calls on and should always be 88c2ecf20Sopenharmony_ci'used', while Util.pm contains useful but optional utility functions 98c2ecf20Sopenharmony_cithat scripts may want to use. Context.pm contains the Perl->C 108c2ecf20Sopenharmony_ciinterface that allows scripts to access data in the embedding perf 118c2ecf20Sopenharmony_ciexecutable; scripts wishing to do that should 'use Context.pm'. 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciThe Perl->C perf interface is completely driven by Context.xs. If you 148c2ecf20Sopenharmony_ciwant to add new Perl functions that end up accessing C data in the 158c2ecf20Sopenharmony_ciperf executable, you add desciptions of the new functions here. 168c2ecf20Sopenharmony_ciscripting_context is a pointer to the perf data in the perf executable 178c2ecf20Sopenharmony_cithat you want to access - it's passed as the second parameter, 188c2ecf20Sopenharmony_ci$context, to all handler functions. 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciAfter you do that: 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci perl Makefile.PL # to create a Makefile for the next step 238c2ecf20Sopenharmony_ci make # to create Context.c 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci edit Context.c to add const to the char* file = __FILE__ line in 268c2ecf20Sopenharmony_ci XS(boot_Perf__Trace__Context) to silence a warning/error. 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci You can delete the Makefile, object files and anything else that was 298c2ecf20Sopenharmony_ci generated e.g. blib and shared library, etc, except for of course 308c2ecf20Sopenharmony_ci Context.c 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci You should then be able to run the normal perf make as usual. 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciINSTALLATION 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ciBuilding perf with perf script Perl scripting should install this 378c2ecf20Sopenharmony_cimodule in the right place. 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciYou should make sure libperl and ExtUtils/Embed.pm are installed first 408c2ecf20Sopenharmony_cie.g. apt-get install libperl-dev or yum install perl-ExtUtils-Embed. 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ciDEPENDENCIES 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ciThis module requires these other modules and libraries: 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci None 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ciCOPYRIGHT AND LICENCE 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ciCopyright (C) 2009 by Tom Zanussi <tzanussi@gmail.com> 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ciThis library is free software; you can redistribute it and/or modify 538c2ecf20Sopenharmony_ciit under the same terms as Perl itself, either Perl version 5.10.0 or, 548c2ecf20Sopenharmony_ciat your option, any later version of Perl 5 you may have available. 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ciAlternatively, this software may be distributed under the terms of the 578c2ecf20Sopenharmony_ciGNU General Public License ("GPL") version 2 as published by the Free 588c2ecf20Sopenharmony_ciSoftware Foundation. 598c2ecf20Sopenharmony_ci 60