diff options
author | Igor Nabirushkin <inabirushkin@nvidia.com> | 2015-02-26 18:49:41 +0400 |
---|---|---|
committer | Winnie Hsu <whsu@nvidia.com> | 2015-05-29 14:25:43 -0700 |
commit | e6066aadd6a395ded2bdb8c604ee7c861047a4a0 (patch) | |
tree | edcd5436fceadbce43d6d200a1f6f0f3fbe1bd6f | |
parent | af01aa37409408815278e81aacd9346beb0be1c0 (diff) |
misc: tegra-profiler: add unwind reason codes
Add unwind reason codes for dwarf unwinding.
Bug 1611073
Change-Id: Ic7f324f526ba34505e3b9bbedae7b98c29ce097d
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/711654
(cherry picked from commit ea2a41fa9056145e3f1cbe6f97c7725f51a08f3e)
Reviewed-on: http://git-master/r/747750
GVS: Gerrit_Virtual_Submit
Reviewed-by: Andrey Trachenko <atrachenko@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
-rw-r--r-- | drivers/misc/tegra-profiler/backtrace.c | 4 | ||||
-rw-r--r-- | drivers/misc/tegra-profiler/dwarf_unwind.c | 12 | ||||
-rw-r--r-- | drivers/misc/tegra-profiler/eh_unwind.c | 15 | ||||
-rw-r--r-- | drivers/misc/tegra-profiler/version.h | 2 | ||||
-rw-r--r-- | include/linux/tegra_profiler.h | 2 |
5 files changed, 16 insertions, 19 deletions
diff --git a/drivers/misc/tegra-profiler/backtrace.c b/drivers/misc/tegra-profiler/backtrace.c index a249bfd30f92..675ce85373f4 100644 --- a/drivers/misc/tegra-profiler/backtrace.c +++ b/drivers/misc/tegra-profiler/backtrace.c @@ -263,7 +263,7 @@ get_user_callchain_fp(struct pt_regs *regs, unsigned long lr = quadd_user_link_register(regs); nr_added = quadd_callchain_store(cc, lr, - QUADD_UNW_TYPE_LR_FP); + QUADD_UNW_TYPE_FP); if (nr_added == 0) return cc->nr; @@ -450,7 +450,7 @@ get_user_callchain_fp_compat(struct pt_regs *regs, u32 lr = quadd_user_link_register(regs); nr_added = quadd_callchain_store(cc, lr, - QUADD_UNW_TYPE_LR_FP); + QUADD_UNW_TYPE_FP); if (nr_added == 0) return cc->nr; diff --git a/drivers/misc/tegra-profiler/dwarf_unwind.c b/drivers/misc/tegra-profiler/dwarf_unwind.c index 72062e66a4ab..35409b13a644 100644 --- a/drivers/misc/tegra-profiler/dwarf_unwind.c +++ b/drivers/misc/tegra-profiler/dwarf_unwind.c @@ -1765,7 +1765,6 @@ static long unwind_frame(struct ex_region_info *ri, struct stackframe *sf, struct vm_area_struct *vma_sp, - unsigned int *unw_type, int is_eh) { int i; @@ -1905,7 +1904,7 @@ unwind_backtrace(struct quadd_callchain *cc, { unsigned long user_reg_size; struct ex_region_info ri_new; - unsigned int unw_type = QUADD_UNW_TYPE_UT; + unsigned int unw_type; int is_eh = 1, mode = sf->mode; cc->unw_rc = QUADD_URC_FAILURE; @@ -1963,13 +1962,12 @@ unwind_backtrace(struct quadd_callchain *cc, is_eh = 1; } - err = unwind_frame(ri, sf, vma_sp, &unw_type, is_eh); + err = unwind_frame(ri, sf, vma_sp, is_eh); if (err < 0) { if (__is_eh && __is_debug) { is_eh ^= 1; - err = unwind_frame(ri, sf, vma_sp, - &unw_type, is_eh); + err = unwind_frame(ri, sf, vma_sp, is_eh); if (err < 0) { cc->unw_rc = -err; break; @@ -1980,10 +1978,12 @@ unwind_backtrace(struct quadd_callchain *cc, } } + unw_type = is_eh ? QUADD_UNW_TYPE_DWARF_EH : + QUADD_UNW_TYPE_DWARF_DF; + pr_debug("[%s]: function at [<%08lx>] from [<%08lx>]\n", is_eh ? "eh" : "debug", where, sf->pc); - cc->curr_sp = sf->vregs[regnum_sp(mode)]; cc->curr_fp = sf->vregs[regnum_fp(mode)]; diff --git a/drivers/misc/tegra-profiler/eh_unwind.c b/drivers/misc/tegra-profiler/eh_unwind.c index e97ed5a3e062..d8edc82f7757 100644 --- a/drivers/misc/tegra-profiler/eh_unwind.c +++ b/drivers/misc/tegra-profiler/eh_unwind.c @@ -954,8 +954,7 @@ unwind_exec_insn(struct quadd_mmap_area *mmap, static long unwind_frame(struct ex_region_info *ri, struct stackframe *frame, - struct vm_area_struct *vma_sp, - unsigned int *unw_type) + struct vm_area_struct *vma_sp) { unsigned long high, low; const struct unwind_idx *idx; @@ -1037,12 +1036,8 @@ unwind_frame(struct ex_region_info *ri, return -QUADD_URC_SP_INCORRECT; } - if (ctrl.vrs[PC] == 0) { + if (ctrl.vrs[PC] == 0) ctrl.vrs[PC] = ctrl.vrs[LR]; - *unw_type = QUADD_UNW_TYPE_LR_UT; - } else { - *unw_type = QUADD_UNW_TYPE_UT; - } if (!validate_pc_addr(ctrl.vrs[PC], sizeof(u32))) return -QUADD_URC_PC_INCORRECT; @@ -1064,7 +1059,6 @@ unwind_backtrace(struct quadd_callchain *cc, struct vm_area_struct *vma_sp, struct task_struct *task) { - unsigned int unw_type; struct ex_region_info ri_new; cc->unw_rc = QUADD_URC_FAILURE; @@ -1108,7 +1102,7 @@ unwind_backtrace(struct quadd_callchain *cc, ri = &ri_new; } - err = unwind_frame(ri, frame, vma_sp, &unw_type); + err = unwind_frame(ri, frame, vma_sp); if (err < 0) { pr_debug("end unwind, urc: %ld\n", err); cc->unw_rc = -err; @@ -1123,7 +1117,8 @@ unwind_backtrace(struct quadd_callchain *cc, cc->curr_fp_thumb = frame->fp_thumb; cc->curr_pc = frame->pc; - nr_added = quadd_callchain_store(cc, frame->pc, unw_type); + nr_added = quadd_callchain_store(cc, frame->pc, + QUADD_UNW_TYPE_UT); if (nr_added == 0) break; } diff --git a/drivers/misc/tegra-profiler/version.h b/drivers/misc/tegra-profiler/version.h index 279861411474..15e5c14f5b07 100644 --- a/drivers/misc/tegra-profiler/version.h +++ b/drivers/misc/tegra-profiler/version.h @@ -18,7 +18,7 @@ #ifndef __QUADD_VERSION_H #define __QUADD_VERSION_H -#define QUADD_MODULE_VERSION "1.92" +#define QUADD_MODULE_VERSION "1.93" #define QUADD_MODULE_BRANCH "Dev" #endif /* __QUADD_VERSION_H */ diff --git a/include/linux/tegra_profiler.h b/include/linux/tegra_profiler.h index 1aa39a4ad4b4..f8042dcbe88e 100644 --- a/include/linux/tegra_profiler.h +++ b/include/linux/tegra_profiler.h @@ -210,6 +210,8 @@ enum { QUADD_UNW_TYPE_LR_FP, QUADD_UNW_TYPE_LR_UT, QUADD_UNW_TYPE_KCTX, + QUADD_UNW_TYPE_DWARF_EH, + QUADD_UNW_TYPE_DWARF_DF, }; struct quadd_sample_data { |