Date: Wed, 31 Oct 2012 19:17:56 +0000 (UTC) From: Peter Grehan <grehan@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r242404 - projects/bhyve/usr.sbin/bhyve Message-ID: <201210311917.q9VJHuYX013228@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: grehan Date: Wed Oct 31 19:17:55 2012 New Revision: 242404 URL: http://svn.freebsd.org/changeset/base/242404 Log: Change the thread name of the vCPU threads to contain the name of the VM and the vCPU number. This helps hugely when using top -H to identify what a VM is doing. Reviewed by: neel Obtained from: NetApp Modified: projects/bhyve/usr.sbin/bhyve/fbsdrun.c Modified: projects/bhyve/usr.sbin/bhyve/fbsdrun.c ============================================================================== --- projects/bhyve/usr.sbin/bhyve/fbsdrun.c Wed Oct 31 18:16:42 2012 (r242403) +++ projects/bhyve/usr.sbin/bhyve/fbsdrun.c Wed Oct 31 19:17:55 2012 (r242404) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <signal.h> #include <pthread.h> +#include <pthread_np.h> #include <machine/vmm.h> #include <vmmapi.h> @@ -196,10 +197,16 @@ fbsdrun_muxed(void) static void * fbsdrun_start_thread(void *param) { + char tname[MAXCOMLEN + 1]; + struct mt_vmm_info *mtp; int vcpu; - struct mt_vmm_info *mtp = param; + mtp = param; vcpu = mtp->mt_vcpu; + + snprintf(tname, sizeof(tname), "%s vcpu %d", vmname, vcpu); + pthread_set_name_np(mtp->mt_thr, tname); + vm_loop(mtp->mt_ctx, vcpu, vmexit[vcpu].rip); /* not reached */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210311917.q9VJHuYX013228>