* 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:
@@ -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
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// limits
|
||||
#define B_DEBUG_MIN_PROFILE_INTERVAL 10 /* in us */
|
||||
#define B_DEBUG_STACK_TRACE_DEPTH 20
|
||||
#define B_DEBUG_STACK_TRACE_DEPTH 128
|
||||
#define B_DEBUG_PROFILE_BUFFER_FLUSH_THRESHOLD 70 /* in % */
|
||||
|
||||
|
||||
@@ -96,6 +96,8 @@ struct thread_debug_info {
|
||||
int32 image_event;
|
||||
// number of the image event when the first sample was written into
|
||||
// the buffer
|
||||
bool variable_stack_depth;
|
||||
// record a variable number of samples per hit
|
||||
bool buffer_full;
|
||||
// indicates that the sample buffer is full
|
||||
union {
|
||||
|
||||
Reference in New Issue
Block a user