Unverified Commit e2c222b5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents e2d8499b 24ea9d0c
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -27,25 +27,7 @@

unsigned long profile_pc(struct pt_regs *regs)
{
	unsigned long pc = instruction_pointer(regs);

	if (!user_mode(regs) && in_lock_functions(pc)) {
#ifdef CONFIG_FRAME_POINTER
		return *(unsigned long *)(regs->bp + sizeof(long));
#else
		unsigned long *sp = (unsigned long *)regs->sp;
		/*
		 * Return address is either directly at stack pointer
		 * or above a saved flags. Eflags has bits 22-31 zero,
		 * kernel addresses don't.
		 */
		if (sp[0] >> 22)
			return sp[0];
		if (sp[1] >> 22)
			return sp[1];
#endif
	}
	return pc;
	return instruction_pointer(regs);
}
EXPORT_SYMBOL(profile_pc);