sysml / uniprof Goto Github PK
View Code? Open in Web Editor NEWA stack tracer/profiler for Xen domains
License: BSD 3-Clause "New" or "Revised" License
A stack tracer/profiler for Xen domains
License: BSD 3-Clause "New" or "Revised" License
I'm trying to run uniprof with Unikraft, but unfortunately get_domain_state () throws an error.
I tried with libxc, but also with libxencall and both fail at this point.
For configuration I used this version of Xen.
int get_domain_state(int domid, unsigned int *state) {
int retval;
#if defined(HYPERCALL_XENCALL)
struct xen_domctl domctl;
domctl.domain = (domid_t)domid;
domctl.interface_version = XEN_DOMCTL_INTERFACE_VERSION;
domctl.cmd = XEN_DOMCTL_getdomaininfo;
retval = xencall1(callh, __HYPERVISOR_domctl, (unsigned long)(&domctl));
*state = domctl.u.getdomaininfo.flags;
return retval;
#elif defined(HYPERCALL_LIBXC)
xc_dominfo_t info;
retval = xc_domain_getinfo(xc_handle, domid, 1, &info);
*state |= (info.shutdown_reason << XEN_DOMINF_shutdownshift);
if (info.dying)
*state |= XEN_DOMINF_dying;
if (info.hvm)
*state |= XEN_DOMINF_hvm_guest;
if (info.shutdown || info.crashed)
*state |= XEN_DOMINF_shutdown;
if (info.paused)
*state |= XEN_DOMINF_paused;
if (info.blocked)
*state |= XEN_DOMINF_blocked;
if (info.running)
*state |= XEN_DOMINF_running;
if (info.debugged)
*state |= XEN_DOMINF_debugged;
if (retval == 1)
return 0;
return retval;
#endif
}
In this function xencall1 and xc_domain_getinfo always return -1 so what I think is that hypercalls don't work as they should. But I don't know what the cause is.
I'm using xen which comes with ubuntu 16.04.
root@or-xen-d0:/var/log/xen# xl list
Name ID Mem VCPUs State Time(s)
Domain-0 0 23962 2 r----- 3004.6
Mini-OS 51 32 1 r----- 2024.6
root@or-xen-d0:/var/log/xen# uniprof -F 1 -T 1 - 51
Could not access information for domid 51. (Does domid 51 exist?)
strace:
root@or-xen-d0:/var/log/xen# strace uniprof -F 1 -T 1 - 51
...
open("/proc/xen/privcmd", O_RDWR) = 3
fcntl(3, F_GETFD) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_LOCKED, -1, 0) = 0x7f9b995c9000
madvise(0x7f9b995c9000, 4096, MADV_DONTFORK) = 0
ioctl(3, _IOC(0, 0x50, 0x00, 0x30), 0x7ffca3114730) = -1 EACCES (Permission denied)
write(2, "Could not access information for"..., 66Could not access information for domid 51. (Does domid 51 exist?)
) = 66
exit_group(-5) = ?
What should I do now?
Just mucking around with an existing Xen server and Linux guests:
# ./uniprof out.prof 27
Bus error (core dumped)
# gdb ./uniprof cone
[...]
Program terminated with signal SIGBUS, Bus error.
#0 __memmove_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/../multiarch/memmove-vec-unaligned-erms.S:292
292 ../sysdeps/x86_64/multiarch/../multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt
#0 __memmove_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/../multiarch/memmove-vec-unaligned-erms.S:292
#1 0x000055df7f056024 in walk_stack_fp ()
#2 0x000055df7f056175 in do_stack_trace_fp ()
#3 0x000055df7f0554f0 in main ()
Of course, I also had to unpause the domain to let it continue:
# xl list
Name ID Mem VCPUs State Time(s)
Domain-0 0 2438 4 r----- 9222.0
vm0 1 512 1 r----- 167.5
vm2hvm 27 512 3 --p--- 157.2
vm1hvm 28 512 1 r----- 277.9
# xl unpause vm2hvm
If it's crashing when trying to walk frame pointers, then sure, Linux is likely running things that aren't using them...
It doesn't crash all the time. It does sometimes work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.