comparison src/ov-mex-fcn.cc @ 12783:ad9263d965dc

First experimental profiler implementation with flat profile. * profiler.cc: New file. * profiler.h: New file. * Makefile.am: Include new files in build process. * oct-parse.yy (frob_function): Store location of function parsed. * ov-fcn.h (octave_function::profiler_name): New method. * ov-builtin.cc (octave_builtin::do_multi_index_op): Record timings in profiler. * ov-mex-fcn.cc (octave_mex_function::do_multi_index_op): Ditto. * ov-usr-fcn.cc (octave_user_script::do_multi_index_op): Ditto. (octave_user_function::do_multi_index_op): Ditto. (octave_user_function::octave_user_function): Initialize location_line/column. (octave_user_function::profiler_name): New method. * ov-usr-fcn.h (octave_user_function): New variables location_line, location column and new method stash_fcn_location to set them. * pt-fcn-handle.cc (tree_anon_fcn_handle::rvalue1): Store location.
author Daniel Kraft <d@domob.eu>
date Thu, 30 Jun 2011 20:04:34 +0200
parents fd0a3ac60b0e
children 5d18231eee00
comparison
equal deleted inserted replaced
12778:0ca5672d5f1a 12783:ad9263d965dc
31 #include "error.h" 31 #include "error.h"
32 #include "gripes.h" 32 #include "gripes.h"
33 #include "oct-obj.h" 33 #include "oct-obj.h"
34 #include "ov-mex-fcn.h" 34 #include "ov-mex-fcn.h"
35 #include "ov.h" 35 #include "ov.h"
36 #include "profiler.h"
36 #include "toplev.h" 37 #include "toplev.h"
37 #include "unwind-prot.h" 38 #include "unwind-prot.h"
38 39
39 DEFINE_OCTAVE_ALLOCATOR (octave_mex_function); 40 DEFINE_OCTAVE_ALLOCATOR (octave_mex_function);
40 41
145 146
146 frame.add_fcn (octave_call_stack::pop); 147 frame.add_fcn (octave_call_stack::pop);
147 148
148 try 149 try
149 { 150 {
151 profile_data_accumulator::enter pe (profiler, *this);
150 retval = call_mex (have_fmex, mex_fcn_ptr, args, nargout, this); 152 retval = call_mex (have_fmex, mex_fcn_ptr, args, nargout, this);
151 } 153 }
152 catch (octave_execution_exception) 154 catch (octave_execution_exception)
153 { 155 {
154 gripe_library_execution_error (); 156 gripe_library_execution_error ();