2 * drivers/misc/tegra-profiler/backtrace.h
4 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 #ifndef __QUADD_BACKTRACE_H
18 #define __QUADD_BACKTRACE_H
21 #include <linux/bitops.h>
23 #define QUADD_MAX_STACK_DEPTH 64
25 #define QUADD_UNW_TYPES_SIZE \
26 DIV_ROUND_UP(QUADD_MAX_STACK_DEPTH * 4, sizeof(u32) * BITS_PER_BYTE)
28 struct quadd_callchain {
32 u32 ip_32[QUADD_MAX_STACK_DEPTH];
33 u64 ip_64[QUADD_MAX_STACK_DEPTH];
36 u32 types[QUADD_UNW_TYPES_SIZE];
40 unsigned int unw_method;
43 unsigned long curr_sp;
44 unsigned long curr_fp;
51 quadd_get_user_callchain(struct pt_regs *regs,
52 struct quadd_callchain *cc_data,
53 struct quadd_ctx *ctx,
54 struct task_struct *task);
57 quadd_callchain_store(struct quadd_callchain *cc,
58 unsigned long ip, unsigned int type);
61 quadd_user_stack_pointer(struct pt_regs *regs);
64 quadd_user_link_register(struct pt_regs *regs);
67 is_vma_addr(unsigned long addr, struct vm_area_struct *vma,
71 addr >= vma->vm_start &&
72 addr < vma->vm_end - nbytes;
76 #endif /* __QUADD_BACKTRACE_H */