Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ac65abd authored by Chris Metcalf's avatar Chris Metcalf
Browse files

tile: include the syscall number in the backtrace



This information is easily available in the backtrace data and can
be helpful when trying to figure out the backtrace, particularly
if we're early in kernel entry or late in kernel exit.

Signed-off-by: default avatarChris Metcalf <cmetcalf@ezchip.com>
parent 7fa129cc
Loading
Loading
Loading
Loading
+8 −9
Original line number Original line Diff line number Diff line
@@ -78,8 +78,7 @@ static bool read_memory_func(void *result, unsigned long address,
/* Return a pt_regs pointer for a valid fault handler frame */
/* Return a pt_regs pointer for a valid fault handler frame */
static struct pt_regs *valid_fault_handler(struct KBacktraceIterator* kbt)
static struct pt_regs *valid_fault_handler(struct KBacktraceIterator* kbt)
{
{
	const char *fault = NULL;  /* happy compiler */
	char fault[64];
	char fault_buf[64];
	unsigned long sp = kbt->it.sp;
	unsigned long sp = kbt->it.sp;
	struct pt_regs *p;
	struct pt_regs *p;


@@ -90,14 +89,14 @@ static struct pt_regs *valid_fault_handler(struct KBacktraceIterator* kbt)
	if (!in_kernel_stack(kbt, sp + C_ABI_SAVE_AREA_SIZE + PTREGS_SIZE-1))
	if (!in_kernel_stack(kbt, sp + C_ABI_SAVE_AREA_SIZE + PTREGS_SIZE-1))
		return NULL;
		return NULL;
	p = (struct pt_regs *)(sp + C_ABI_SAVE_AREA_SIZE);
	p = (struct pt_regs *)(sp + C_ABI_SAVE_AREA_SIZE);
	if (p->faultnum == INT_SWINT_1 || p->faultnum == INT_SWINT_1_SIGRETURN)
		fault = "syscall";
	else {
	if (kbt->verbose) {     /* else we aren't going to use it */
	if (kbt->verbose) {     /* else we aren't going to use it */
			snprintf(fault_buf, sizeof(fault_buf),
		if (p->faultnum == INT_SWINT_1 ||
		    p->faultnum == INT_SWINT_1_SIGRETURN)
			snprintf(fault, sizeof(fault),
				 "syscall %ld", p->regs[TREG_SYSCALL_NR]);
		else
			snprintf(fault, sizeof(fault),
				 "interrupt %ld", p->faultnum);
				 "interrupt %ld", p->faultnum);
			fault = fault_buf;
		}
	}
	}
	if (EX1_PL(p->ex1) == KERNEL_PL &&
	if (EX1_PL(p->ex1) == KERNEL_PL &&
	    __kernel_text_address(p->pc) &&
	    __kernel_text_address(p->pc) &&