* Increased the maximum profiling caller stack depth significantly.

* Extended the profiling API by an option to record a variable number of
  samples per tick. The stack depth is used as a maximum.
* Added new option "-f" to the "profile" tool. When specified it
  increments the hit counts of all symbols in the full available caller
  stack. I.e. the resulting hit counts will approximate the total time
  spent in each function or any function directly or indirectly called
  by it. Thus "_start" and "main" will usually get 100% and leaf
  functions only what time has actually been spent in them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27699 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-09-23 01:08:27 +00:00
parent 114c07e6e2
commit 0135e2e324
4 changed files with 150 additions and 38 deletions
+19 -12
View File
@@ -367,6 +367,9 @@ typedef struct {
area_id sample_area; // area into which the sample will be
// written
int32 stack_depth; // number of return address per hit
bool variable_stack_depth;
// variable number of samples per hit;
// cf. debug_profiler_update
} debug_nub_start_profiler;
typedef struct {
@@ -549,18 +552,22 @@ typedef struct {
typedef struct {
debug_origin origin;
int32 image_event; // number of the last image event;
// all samples were recorded after
// this event and before the next
// one
int32 stack_depth; // number of return addresses per
// tick
int32 sample_count; // number of samples in the buffer
int32 dropped_ticks; // number of ticks that had been
// dropped, since the buffer was
// full
bool stopped; // if true, the thread is no longer
// being profiled
int32 image_event; // number of the last image event; all
// samples were recorded after this
// event and before the next one
int32 stack_depth; // number of return addresses per tick
int32 sample_count; // number of samples in the buffer
int32 dropped_ticks; // number of ticks that had been
// dropped, since the buffer was full
bool variable_stack_depth;
// the number of samples per hit is
// variable, i.e. the format for the
// samples of a hit in the buffer is
// <n> <sample 1> ... <sample n>
// instead of
// <sample 1> ... <sample stack_depth>
bool stopped; // if true, the thread is no longer
// being profiled
} debug_profiler_update;
// B_DEBUGGER_MESSAGE_HANDED_OVER