mirror of
https://github.com/sstefani/mtrace.git
synced 2025-12-11 22:19:52 +08:00
show breakpoint statistics in mode -vv
This commit is contained in:
parent
dec3daabba
commit
bd6aadcb7f
@ -260,6 +260,9 @@ static void process_event(struct task *task, int status)
|
||||
if (bp) {
|
||||
assert(bp->type != SW_BP);
|
||||
assert(bp->hw_bp_slot == i);
|
||||
|
||||
if (options.verbose > 1)
|
||||
++leader->num_hw_bp;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@ -269,6 +272,9 @@ static void process_event(struct task *task, int status)
|
||||
return;
|
||||
assert(bp->type == SW_BP);
|
||||
|
||||
if (options.verbose > 1)
|
||||
++leader->num_sw_bp;
|
||||
|
||||
set_instruction_pointer(task, bp->addr);
|
||||
}
|
||||
#if 1
|
||||
|
||||
3
task.h
3
task.h
@ -81,6 +81,9 @@ struct task {
|
||||
/* set in leader: number of stopped threads including the leader */
|
||||
unsigned int threads_stopped;
|
||||
|
||||
unsigned long num_hw_bp;
|
||||
unsigned long num_sw_bp;
|
||||
|
||||
/* set in leader: dictionary of breakpoints */
|
||||
struct dict *breakpoints;
|
||||
|
||||
|
||||
4
trace.c
4
trace.c
@ -94,6 +94,10 @@ void detach_proc(struct task *leader)
|
||||
assert(leader->leader == leader);
|
||||
|
||||
breakpoint_disable_all(leader);
|
||||
|
||||
if (options.verbose > 1)
|
||||
fprintf(stderr, "+++ process detach pid=%d sw-bp:%lu hw-bp:%lu +++\n", leader->pid, leader->num_sw_bp, leader->num_hw_bp);
|
||||
|
||||
each_task(leader, &detach_cb, NULL);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user