I'm trying to profile a specific cron task in drupal 6 to check the function calls made and what consumes the maximum time and decided to use the XHProf module which I've never used before. I've got the module successfully installed and able to get the page loads profiled and listed in admin/reports/xhprof.
But to get my cron task to be profiled and listed in it I'm pretty clueless and tried out a few things from what I could gather from PHP.net but beyond coding
xhprof_enable(); echo "<h2>ENABLED</h2>"; // the code block I wish to profile $xhprof_data = xhprof_disable(); echo "<pre>"; print_r($xhprof_data); echo "</pre>";
by checking the internet. The
$xhprof_data does contain the necessary info array. But I'm not able to get the slightest hint of how this data that's printed could be formatted and displayed like the page loads which get profiled out of the box. Any help on this is greatly appreciated.