24 #if defined (HAVE_CONFIG_H)
37 : time (0.0), calls (0), recursive (
false),
38 parents (), children ()
48 for (function_set::const_iterator
p = list.begin ();
p != list.end (); ++
p)
59 : parent (p), fcn_id (f), children (), time (0.0), calls (0)
64 for (child_map::iterator
i = children.begin ();
i != children.end (); ++
i)
73 child_map::iterator pos = children.find (fcn);
74 if (pos == children.end ())
103 stats& entry = data[fcn_id - 1];
106 entry.
calls += calls;
109 if (parent->fcn_id != 0)
111 entry.
parents.insert (parent->fcn_id);
112 data[parent->fcn_id - 1].children.insert (fcn_id);
117 if (
i->fcn_id == fcn_id)
125 for (child_map::const_iterator
i = children.begin ();
126 i != children.end (); ++
i)
127 i->second->build_flat (data);
140 Cell rv_indices (n, 1);
141 Cell rv_times (n, 1);
142 Cell rv_totals (n, 1);
143 Cell rv_calls (n, 1);
144 Cell rv_children (n, 1);
147 for (child_map::const_iterator
p = children.begin ();
148 p != children.end (); ++
p)
151 double child_total = entry.
time;
160 *total += child_total;
168 retval.
assign (
"Index", rv_indices);
169 retval.
assign (
"SelfTime", rv_times);
170 retval.
assign (
"TotalTime", rv_totals);
171 retval.
assign (
"NumCalls", rv_calls);
172 retval.
assign (
"Children", rv_children);
208 fcn_index_map::iterator pos =
fcn_index.find (fcn);
216 fcn_idx = pos->second;
243 fcn_index_map::iterator pos =
fcn_index.find (fcn);
259 error (
"Can't reset active profiler.");
287 Cell rv_names (n, 1);
288 Cell rv_times (n, 1);
289 Cell rv_calls (n, 1);
290 Cell rv_recursive (n, 1);
291 Cell rv_parents (n, 1);
292 Cell rv_children (n, 1);
306 m.
assign (
"FunctionName", rv_names);
307 m.
assign (
"TotalTime", rv_times);
308 m.
assign (
"NumCalls", rv_calls);
309 m.
assign (
"IsRecursive", rv_recursive);
310 m.
assign (
"Parents", rv_parents);
311 m.
assign (
"Children", rv_children);
317 static const char *fn[] =
345 static const char *fn[] =
412 if (
args.length () > 0)
413 warning (
"profiler_reset: ignoring extra arguments");
427 if (
args.length () > 0)
428 warning (
"profiler_data: ignoring extra arguments");
The value of lines which begin with a space character are not saved in the history list A value of all commands are saved on the history list
void assign(const std::string &k, const Cell &val)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
OCTINTERP_API void print_usage(void)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
function_set known_functions
octave_value get_hierarchical(void) const
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
tree_node * enter(octave_idx_type)
tree_node(tree_node *, octave_idx_type)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
tree_node * exit(octave_idx_type)
void add_current_time(void)
void build_flat(flat_profile &) const
bool is_active(void) const
double double_value(void) const
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
std::vector< stats > flat_profile
nd deftypefn *octave_map m
const T * data(void) const
octave_value get_flat(void) const
void exit_function(const std::string &)
std::set< octave_idx_type > function_set
profile_data_accumulator(void)
double query_time() const
void warning(const char *fmt,...)
virtual ~profile_data_accumulator()
static octave_value function_set_value(const function_set &)
=val(i)}if ode{val(i)}occurs in table i
void enter_function(const std::string &)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol zero divided by nd tex zero divided by nd ifnottex and any operation involving another NaN value(5+NaN).Note that NaN always compares not equal to NaN(NaN!
octave_value get_hierarchical(double *total=0) const
Vector representing the dimensions (size) of an Array.
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
profile_data_accumulator profiler