diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-10-14 09:07:51 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-10-14 09:07:51 +0100 |
commit | 0482af4d96d0a48c0e7eb9f9033408c014de9a4d (patch) | |
tree | cd5f29e8439383e5ed3ca6b6a3aa8a10c2ca06b6 /tools/libxc/xc_misc.c | |
parent | c637aa4f78d48ffcd39b8352a7fd325add0f89f9 (diff) | |
download | xen-0482af4d96d0a48c0e7eb9f9033408c014de9a4d.tar.gz xen-0482af4d96d0a48c0e7eb9f9033408c014de9a4d.tar.bz2 xen-0482af4d96d0a48c0e7eb9f9033408c014de9a4d.zip |
Spinlock profiling (enable in build with lock_profile=y)
Adds new tool xenlockprof to run from dom0.
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools/libxc/xc_misc.c')
-rw-r--r-- | tools/libxc/xc_misc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index 7fa1607896..ffc04fb50f 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -121,6 +121,30 @@ int xc_perfc_control(int xc_handle, return rc; } +int xc_lockprof_control(int xc_handle, + uint32_t opcode, + uint32_t *n_elems, + uint64_t *time, + xc_lockprof_data_t *data) +{ + int rc; + DECLARE_SYSCTL; + + sysctl.cmd = XEN_SYSCTL_lockprof_op; + sysctl.u.lockprof_op.cmd = opcode; + sysctl.u.lockprof_op.max_elem = n_elems ? *n_elems : 0; + set_xen_guest_handle(sysctl.u.lockprof_op.data, data); + + rc = do_sysctl(xc_handle, &sysctl); + + if (n_elems) + *n_elems = sysctl.u.lockprof_op.nr_elem; + if (time) + *time = sysctl.u.lockprof_op.time; + + return rc; +} + int xc_getcpuinfo(int xc_handle, int max_cpus, xc_cpuinfo_t *info, int *nr_cpus) { |