* Introduced a per-team counter that is incremented whenever an image

is created or deleted (or exec*() has been invoked). The counter is
  sent with several debugger messages.
* Track the image event counter that is used when samples are added to
  the profiling buffer. If the current team counter differs, we flush
  the buffer first (sending an update message to the debugger), so that
  the debugger has a chance to match the addresses to the correct images.
* Disable profiling for a thread while it runs in the debugger support
  code. This fixes potential deadlocks which could occur when a
  profiling timer event occurred that would require the buffer to be
  flushed while the thread was just sending something to the debugger or
  waiting for a command. As it turns out, this is not sufficient either,
  since we should never try to flush the buffer when the timer event
  occurred in the kernel, since the thread might hold a lock that the
  debugger thread could try to acquire. Will implement a more general
  solution later.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27656 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-09-20 20:37:10 +00:00
parent 18fe1bf6fb
commit eba9a4c3ee
3 changed files with 170 additions and 44 deletions
+8 -8
View File
@@ -371,9 +371,7 @@ typedef struct {
typedef struct {
status_t error;
int32 profile_event; // number of the last event influencing
// profiling (e.g. image
// created/deleted)
int32 image_event; // number of the last image event
bigtime_t interval; // actual sample interval (might
// differ from the requested one)
} debug_nub_start_profiler_reply;
@@ -515,6 +513,7 @@ typedef struct {
typedef struct {
debug_origin origin;
int32 image_event; // number of the image event
} debug_team_exec;
// B_DEBUGGER_MESSAGE_THREAD_CREATED
@@ -535,6 +534,7 @@ typedef struct {
typedef struct {
debug_origin origin;
image_info info; // info for the image
int32 image_event; // number of the image event
} debug_image_created;
// B_DEBUGGER_MESSAGE_IMAGE_DELETED
@@ -542,17 +542,17 @@ typedef struct {
typedef struct {
debug_origin origin;
image_info info; // info for the image
int32 image_event; // number of the image event
} debug_image_deleted;
// B_DEBUGGER_MESSAGE_PROFILER_UPDATE
typedef struct {
debug_origin origin;
int32 profile_event; // number of the last event
// influencing profiling (e.g.
// image created/deleted); all
// samples were recorded after this
// event and before the next one
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