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

Commit 820ebeb2 authored by Se Wang (Patrick) Oh's avatar Se Wang (Patrick) Oh
Browse files

arm64: mm: Log the process id in the rtb



Store the process id in the register trace buffer.
This gives a general idea about what process was last
running when the RTB stopped.

Change-Id: Idcbd8db9eb451f2d732c935f00b6c50f9af3c592
Signed-off-by: default avatarSe Wang (Patrick) Oh <sewango@codeaurora.org>
parent c952020e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <asm-generic/mm_hooks.h>
#include <asm/cputype.h>
#include <asm/pgtable.h>
#include <linux/msm_rtb.h>

#define MAX_ASID_BITS	16

@@ -38,15 +39,19 @@ void __new_context(struct mm_struct *mm);
#ifdef CONFIG_PID_IN_CONTEXTIDR
static inline void contextidr_thread_switch(struct task_struct *next)
{
	pid_t pid = task_pid_nr(next);
	asm(
	"	msr	contextidr_el1, %0\n"
	"	isb"
	:
	: "r" (task_pid_nr(next)));
	: "r" (pid));
	uncached_logk(LOGK_CTXID, (void *)(u64)pid);

}
#else
static inline void contextidr_thread_switch(struct task_struct *next)
{
	uncached_logk(LOGK_CTXID, (void *)(u64)task_pid_nr(next));
}
#endif