Permalink
Browse files

Merge pull request #45 from spk/ignored_functions

 - Nice feature

thanks
paul
  • Loading branch information...
2 parents 160fb23 + 552153c commit 3693615155cc1d6a007364f04b4003c68c4495df @preinheimer committed Jul 2, 2012
Showing with 8 additions and 1 deletion.
  1. +5 −1 external/header.php
  2. +3 −0 xhprof_lib/config.sample.php
View
@@ -104,7 +104,11 @@ public static function __callstatic($name, $arguments)
if (extension_loaded('xhprof') && $_xhprof['doprofile'] === true) {
include_once dirname(__FILE__) . '/../xhprof_lib/utils/xhprof_lib.php';
include_once dirname(__FILE__) . '/../xhprof_lib/utils/xhprof_runs.php';
- xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
+ if (isset($ignoredFunctions) && is_array($ignoredFunctions) && !empty($ignoredFunctions)) {
+ xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY, array('ignored_functions' => $ignoredFunctions));
+ } else {
+ xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
+ }
}elseif(!extension_loaded('xhprof') && $_xhprof['display'] === true)
{
$message = 'Warning! Unable to profile run, xhprof extension not loaded';
@@ -51,6 +51,9 @@
//$otherURLS = array();
+// ignore builtin functions and call_user_func* during profiling
+//$ignoredFunctions = array('call_user_func', 'call_user_func_array', 'socket_select');
+
//Default weight - can be overidden by an Apache environment variable 'xhprof_weight' for domain-specific values
$weight = 100;

0 comments on commit 3693615

Please sign in to comment.