From 193425f37fb82dc0ce5fa5b62d0e4ff3305d0e0b Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 11 Feb 2010 11:03:16 +0000 Subject: [PATCH] Add wrappers for NYTP_write_time_block and NYTP_write_time_line, and use them from nytprofmerge. --- FileHandle.xs | 16 ++++++++++++++++ bin/nytprofmerge | 9 ++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/FileHandle.xs b/FileHandle.xs index 57bc879..88d7b61 100644 --- a/FileHandle.xs +++ b/FileHandle.xs @@ -992,3 +992,19 @@ SV *name SvUTF8(name) ? -(I32)len : (I32)len ); OUTPUT: RETVAL + +size_t +NYTP_write_time_block(handle, elapsed, fid, line, last_block_line, last_sub_line) +NYTP_file handle +unsigned int elapsed +unsigned int fid +unsigned int line +unsigned int last_block_line +unsigned int last_sub_line + +size_t +NYTP_write_time_line(handle, elapsed, fid, line) +NYTP_file handle +unsigned int elapsed +unsigned int fid +unsigned int line diff --git a/bin/nytprofmerge b/bin/nytprofmerge index 30a3429..5481894 100755 --- a/bin/nytprofmerge +++ b/bin/nytprofmerge @@ -69,11 +69,10 @@ sub _time_block_or_line { my $mapped_fid = $map_range{$fid}[$line]; $fid = $mapped_fid if defined $mapped_fid; - $out->write($is_line ? '+' : '*'); - $out->output_int($ticks, $fid, $line); - if (!$is_line) { - $out->output_int($block_line); - $out->output_int($sub_line); + if ($is_line) { + $out->write_time_line($ticks, $fid, $line); + } else { + $out->write_time_block($ticks, $fid, $line, $block_line, $sub_line); } } -- 1.6.0