phacility / xhprof

XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based user interface.
http://pecl.php.net/package/xhprof
Apache License 2.0
2.6k stars 925 forks source link

Whitelist for functions #39

Closed beberlei closed 9 years ago

beberlei commented 10 years ago

Add feature to xhprof_enable() allowing to pass whitelist of "functions" into the $options array, profiling only those functions:

xhprof_enable(0, array('functions' => array('strlen'));
$data = xhprof_disable();

Will now only contain main() and main()==>strlen.

Since xhprof puts a relation with a parent, the only parent to strlen in this case is main(). However if you have a list of many functions, there might be a function called between main() and strlen and it will be displayed as such.