From patchwork Fri Jun 2 16:34:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 770493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wfVF91XV7z9ryv for ; Sat, 3 Jun 2017 02:35:25 +1000 (AEST) Received: from localhost ([::1]:50708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGpXm-0007t2-RG for incoming@patchwork.ozlabs.org; Fri, 02 Jun 2017 12:35:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGpX3-0007rz-5i for qemu-devel@nongnu.org; Fri, 02 Jun 2017 12:34:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGpX2-0006ID-8M for qemu-devel@nongnu.org; Fri, 02 Jun 2017 12:34:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50496) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGpX2-0006Gk-2R for qemu-devel@nongnu.org; Fri, 02 Jun 2017 12:34:36 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C30923204B; Fri, 2 Jun 2017 16:34:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1C30923204B Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mst@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1C30923204B Received: from redhat.com (ovpn-125-45.rdu2.redhat.com [10.10.125.45]) by smtp.corp.redhat.com (Postfix) with SMTP id AC37F5C8A3; Fri, 2 Jun 2017 16:34:34 +0000 (UTC) Date: Fri, 2 Jun 2017 19:34:34 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1496421247-857-3-git-send-email-mst@redhat.com> References: <1496421247-857-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1496421247-857-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 02 Jun 2017 16:34:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/8] virtio: add virtqueue_alloc_element tracepoint X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini This tracepoint can help diagnosing failures due to memory fragmentation in the guest. Signed-off-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio.c | 1 + hw/virtio/trace-events | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index f99d99f..464947f 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -815,6 +815,7 @@ static void *virtqueue_alloc_element(size_t sz, unsigned out_num, unsigned in_nu assert(sz >= sizeof(VirtQueueElement)); elem = g_malloc(out_sg_end); + trace_virtqueue_alloc_element(elem, sz, in_num, out_num); elem->out_num = out_num; elem->in_num = in_num; elem->in_addr = (void *)elem + in_addr_ofs; diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events index 1f7a7c1..e24d8fa 100644 --- a/hw/virtio/trace-events +++ b/hw/virtio/trace-events @@ -1,6 +1,7 @@ # See docs/tracing.txt for syntax documentation. # hw/virtio/virtio.c +virtqueue_alloc_element(void *elem, size_t sz, unsigned in_num, unsigned out_num) "elem %p size %zd in_num %u out_num %u" virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int idx) "vq %p elem %p len %u idx %u" virtqueue_flush(void *vq, unsigned int count) "vq %p count %u" virtqueue_pop(void *vq, void *elem, unsigned int in_num, unsigned int out_num) "vq %p elem %p in_num %u out_num %u"