diff options
author | George Dunlap <george.dunlap@eu.citrix.com> | 2012-01-23 09:36:01 +0000 |
---|---|---|
committer | George Dunlap <george.dunlap@eu.citrix.com> | 2012-01-23 09:36:01 +0000 |
commit | fb55c1dd70c077075644a3d6a8d362e221659c23 (patch) | |
tree | 6a693739a086a6846faba88cd6a0e3cb3c838c8c /xen/arch/x86/oprofile | |
parent | 74c213c506afcd74a8556dd092995fd4dc38b225 (diff) | |
download | xen-fb55c1dd70c077075644a3d6a8d362e221659c23.tar.gz xen-fb55c1dd70c077075644a3d6a8d362e221659c23.tar.bz2 xen-fb55c1dd70c077075644a3d6a8d362e221659c23.zip |
xenoprof: Adjust indentation
Bring indentation into Xen hypervisor standard coding style.
No functional changes.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/oprofile')
-rw-r--r-- | xen/arch/x86/oprofile/backtrace.c | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/xen/arch/x86/oprofile/backtrace.c b/xen/arch/x86/oprofile/backtrace.c index ad0b6eb0aa..5d5f9df8cb 100644 --- a/xen/arch/x86/oprofile/backtrace.c +++ b/xen/arch/x86/oprofile/backtrace.c @@ -16,48 +16,48 @@ #include<asm/guest_access.h> struct frame_head { - struct frame_head * ebp; - unsigned long ret; + struct frame_head * ebp; + unsigned long ret; } __attribute__((packed)); static struct frame_head * dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu, struct frame_head * head, int mode) { - if (!xenoprof_add_trace(d, vcpu, head->ret, mode)) - return 0; - - /* frame pointers should strictly progress back up the stack - * (towards higher addresses) */ - if (head >= head->ebp) - return NULL; - - return head->ebp; + if (!xenoprof_add_trace(d, vcpu, head->ret, mode)) + return 0; + + /* frame pointers should strictly progress back up the stack + * (towards higher addresses) */ + if (head >= head->ebp) + return NULL; + + return head->ebp; } static struct frame_head * dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, struct frame_head * head, int mode) { - struct frame_head bufhead[2]; - XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char); + struct frame_head bufhead[2]; + XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char); - /* Also check accessibility of one struct frame_head beyond */ - if (!guest_handle_okay(guest_head, sizeof(bufhead))) - return 0; - if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, - sizeof(bufhead))) - return 0; - - if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode)) - return 0; - - /* frame pointers should strictly progress back up the stack - * (towards higher addresses) */ - if (head >= bufhead[0].ebp) - return NULL; - - return bufhead[0].ebp; + /* Also check accessibility of one struct frame_head beyond */ + if (!guest_handle_okay(guest_head, sizeof(bufhead))) + return 0; + if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, + sizeof(bufhead))) + return 0; + + if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode)) + return 0; + + /* frame pointers should strictly progress back up the stack + * (towards higher addresses) */ + if (head >= bufhead[0].ebp) + return NULL; + + return bufhead[0].ebp; } /* @@ -94,22 +94,22 @@ dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, static int valid_hypervisor_stack(struct frame_head * head, struct cpu_user_regs * regs) { - unsigned long headaddr = (unsigned long)head; + unsigned long headaddr = (unsigned long)head; #ifdef CONFIG_X86_64 - unsigned long stack = (unsigned long)regs->rsp; + unsigned long stack = (unsigned long)regs->rsp; #else - unsigned long stack = (unsigned long)regs; + unsigned long stack = (unsigned long)regs; #endif - unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE; + unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE; - return headaddr > stack && headaddr < stack_base; + return headaddr > stack && headaddr < stack_base; } #else /* without fp, it's just junk */ static int valid_hypervisor_stack(struct frame_head * head, struct cpu_user_regs * regs) { - return 0; + return 0; } #endif @@ -117,16 +117,16 @@ void xenoprof_backtrace(struct domain *d, struct vcpu *vcpu, struct cpu_user_regs * const regs, unsigned long depth, int mode) { - struct frame_head *head; + struct frame_head *head; - head = (struct frame_head *)regs->ebp; + head = (struct frame_head *)regs->ebp; - if (mode > 1) { - while (depth-- && valid_hypervisor_stack(head, regs)) - head = dump_hypervisor_backtrace(d, vcpu, head, mode); - return; - } + if (mode > 1) { + while (depth-- && valid_hypervisor_stack(head, regs)) + head = dump_hypervisor_backtrace(d, vcpu, head, mode); + return; + } - while (depth-- && head) - head = dump_guest_backtrace(d, vcpu, head, mode); + while (depth-- && head) + head = dump_guest_backtrace(d, vcpu, head, mode); } |