MINOR: threads/cli: display the lock history on "show threads"
This will display the lock labels and modes for each non-empty step at the end of "show threads" when these are defined. This allows to emit up to the last 8 locking operation for each thread on 64 bit machines.
This commit is contained in:
parent
b8a1c2380b
commit
d9a659ed96
@ -49,6 +49,7 @@ int thread_map_to_groups();
|
|||||||
int thread_resolve_group_mask(struct thread_set *ts, int defgrp, char **err);
|
int thread_resolve_group_mask(struct thread_set *ts, int defgrp, char **err);
|
||||||
void thread_detect_count(void);
|
void thread_detect_count(void);
|
||||||
int parse_thread_set(const char *arg, struct thread_set *ts, char **err);
|
int parse_thread_set(const char *arg, struct thread_set *ts, char **err);
|
||||||
|
const char *lock_label(enum lock_label label);
|
||||||
extern int thread_cpus_enabled_at_boot;
|
extern int thread_cpus_enabled_at_boot;
|
||||||
|
|
||||||
|
|
||||||
|
17
src/debug.c
17
src/debug.c
@ -352,6 +352,23 @@ void ha_thread_dump_one(struct buffer *buf, int is_caller)
|
|||||||
chunk_appendf(buf, " curr_task=");
|
chunk_appendf(buf, " curr_task=");
|
||||||
ha_task_dump(buf, th_ctx->current, " ");
|
ha_task_dump(buf, th_ctx->current, " ");
|
||||||
|
|
||||||
|
#if defined(USE_THREAD) && ((DEBUG_THREAD > 0) || defined(DEBUG_FULL))
|
||||||
|
/* List the lock history */
|
||||||
|
if (th_ctx->lock_history) {
|
||||||
|
int lkh, lkl;
|
||||||
|
|
||||||
|
chunk_appendf(buf, " lock_hist:");
|
||||||
|
for (lkl = 7; lkl >= 0; lkl--) {
|
||||||
|
lkh = (th_ctx->lock_history >> (lkl * 8)) & 0xff;
|
||||||
|
if (!lkh)
|
||||||
|
continue;
|
||||||
|
chunk_appendf(buf, " %c:%s",
|
||||||
|
"URSW"[lkh & 3], lock_label((lkh >> 2) - 1));
|
||||||
|
}
|
||||||
|
chunk_appendf(buf, "\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!(HA_ATOMIC_LOAD(&tg_ctx->threads_idle) & ti->ltid_bit)) {
|
if (!(HA_ATOMIC_LOAD(&tg_ctx->threads_idle) & ti->ltid_bit)) {
|
||||||
/* only dump the stack of active threads */
|
/* only dump the stack of active threads */
|
||||||
#ifdef USE_LUA
|
#ifdef USE_LUA
|
||||||
|
Loading…
x
Reference in New Issue
Block a user