aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/oprofile
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-03-08 17:02:57 +0100
committerJan Beulich <jbeulich@suse.com>2012-03-08 17:02:57 +0100
commitcae10a689a5ee104a24dc01131e1d71d4060cc70 (patch)
tree74c22cad4cd0d7263a4b99cb57e258491c5d6521 /xen/arch/x86/oprofile
parent48844dc21098fa59f1cac06eba31b548f576a446 (diff)
downloadxen-cae10a689a5ee104a24dc01131e1d71d4060cc70.tar.gz
xen-cae10a689a5ee104a24dc01131e1d71d4060cc70.tar.bz2
xen-cae10a689a5ee104a24dc01131e1d71d4060cc70.zip
oprofile: don't pass around redundant, easily derived arguments
Passing both a struct vcpu pointer and the corresponding struct domain one is simply pointless, especially when intermediate functions just forward it without themselves making use of the already obtained value. Also constify a few function parameters. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/oprofile')
-rw-r--r--xen/arch/x86/oprofile/backtrace.c31
-rw-r--r--xen/arch/x86/oprofile/xenoprof.c4
2 files changed, 17 insertions, 18 deletions
diff --git a/xen/arch/x86/oprofile/backtrace.c b/xen/arch/x86/oprofile/backtrace.c
index dcb38230f6..33fd14274f 100644
--- a/xen/arch/x86/oprofile/backtrace.c
+++ b/xen/arch/x86/oprofile/backtrace.c
@@ -32,10 +32,10 @@ DEFINE_COMPAT_HANDLE(frame_head32_t);
#endif
static struct frame_head *
-dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu,
- struct frame_head * head, int mode)
+dump_hypervisor_backtrace(struct vcpu *vcpu, const struct frame_head *head,
+ int mode)
{
- if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
+ if (!xenoprof_add_trace(vcpu, head->ret, mode))
return 0;
/* frame pointers should strictly progress back up the stack
@@ -57,8 +57,8 @@ static inline int is_32bit_vcpu(struct vcpu *vcpu)
#endif
static struct frame_head *
-dump_guest_backtrace(struct domain *d, struct vcpu *vcpu,
- const struct frame_head *head, int mode)
+dump_guest_backtrace(struct vcpu *vcpu, const struct frame_head *head,
+ int mode)
{
frame_head_t bufhead;
@@ -90,7 +90,7 @@ dump_guest_backtrace(struct domain *d, struct vcpu *vcpu,
return 0;
}
- if (!xenoprof_add_trace(d, vcpu, bufhead.ret, mode))
+ if (!xenoprof_add_trace(vcpu, bufhead.ret, mode))
return 0;
/* frame pointers should strictly progress back up the stack
@@ -132,8 +132,8 @@ dump_guest_backtrace(struct domain *d, struct vcpu *vcpu,
* in the kernel mode.
*/
#if defined(CONFIG_FRAME_POINTER)
-static int valid_hypervisor_stack(struct frame_head * head,
- struct cpu_user_regs * regs)
+static int valid_hypervisor_stack(const struct frame_head *head,
+ const struct cpu_user_regs *regs)
{
unsigned long headaddr = (unsigned long)head;
#ifdef CONFIG_X86_64
@@ -147,27 +147,24 @@ static int valid_hypervisor_stack(struct frame_head * head,
}
#else
/* without fp, it's just junk */
-static int valid_hypervisor_stack(struct frame_head * head,
- struct cpu_user_regs * regs)
+static int valid_hypervisor_stack(const struct frame_head *head,
+ const struct cpu_user_regs *regs)
{
return 0;
}
#endif
-void xenoprof_backtrace(struct domain *d, struct vcpu *vcpu,
- struct cpu_user_regs * const regs,
+void xenoprof_backtrace(struct vcpu *vcpu, const struct cpu_user_regs *regs,
unsigned long depth, int mode)
{
- struct frame_head *head;
-
- head = (struct frame_head *)regs->ebp;
+ const struct frame_head *head = (void *)regs->ebp;
if (mode > 1) {
while (depth-- && valid_hypervisor_stack(head, regs))
- head = dump_hypervisor_backtrace(d, vcpu, head, mode);
+ head = dump_hypervisor_backtrace(vcpu, head, mode);
return;
}
while (depth-- && head)
- head = dump_guest_backtrace(d, vcpu, head, mode);
+ head = dump_guest_backtrace(vcpu, head, mode);
}
diff --git a/xen/arch/x86/oprofile/xenoprof.c b/xen/arch/x86/oprofile/xenoprof.c
index 0c1c7ab031..71f00ef7da 100644
--- a/xen/arch/x86/oprofile/xenoprof.c
+++ b/xen/arch/x86/oprofile/xenoprof.c
@@ -10,6 +10,7 @@
#include <xen/guest_access.h>
#include <xen/sched.h>
+#include <xen/xenoprof.h>
#include <public/xenoprof.h>
#ifdef CONFIG_COMPAT
#include <compat/xenoprof.h>
@@ -77,7 +78,8 @@ int compat_oprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
}
#endif
-int xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs)
+int xenoprofile_get_mode(const struct vcpu *v,
+ const struct cpu_user_regs *regs)
{
if ( !guest_mode(regs) )
return 2;