/* Get the return address for a single stackframe and return a pointer to the next frame tail.  */
static struct frame_tail* user_backtrace(struct frame_tail *tail, struct perf_callchain_entry *entry)
/* Get the return address for a single stackframe and return a pointer to the next frame tail.  */
static struct frame_tail* user_backtrace(struct frame_tail *tail, struct perf_callchain_entry *entry)
{
	struct frame_tail buftail;
	if (!access_ok(VERIFY_READ, tail, sizeof(buftail)))
		return NULL;
	if (__copy_from_user_inatomic(&buftail, tail, sizeof(buftail)))
		return NULL;
	callchain_store(entry, buftail.lr);
	if (tail >= buftail.fp)
		return NULL;
	return buftail.fp - 1;
}