Incorrect profiling of recursive functions using --with-profiling
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=5131
Reported by Jonas Wallden jonasw@roxen.com
Note the bogus 950 seconds reported for fn() and its children. The 191 msec for the function itself is correct though.
Pike v7.8 release 371 running Hilfe v3.5 (Incremental Pike Frontend)
> class C { void fn(int x, int limit) { if (x < limit) fn(x + 1, limit); } };
> object c = C();
> gauge { c->fn(0, 10000); };
(1) Result: 0.191259
> get_profiling_info(C);
(2) Result: ({ /* 2 elements */
1,
([ /* 1 element */
"fn": ({ /* 3 elements */
10001,
950974,
191
})
])
})