exporting patch: # HG changeset patch # User Daniel Kraft # Date 1313764749 -7200 # Node ID 9db4e9b352d6a3e158f26503723def0ff907e77d # Parent 2e20c26b10075fe6521d5884a9fe27e01e6f1f91 Add index into FunctionTable to profshow output table. profshow.m: Also print the index into FunctionTable for each line. diff -r 2e20c26b1007 -r 9db4e9b352d6 scripts/general/profshow.m --- a/scripts/general/profshow.m Thu Aug 18 18:43:58 2011 +0200 +++ b/scripts/general/profshow.m Fri Aug 19 16:39:09 2011 +0200 @@ -63,18 +63,19 @@ for i = 1 : n nameLen = max (nameLen, length (data.FunctionTable(p(i)).FunctionName)); endfor - headerFormat = sprintf ("%%%ds %%4s %%12s %%12s\n", nameLen); - rowFormat = sprintf ("%%%ds %%4s %%12.3f %%12d\n", nameLen); + headerFormat = sprintf ("%%4s %%%ds %%4s %%12s %%12s\n", nameLen); + rowFormat = sprintf ("%%4d %%%ds %%4s %%12.3f %%12d\n", nameLen); - printf (headerFormat, "Function", "Attr", "Time (s)", "Calls"); - printf ("%s\n", repmat ("-", 1, nameLen + 2 * 13 + 5)); + printf (headerFormat, "#", "Function", "Attr", "Time (s)", "Calls"); + printf ("%s\n", repmat ("-", 1, nameLen + 2 * 5 + 2 * 13)); for i = 1 : n row = data.FunctionTable(p(i)); attr = ""; if (row.IsRecursive) attr = "R"; endif - printf (rowFormat, row.FunctionName, attr, row.TotalTime, row.NumCalls); + printf (rowFormat, p(i), row.FunctionName, attr, ... + row.TotalTime, row.NumCalls); endfor endfunction