aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/xenoprof.c
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/common/xenoprof.c
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/common/xenoprof.c')
-rw-r--r--xen/common/xenoprof.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index a99d3432bb..e571fea829 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -511,24 +511,23 @@ static int xenoprof_add_sample(struct domain *d, xenoprof_buf_t *buf,
return 1;
}
-int xenoprof_add_trace(struct domain *d, struct vcpu *vcpu,
- uint64_t eip, int mode)
+int xenoprof_add_trace(struct vcpu *vcpu, uint64_t pc, int mode)
{
+ struct domain *d = vcpu->domain;
xenoprof_buf_t *buf = d->xenoprof->vcpu[vcpu->vcpu_id].buffer;
/* Do not accidentally write an escape code due to a broken frame. */
- if ( eip == XENOPROF_ESCAPE_CODE )
+ if ( pc == XENOPROF_ESCAPE_CODE )
{
invalid_buffer_samples++;
return 0;
}
- return xenoprof_add_sample(d, buf, eip, mode, 0);
+ return xenoprof_add_sample(d, buf, pc, mode, 0);
}
-void xenoprof_log_event(struct vcpu *vcpu,
- struct cpu_user_regs * regs, uint64_t eip,
- int mode, int event)
+void xenoprof_log_event(struct vcpu *vcpu, const struct cpu_user_regs *regs,
+ uint64_t pc, int mode, int event)
{
struct domain *d = vcpu->domain;
struct xenoprof_vcpu *v;
@@ -565,7 +564,7 @@ void xenoprof_log_event(struct vcpu *vcpu,
}
}
- if ( xenoprof_add_sample(d, buf, eip, mode, event) )
+ if ( xenoprof_add_sample(d, buf, pc, mode, event) )
{
if ( is_active(vcpu->domain) )
active_samples++;
@@ -581,7 +580,7 @@ void xenoprof_log_event(struct vcpu *vcpu,
}
if ( backtrace_depth > 0 )
- xenoprof_backtrace(d, vcpu, regs, backtrace_depth, mode);
+ xenoprof_backtrace(vcpu, regs, backtrace_depth, mode);
}