åå¤å±ã®ã¼ã¯ãã¼ã«è¡ã£ã¦ãã
麻éåã§ãã
ã¨ããããï¼Perl6 ã®Nagoya.pm ã§ãã£ã¦ãç¶ããããï¼
å¿
è¦ãªæ©è½ã¯ï¼ãã¹ããã調ã¹ãï¼ãã¨ã¯ããã£ãã®ã§
æ®éã®ããã°ã©ãã³ã°ã§å¿
è¦ãªãã¨ãèããï¼
ä»ã¯é ãã®ããªãã¨ããããã®ã§ï¼ãããã¡ã¤ã©ããªï¼ãããï¼
docs/dev/profiling.pod - Profiling Parrot
# Copyright (C) 2001-2005, Parrot Foundation. =head1 NAME docs/dev/profiling.pod - Profiling Parrot =head1 DESCRIPTION ãã®ãã¡ã¤ã«ã¯ï¼Parrot ã®ãããã¡ã¤ãªã³ã°å®è¡é¨åã®ä½¿ç¨æ¹æ³ã«ã¤ãã¦è¨è¿°ãã¦ããï¼ =head2 Summary ãããã¡ã¤ã«å®è¡ç°å¢ã¯ï¼Parrot ã®ä¸é¨ã¨ãã¦ä½ããã¦ããï¼PIRã³ã¼ãã®ããã«ããã¯ãçºè¦ã§ããããã«è¨è¨ããã¦ãã¾ãï¼HLL(ï¼)ãããã¡ã¤ã«ããµãã¼ãããããã«å®è£ ããã¦ãã¾ããï¼ç¾å¨ã§ã¯å¶éãããã¾ãï¼C<parrot>ãã¤ããªã£ã« C<-Rprofiling> ã C<--runcore profiling>ã渡ããã¨ã§ï¼ã³ã¼ãã¯ãããã¡ã¤ãªã³ã°å®è¡ç°å¢ä¸ã§å®è¡ããã¾ãï¼åºåãã¡ã¤ã«ã®ä½ç½®ã¨ãã©ã¼ãããã¯ï¼æ¬¡ã«è¨è¿°ãããããã«ç°å¢å¤æ°ã«ãã£ã¦æ±ºå®ããã¾ãï¼ãããã¡ã¤ãªã³ã°å®è¡ç°å¢ãé¢é£ããç°å¢å¤æ°ãçºè¦ã§ããªãå ´åã¯ï¼æ¬¡ã§æ¸ããããããªããã©ã«ãå¤ã使ãã¾ãï¼ =head2 ç°å¢å¤æ° =over 4 =item C<PARROT_PROFILING_FILENAME> ããããã°ï¼åºåãæ¸ããããã¡ã¤ã«ã®å®å ¨ãªååã決å®ãã¾ãï¼Parrot ã¯ï¼æ¸ãããã«éãåã«ãã¡ã¤ã«åãåå¨ãããã©ããããã§ãã¯ãããï¼ä»¥åã®ãããã¡ã¤ã«ãå«ãæ¢åã®ãã¡ã¤ã«ãå¶ç¶ã«ãä¸æ¸ããã¦ãã¾ãã§ãããï¼ å¤ãè¨å®ããã¦ããªããã°ï¼Parrot ã¯ãã¡ã¤ã«ãC<parrot.pprof.X> ã«æ¸ãåºãã¾ãï¼ããã§ï¼X ã¯Parrot ããã»ã¹ã®PID ã§ãï¼ãããã¡ã¤ãªã³ã°å®è¡é¨åãåå¨ããå ´åï¼ãããã¡ã¤ã«ãæ¸ãããã¨ãã«ã¢ãã¦ã³ã¹ããã¡ãã»ã¼ã¸ãåºåãã¾ãï¼ ãã®å¤æ°ã¯ï¼C<stdout> ã C<stderr> ã¨ããç¹æ®ãªå¤ãæã¤ãã¨ãã§ãã¾ãï¼ãããã®å¤ã®ã©ã¡ããã(大æåå°æåã«é¢ä¿ç¡ã) è¦ã¤ãã£ãå ´åï¼Parrot ã¯ãããã¡ã¤ãªã³ã°ã®çµæãstdout ã stderr ã«åºåãã¾ãï¼ =item C<PARROT_PROFILING_OUTPUT> ããã¯ï¼ãããã¡ã¤ã«ãå«ãåºåã®ã¿ã¤ãã決å®ãã¾ãï¼ç¾å¨ã®ãªãã·ã§ã³ã¯ï¼C<pprof> 㨠C<none>ã§ãï¼C<pprof> ã¯ï¼ããã©ã«ãã§ããï¼ASCII æåã§ããããï¼äººéãèªãããããªå½¢å¼ã§ãï¼ããã¯ï¼tools/dev/pprof2cg.pl ã«ãã£ã¦å¾å¦çãã¦ï¼Callgrind äºæã®ãã©ã¼ãããã«å¤æã§ãã¾ãï¼C<none> ã¯ï¼çµæãã¡ã¤ã«ãæ¸ãåºãã¾ããï¼ããã¯ï¼ä¸»ã«ãããã¡ã¤ãªã³ã°ã®å®è¡é¨åèªèº«ã®ãã¹ããæé©åã«ã¨ã£ã¦æç¨ã§ãï¼ããã¯ï¼PIR ã¨HLL ã³ã¼ãããããã¡ã¤ã«ãããã¦ã¼ã¶ã«ã¨ã£ã¦ãã¾ãæå³ããªããã¨ãæå¾ ããã¦ãã¾ãï¼ =item C<PARROT_PROFILING_ANNOTATIONS> ããã¯ï¼PIR ã¢ããã¼ã·ã§ã³ããããã¡ã¤ã«ã®ä¸é¨ã¨ãã¦è¨é²ãããããã«è¨å®ãã¾ãï¼ã¢ããã¼ã·ã§ã³ã¯ï¼HLL ã³ã¼ãããããã¡ã¤ãªã³ã°ããã®ã«å¿ è¦ã§ããï¼ãããã¡ã¤ãªã³ã°ã®å®è¡é¨åãããé ããã¾ãï¼ããã©ã«ãã§ã¯ï¼ãããã¯ç¡å¹ã§ãï¼ããããæå¹ã«ããããã«ï¼ãã®å¤ãè¨å®ãã¾ãï¼ =item C<PARROT_PROFILING_CANONICAL_OUPUT> ãããè¨å®ããã¦ããå ´åï¼ãããã¡ã¤ãªã³ã°ã®å®è¡é¨åã¯ï¼å ¨ã¦ã®ã¢ãã¬ã¹ã1ã¤ã®å®æ°å¤ã¨ãã¦ï¼å ¨ã¦ã®æå»ã1ã¨ãã¦è¨é²ãã¾ãï¼ãã®ãªãã·ã§ã³ã¯ï¼ä¸ããããã³ã¼ãã®é¨åã常ã«åããããã¡ã¤ã«ãæ£ç¢ºã«çæãããã¨ãä¿è¨¼ããæ¹æ³ãããã¨ä¾¿å©ãªå ´æï¼ä¸»ã«ãã¹ãç¨ã«ä¾¿å©ã§ãï¼ãã®æ©è½ãæå¹ã«ãããå ´åï¼å¤åã©ã³ãã ãªããã·ã¥ã·ã¼ãã«èµ·å ããé決å®çãªæ¯èããé¿ããããã« C<--hash-seed 1324> ã使ã£ã¦Parrot ã«ç¹å®ã®ããã·ã¥ã·ã¼ãã渡ãããã¨æãã§ãããï¼ ãã®å¤æ°ã¯ãã¹ãããããã¡ã¤ãªã³ã°ã®å®è¡é¨åããé¢ãã¦ã¯æç¨ã§ã¯ããã¾ããï¼ããã¦ã¦ã¼ã¶ã®ã³ã¼ãã®ãããã¹ããããè¦ã¤ããããã«æ®ã©ç¢ºå®ã«å©ãã«ããªãã¾ããï¼ =back =cut
ã¤ã¾ãï¼C
ã§ï¼ããè¦ãã¨
$ parrot -Rprofiling <workdir>/rakudo-star-2011.07/install/lib/parrot/3.6.0/languages/perl6/perl6.pbc <scriptname> $ perl <workdir>/rakudo-star-2011.07/install/lib/parrot/3.6.0/tools/dev/pprof2cg.pl parrot.pprof.XX
pprof2cg.pl ã¯ï¼Callgrind-compatible äºæãã¡ã¤ã«ãåºåãããããã®ã§
valgrind ãã¤ã³ã¹ãã¼ã«ãããã©ï¼ããããcallgrind ã®ãã¡ã¤ã«è¦ãã®ã¯ï¼
kcachegrind ã ã£ãâ¦
$ sudo brew install --HEAD valgrind # Lion ã ã¨head ãã対å¿ãã¦ãªãã£ã
$ sudo brew install qt --with-qt3support $ rehash $ wget http://kcachegrind.sourceforge.net/kcachegrind-0.7.0.tar.gz $ tar xf kcachegrind-0.7.0.tar.gz $ cd kcachegrind-0.7.0/qcachegrind $ qmake $ make $ ./qcachegrind.app/Contents/MacOS/qcachegrind
ãã㧠parrot.out.$PID ãã¡ã¤ã«ãèªãã¾ãï¼
ãåè
ã§è¦ã¦ã¿ããã ãã©ï¼
ããã¯ï¼Perl6;Perl6Role;ACCEPTS(Role.pir) ã«æéãããã£ã¦ããã§ãããï¼
次ã¯pir ãèªãæµãï¼
PEG ãè¦ãã¨ãããã¤ããé ãã
- 10/22 valgrand ã®è¾ºã追è¨