exporting patch: # HG changeset patch # User Daniel Kraft # Date 1313144876 -7200 # Node ID 8c64cc024e8cdb6ae01cfe09a33b519148246cc5 # Parent 43d78e103984a80288caf78c1c0019ba4a13c001 Make hierarchical profile available via profile('info'). profile.m: Make profile('info') return also hierarchical call-tree. diff -r 43d78e103984 -r 8c64cc024e8c scripts/general/profile.m --- a/scripts/general/profile.m Fri Aug 12 12:21:48 2011 +0200 +++ b/scripts/general/profile.m Fri Aug 12 12:27:56 2011 +0200 @@ -48,9 +48,13 @@ ## ## @item @var{T} = profile ('info') ## Return the collected profiling statistics in the structure @var{T}. -## Currently, the only field is @code{FunctionTable} which is an array -## of structures, each entry corresponding to a function which was called -## and for which profiling statistics are present. +## The flat profile is returned in the field @code{FunctionTable} which is an +## array of structures, each entry corresponding to a function which was called +## and for which profiling statistics are present. Furthermore, the field +## @code{Hierarchical} contains the hierarchical call-tree. Each node +## has an index into the @code{FunctionTable} identifying the function it +## corresponds to as well as data fields for number of calls and time spent +## at this level in the call-tree. ## @end table ## @end deftypefn @@ -87,8 +91,8 @@ retval = struct ('ProfilerStatus', enabled); case 'info' - data = __profiler_data__ (); - retval = struct ('FunctionTable', data); + [flat, tree] = __profiler_data__ (); + retval = struct ('FunctionTable', flat, 'Hierarchical', tree); otherwise warning ("profile: Unrecognized option '%s'", option);