You are here

function xhprof_print_pc_array in XHProf 6

Same name and namespace in other branches
  1. 7 xhprof.inc \xhprof_print_pc_array()
1 call to xhprof_print_pc_array()
xhprof_symbol_report in ./xhprof.inc
Generates a report for a single function/symbol.

File

./xhprof.inc, line 1034

Code

function xhprof_print_pc_array($url_params, $results, $base_ct, $base_info, $parent, $run1, $run2) {
  global $base_path;
  $rows = array();

  // Construct section title
  $title = $parent ? 'Parent function' : 'Child function';
  if (count($results) > 1) {
    $title = '<strong>' . $title . 's</strong>';
  }

  // Get the current path info to assemble the symbol links. There is probably
  // a better way to do this…
  $path_parts = explode('/', $_GET['q']);
  array_pop($path_parts);
  $symbol_path = implode('/', $path_parts);
  $rows[] = array(
    array(
      'data' => $title,
      'colspan' => 11,
    ),
  );
  usort($results, 'xhprof_sort_cbk');
  foreach ($results as $info) {
    $row = array();
    $row[] = l($info["fn"], $symbol_path . '/' . $info["fn"]);
    $row = array_merge($row, xhprof_pc_info($info, $base_ct, $base_info, $parent));
    $rows[] = $row;
  }
  return $rows;
}