MINOR: debug: dump the whole trace if we can't spot the starting point

Instead of special-casing the use of the symbol resolving to decide
whether to dump a partial or complete trace, let's simply start over
and dump everything when we reach the end after having found nothing.
It will be more robust against dirty traces as well.
This commit is contained in:
Willy Tarreau 2020-03-04 07:39:32 +01:00
parent 899e5f69a1
commit a91b7946bd

View File

@ -108,14 +108,15 @@ void ha_thread_dump(struct buffer *buf, int thr, int calling_tid)
if (nptrs) if (nptrs)
chunk_appendf(buf, " call trace(%d):\n", nptrs); chunk_appendf(buf, " call trace(%d):\n", nptrs);
#ifndef USE_DL for (j = 0; j < nptrs || dump < 2; j++) {
/* if we can't rely on dladdr1() we won't figure what level is if (j == nptrs && !dump) {
* in ha_panic() or ha_thread_dump_all_to_trash(), so we want /* we failed to spot the starting point of the
* to immediately start the dump. * dump, let's start over dumping everything we
*/ * have.
dump = 2; */
#endif dump = 2;
for (j = 0; j < nptrs; j++) { j = 0;
}
bak = *buf; bak = *buf;
dump_addr_and_bytes(buf, " | ", callers[j], 8); dump_addr_and_bytes(buf, " | ", callers[j], 8);
addr = resolve_sym_name(buf, ": ", callers[j]); addr = resolve_sym_name(buf, ": ", callers[j]);