From owner-freebsd-virtualization@freebsd.org Mon Aug 27 14:56:23 2018 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8936F108CDF4 for ; Mon, 27 Aug 2018 14:56:23 +0000 (UTC) (envelope-from fabian.freyer@physik.tu-berlin.de) Received: from mail2.physik.tu-berlin.de (mail2.physik-pool.tu-berlin.de [130.149.50.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A8377442A; Mon, 27 Aug 2018 14:56:23 +0000 (UTC) (envelope-from fabian.freyer@physik.tu-berlin.de) Received: from [130.149.50.202] (yalow02.physik-pool.tu-berlin.de [130.149.50.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail2.physik.tu-berlin.de (Postfix) with ESMTPSA id 29A9461F92; Mon, 27 Aug 2018 14:56:22 +0000 (UTC) Subject: Re: on bhyve statistics To: Marcelo Araujo References: From: Fabian Freyer Cc: freebsd-virtualization@freebsd.org Message-ID: <26beeb83-1e62-af39-5532-680062ee7d7d@physik.tu-berlin.de> Date: Mon, 27 Aug 2018 16:56:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2018 14:56:23 -0000 On 27.08.2018 16:34, Marcelo Araujo wrote: > Hi Fabian, > > 2018-08-27 22:14 GMT+08:00 Fabian Freyer > >: [...] > - are the stats in struct bhyvestats {...} stats exposed or used in any >   non-obvious way? > > > They are most used inside bhyverun by the name "stats" and the purpose > is not really to collect statistics about the guest vm. What are they used for? I only see them get increased, never actually checked: $ rg stats /usr/src/usr.sbin/bhyve /usr/src/usr.sbin/bhyve/bhyverun.c 117:struct bhyvestats { 126:} stats; 510: stats.vmexit_bogus++; 521: stats.vmexit_reqidle++; 530: stats.vmexit_hlt++; 544: stats.vmexit_pause++; 555: stats.vmexit_mtrap++; 566: stats.vmexit_inst_emul++; > - architecturally, what would be the best ways to get stats out of the >   user-space emulations? Off of the top of my head, I could think of the >   following possibilities: >   - prometheus exporter >   - having some socket or pipe to request them >   - DTrace probes > > > I don't know what kind of stats do you need to collect, but based on the > assumptions you listed above, maybe you can take a look at this project: > https://github.com/freenas/bhyve-vm-goagent > > bhyve-vm-goagent can easily be extended to collect other information > from guest. Although I'm not sure if it will be useful for your case, > looks like you are looking for something less intrusive than > bhyve-vm-goagent. Thanks for the pointer - but you're right, I'm looking for guest-agnostic monitoring on the host. Fabian