Standardise debug variables

This makes all debug options stored in a single struct rather than in
various places, changes/fixes the behaviour of existing options, and
introduces some new options.

* Fixes damage issues with `-Drender-tree` texture (by removing scissor)
* Offsets the render tree overlay's `y` position for those who have
swaybar at the top
* Replaces `-Ddamage=rerender` with `-Dnodamage`
* Replaces `-Ddamage=highlight` with `-Dhighlight-damage`
* Replaces `-Dtxn-debug` with `-Dtxn-wait`
* Introduces `-Dnoatomic`
* Removes the `create_time` and `ms_arranging` figures from transactions
and the log message. Transactions are created after arranging and the
create time is of no significance.
* Fixes `-Dtxn-debug` (now `-Dtxn-wait`) not working.
This commit is contained in:
Ryan Dwyer 2018-08-18 16:58:50 +10:00
parent 389d159c81
commit 8d1dd03823
7 changed files with 64 additions and 78 deletions

View file

@ -235,14 +235,20 @@ static void drop_permissions(bool keep_caps) {
}
void enable_debug_flag(const char *flag) {
if (strcmp(flag, "render-tree") == 0) {
enable_debug_tree = true;
} else if (strncmp(flag, "damage=", 7) == 0) {
damage_debug = &flag[7];
} else if (strcmp(flag, "txn-debug") == 0) {
txn_debug = true;
if (strcmp(flag, "highlight-damage") == 0) {
debug.highlight_damage = true;
} else if (strcmp(flag, "noatomic") == 0) {
debug.noatomic = true;
} else if (strcmp(flag, "nodamage") == 0) {
debug.nodamage = true;
} else if (strcmp(flag, "render-tree") == 0) {
debug.render_tree = true;
} else if (strcmp(flag, "txn-wait") == 0) {
debug.txn_wait = true;
} else if (strcmp(flag, "txn-timings") == 0) {
debug.txn_timings = true;
} else if (strncmp(flag, "txn-timeout=", 12) == 0) {
txn_timeout_ms = atoi(&flag[12]);
server.txn_timeout_ms = atoi(&flag[12]);
}
}