kernel: Print the first 4 chars of cvar names in KDL "threads" command.

Condition variables are now a pretty common way the kernel blocks threads.
That means the "threads" command was getting difficult to navigate, since
at any given time, a lot of threads could be blocked on "cvar".

Now we try (carefully, because it could fault!) to fetch the first 4
characters of the "type" name and display then. This suffices to
distinguish the most common object block types in the list at a glance
(e.g. "cvar:port" for port reads, the most common.)

Change-Id: I94f4b59fd78b7ebdce913944551a5e98f0ca2e33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6605
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2023-06-13 19:41:07 +00:00
committed by waddlesplash
parent f0e9ed4488
commit 6554d7448d
3 changed files with 70 additions and 42 deletions
@@ -97,6 +97,8 @@ protected:
friend struct ConditionVariableEntry;
friend struct ConditionVariableHashDefinition;
friend ssize_t debug_condition_variable_type_strlcpy(ConditionVariable* cvar,
char* name, size_t size);
};