Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MINOR: debug: add "debug dev counters" to list code counters
Issuing "debug dev counters" on the CLI will now scan all existing counters, and report their count, type, location, function name, the condition and an optional comment passed to the macro. The command takes a number of arguments: - "show": this is the default, it will just list the counters - "reset": will reset the matching counters instead of listing them - "all": by default, only non-zero counters are listed. With "all", they are all listed - "bug": restrict the reset or dump to counters of type "BUG" (BUG_ON usually) - "chk": restrict the reset or dump to counters of type "CHK" (CHECK_IF) - "cnt": restrict the reset or dump to counters of type "CNT" (COUNT_IF) The types may be cumulated, and the option entered in any order. Here's an example of the output of "debug dev counters show all bug": Count Type Location function(): "condition" [comment] 0 BUG ring.h:114 ring_dup(): "max > ring_size(dst)" 0 BUG vecpair.h:223 vp_getblk_ofs(): "ofs >= v1->len + v2->len" 0 BUG buf.h:395 b_add(): "b->data + count > b->size" 0 BUG buf.h:106 b_room(): "b->data > b->size" 0 BUG task.h:328 _task_queue(): "(ulong)caller & 1" 0 BUG task.h:324 _task_queue(): "task->tid != tid" 0 BUG task.h:313 _task_queue(): "(ulong)caller & 1" (...) This is expected to be convenient combined with the use and abuse of COUNT_IF() at select locations.
- Loading branch information