diff options
author | hunt <hunt> | 2006-10-12 18:19:18 +0000 |
---|---|---|
committer | hunt <hunt> | 2006-10-12 18:19:18 +0000 |
commit | fabf5ed4db3cce35725023ebc424ffe28a7dd74a (patch) | |
tree | ba5eb2e481c668c502df62fa078ebecae5e3a596 /runtime/stack-ia64.c | |
parent | 40cfa2bce2cf09160da6b767603e11a2cfac3a3e (diff) | |
download | systemtap-steved-fabf5ed4db3cce35725023ebc424ffe28a7dd74a.tar.gz systemtap-steved-fabf5ed4db3cce35725023ebc424ffe28a7dd74a.tar.xz systemtap-steved-fabf5ed4db3cce35725023ebc424ffe28a7dd74a.zip |
2006-10-12 Martin Hunt <hunt@redhat.com>
* stack.c: Reorganize and split arch-specific functions to
separate files.
(_stp_kta): Better checking.
(_stp_stack_sprint): Better handling of return probes.
* stack-i386.c: New file. Uses 2.6.18 DWARF unwinder if available.
* stack-x86_64.c: New file. Uses 2.6.18 DWARF unwinder if available.
* stack-ppc64.c: New file.
* stack-ia64.c: New file.
* sym.c (_stp_kallsyms_lookup_name): New function. Like
kallsyms_lookup_name() except use our internal lookup table.
Diffstat (limited to 'runtime/stack-ia64.c')
-rw-r--r-- | runtime/stack-ia64.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/runtime/stack-ia64.c b/runtime/stack-ia64.c new file mode 100644 index 00000000..f941869e --- /dev/null +++ b/runtime/stack-ia64.c @@ -0,0 +1,65 @@ +/* -*- linux-c -*- + * ia64 stack tracing functions + * Copyright (C) 2005 Intel Corporation. + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + */ + +struct dump_para{ + unsigned long *sp; + String str; +}; + +static void __stp_show_stack_sym(struct unw_frame_info *info, void *arg) +{ + unsigned long ip, skip=1; + String str = ((struct dump_para*)arg)->str; + struct pt_regs *regs = container_of(((struct dump_para*)arg)->sp, struct pt_regs, r12); + + do { + unw_get_ip(info, &ip); + if (ip == 0) break; + if (skip){ + if (ip == REG_IP(regs)) + skip = 0; + else continue; + } + _stp_string_cat(str, " "); + _stp_symbol_sprint(str, ip); + _stp_string_cat (str, "\n"); + } while (unw_unwind(info) >= 0); +} + +static void __stp_show_stack_addr(struct unw_frame_info *info, void *arg) +{ + unsigned long ip, skip=1; + String str = ((struct dump_para*)arg)->str; + struct pt_regs *regs = container_of(((struct dump_para*)arg)->sp, struct pt_regs, r12); + + do { + unw_get_ip(info, &ip); + if (ip == 0) break; + if (skip){ + if (ip == REG_IP(regs)) + skip = 0; + continue; + } + _stp_sprintf (str, "%lx ", ip); + } while (unw_unwind(info) >= 0); +} + +static void __stp_stack_sprint (String str, struct pt_regs *regs, int verbose, int levels) +{ + unsigned long *stack = (unsigned long *)®_SP(regs); + struct dump_para para; + + para.str = str; + para.sp = stack; + if (verbose) + unw_init_running(__stp_show_stack_sym, ¶); + else + unw_init_running(__stp_show_stack_addr, ¶); +} |