You are here

function xhprof_pc_info in XHProf 7

Same name and namespace in other branches
  1. 6 xhprof.inc \xhprof_pc_info()

Print info for a parent or child function xhprof_in the parent & children report.

@author Kannan

1 call to xhprof_pc_info()
xhprof_print_pc_array in ./xhprof.inc

File

./xhprof.inc, line 1011

Code

function xhprof_pc_info($info, $base_ct, $base_info, $parent) {
  global $sort_col;
  global $metrics;
  global $format_cbk;
  global $display_calls;
  $type = $parent ? "Parent" : "Child";
  if ($display_calls) {
    $mouseoverct = xhprof_get_tooltip_attributes($type, "ct");

    // Call count.
    $row = array(
      xhprof_print_num_cell($info["ct"], $format_cbk["ct"], $sort_col == "ct", $mouseoverct),
    );
    $row[] = xhprof_print_pct_cell($info["ct"], $base_ct, $sort_col == "ct", $mouseoverct);
  }

  // Inclusive metric values.
  foreach ($metrics as $metric) {
    $row[] = xhprof_print_num_cell($info[$metric], $format_cbk[$metric], $sort_col == $metric, xhprof_get_tooltip_attributes($type, $metric));
    $row[] = xhprof_print_pct_cell($info[$metric], $base_info[$metric], $sort_col == $metric, xhprof_get_tooltip_attributes($type, $metric));
  }
  return $row;
}