summaryrefslogtreecommitdiff
path: root/lib/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/log.c')
-rw-r--r--lib/log.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/log.c b/lib/log.c
index 03ed23a04b..b86d3022b4 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -161,8 +161,9 @@ void zlog_signal(int signo, const char *action, void *siginfo_v,
if (!tc)
bprintfrr(&fb, "no thread information available\n");
else
- bprintfrr(&fb, "in thread %s scheduled from %s:%d\n",
- tc->funcname, tc->schedfrom, tc->schedfrom_line);
+ bprintfrr(&fb, "in thread %s scheduled from %s:%d %s()\n",
+ tc->xref->funcname, tc->xref->xref.file,
+ tc->xref->xref.line, tc->xref->xref.func);
zlog_sigsafe(fb.buf, fb.pos - fb.buf);
}
@@ -179,6 +180,9 @@ void zlog_backtrace_sigsafe(int priority, void *program_counter)
unw_word_t ip, off, sp;
Dl_info dlinfo;
+ memset(&uc, 0, sizeof(uc));
+ memset(&cursor, 0, sizeof(cursor));
+
unw_getcontext(&uc);
unw_init_local(&cursor, &uc);
while (unw_step(&cursor) > 0) {
@@ -300,8 +304,9 @@ void zlog_thread_info(int log_level)
if (tc)
zlog(log_level,
- "Current thread function %s, scheduled from file %s, line %u",
- tc->funcname, tc->schedfrom, tc->schedfrom_line);
+ "Current thread function %s, scheduled from file %s, line %u in %s()",
+ tc->xref->funcname, tc->xref->xref.file,
+ tc->xref->xref.line, tc->xref->xref.func);
else
zlog(log_level, "Current thread not known/applicable");
}