Giter Site home page Giter Site logo

sysml / uniprof Goto Github PK

View Code? Open in Web Editor NEW
29.0 10.0 7.0 146 KB

A stack tracer/profiler for Xen domains

License: BSD 3-Clause "New" or "Revised" License

Makefile 2.94% M4 9.19% C 82.51% Shell 0.03% C++ 5.32%
stack tracer profiler xen unikernel

uniprof's People

Contributors

skuenzer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uniprof's Issues

Could not access information for domid, Does domid exist?

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?

get_domain_state() signals an error

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.

bus error

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.