|
From: Peter O. <obe...@us...> - 2013-01-25 11:46:31
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1108 Modified Files: genhtml Log Message: genhtml: improve function table sorting In the function table view, the initial view should show the functions sorted by execution count because - unlike with file names - the function name is not a natural order for functions (the line number would be, but that is not available). Also sort functions with the same execution count alphabetically for a stable order. Base on a suggestion by pau...@ho.... Index: genhtml =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/genhtml,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** genhtml 23 Jan 2013 16:52:06 -0000 1.71 --- genhtml 25 Jan 2013 11:46:28 -0000 1.72 *************** *** 4434,4438 **** $view .= "<span style=\"font-size: 80%;\">"; if ($type == $HDR_SOURCE) { ! $view .= " (source / <a href=\"$base_name.func.$html_ext\">functions</a>)"; } elsif ($type == $HDR_FUNC) { $view .= " (<a href=\"$base_name.gcov.$html_ext\">source</a> / functions)"; --- 4434,4442 ---- $view .= "<span style=\"font-size: 80%;\">"; if ($type == $HDR_SOURCE) { ! if ($sort) { ! $view .= " (source / <a href=\"$base_name.func-sort-c.$html_ext\">functions</a>)"; ! } else { ! $view .= " (source / <a href=\"$base_name.func.$html_ext\">functions</a>)"; ! } } elsif ($type == $HDR_FUNC) { $view .= " (<a href=\"$base_name.gcov.$html_ext\">source</a> / functions)"; *************** *** 5297,5302 **** return sort(keys(%{$funcdata})); } ! return sort({$sumfncdata->{$b} <=> $sumfncdata->{$a}} ! keys(%{$sumfncdata})); } --- 5301,5308 ---- return sort(keys(%{$funcdata})); } ! return sort({ ! $sumfncdata->{$b} == $sumfncdata->{$a} ? ! $a cmp $b : $sumfncdata->{$a} <=> $sumfncdata->{$b} ! } keys(%{$sumfncdata})); } |