Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5153923ybi; Tue, 4 Jun 2019 02:04:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyX17T3mGXPef1QOV73D3DEYncjS3gy1VtMiTWvL1SqtGKYP47rnYtyx5Kz/NRR1SGroA7v X-Received: by 2002:a17:90a:c303:: with SMTP id g3mr36272693pjt.58.1559639051900; Tue, 04 Jun 2019 02:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559639051; cv=none; d=google.com; s=arc-20160816; b=FT+APt3e6QnoNR69jL5HyYuTzwp+POsZREkmJ9vlay3258cVffj0/gRrjpjaRoWDBb svQ9uVEr8GguIx6RxMyUTT0jjXdAYFKqoHstBJxfmw+/EdaDXtTQiYsM6Egb7oJZlCvj sP1AzdZ/L6N1xfnMqtpfhGEvwS0NlBbJQs3sy1rjVe9t7rlAJBJkL4KVRz3WibOgGjmx hGHAekWTivzNbl7ipdz5Q4Ss0sR552QX8ekA4yKEVA4HB+ruUhmkJJngu2TyANFJPJKh ZC760Z2K93JnV+5iG+wCK5gCvOfJ1t89UH9cc1a+JZ59PT/ptqWZQIW9AMICMPL/DxL0 yPEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=nUlMo0sJ56Nw6IFQUL5Nl1yodL2h8wcO/g1xeFv/+Ec=; b=K1n/Bf9wdxh3S/leGurTuSoKGYsO8Sooo/6GTwy0goLFTAfAe3ur+mmoF9R9ObO3Nb vum63bmWvargJy6qYzNXQjpvbzH08vcLFacQJxF+0nKT4nppgfKcmD0FS8kvKOdQbHBg YC+beFRsIag0xbM9Cm3b/0J7drFCc2A6Hlw18HVXfLfIIMa3MCV/8JlHLMBlWEopa8c3 i201A7m2/wWb4+tTcIXljGRRyrYcceZW3SaoIo3nTZROcNax6N/fzCWcgeweoiJzJp9R YpzZqYE+0tyIc8qln0yazDQ9H5ttyZTuikMGeMHq2t+DhjOhZHhYSn+D5AMrgA+4tSAm xEtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si19767851pfn.273.2019.06.04.02.03.53; Tue, 04 Jun 2019 02:04:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbfFDJBe (ORCPT + 99 others); Tue, 4 Jun 2019 05:01:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:36302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbfFDJBd (ORCPT ); Tue, 4 Jun 2019 05:01:33 -0400 Received: from oasis.local.home (unknown [146.247.46.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B08BB24071; Tue, 4 Jun 2019 09:01:27 +0000 (UTC) Date: Tue, 4 Jun 2019 05:01:22 -0400 From: Steven Rostedt To: Lu Baolu Cc: David Woodhouse , Joerg Roedel , Bjorn Helgaas , Christoph Hellwig , ashok.raj@intel.com, jacob.jun.pan@intel.com, alan.cox@intel.com, kevin.tian@intel.com, mika.westerberg@linux.intel.com, Ingo Molnar , Greg Kroah-Hartman , pengfei.xu@intel.com, Konrad Rzeszutek Wilk , Marek Szyprowski , Robin Murphy , Jonathan Corbet , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jacob Pan Subject: Re: [PATCH v4 7/9] iommu/vt-d: Add trace events for domain map/unmap Message-ID: <20190604050122.4a095569@oasis.local.home> In-Reply-To: <20190603011620.31999-8-baolu.lu@linux.intel.com> References: <20190603011620.31999-1-baolu.lu@linux.intel.com> <20190603011620.31999-8-baolu.lu@linux.intel.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Jun 2019 09:16:18 +0800 Lu Baolu wrote: > +TRACE_EVENT(bounce_unmap_single, > + TP_PROTO(struct device *dev, dma_addr_t dev_addr, size_t size), > + > + TP_ARGS(dev, dev_addr, size), > + > + TP_STRUCT__entry( > + __string(dev_name, dev_name(dev)) > + __field(dma_addr_t, dev_addr) > + __field(size_t, size) > + ), > + > + TP_fast_assign( > + __assign_str(dev_name, dev_name(dev)); > + __entry->dev_addr = dev_addr; > + __entry->size = size; > + ), > + > + TP_printk("dev=%s dev_addr=0x%llx size=%zu", > + __get_str(dev_name), > + (unsigned long long)__entry->dev_addr, > + __entry->size) > +); > + > +TRACE_EVENT(bounce_map_sg, > + TP_PROTO(struct device *dev, unsigned int i, unsigned int nelems, > + dma_addr_t dev_addr, phys_addr_t phys_addr, size_t size), > + > + TP_ARGS(dev, i, nelems, dev_addr, phys_addr, size), > + > + TP_STRUCT__entry( > + __string(dev_name, dev_name(dev)) > + __field(unsigned int, i) > + __field(unsigned int, last) > + __field(dma_addr_t, dev_addr) > + __field(phys_addr_t, phys_addr) > + __field(size_t, size) > + ), > + > + TP_fast_assign( > + __assign_str(dev_name, dev_name(dev)); > + __entry->i = i; > + __entry->last = nelems - 1; > + __entry->dev_addr = dev_addr; > + __entry->phys_addr = phys_addr; > + __entry->size = size; > + ), > + > + TP_printk("dev=%s elem=%u/%u dev_addr=0x%llx phys_addr=0x%llx size=%zu", > + __get_str(dev_name), __entry->i, __entry->last, > + (unsigned long long)__entry->dev_addr, > + (unsigned long long)__entry->phys_addr, > + __entry->size) > +); > + > +TRACE_EVENT(bounce_unmap_sg, > + TP_PROTO(struct device *dev, unsigned int i, unsigned int nelems, > + dma_addr_t dev_addr, phys_addr_t phys_addr, size_t size), > + > + TP_ARGS(dev, i, nelems, dev_addr, phys_addr, size), > + > + TP_STRUCT__entry( > + __string(dev_name, dev_name(dev)) > + __field(unsigned int, i) > + __field(unsigned int, last) > + __field(dma_addr_t, dev_addr) > + __field(phys_addr_t, phys_addr) > + __field(size_t, size) > + ), > + > + TP_fast_assign( > + __assign_str(dev_name, dev_name(dev)); > + __entry->i = i; > + __entry->last = nelems - 1; > + __entry->dev_addr = dev_addr; > + __entry->phys_addr = phys_addr; > + __entry->size = size; > + ), > + > + TP_printk("dev=%s elem=%u/%u dev_addr=0x%llx phys_addr=0x%llx size=%zu", > + __get_str(dev_name), __entry->i, __entry->last, > + (unsigned long long)__entry->dev_addr, > + (unsigned long long)__entry->phys_addr, > + __entry->size) > +); These last two events look identical. Please use the DECLARE_EVENT_CLASS() to describe the event and then DEFINE_EVENT() for the two events. Each TRACE_EVENT() can add up to 5k of data/text, where as a DEFINE_EVENT() just adds around 250 bytes. (Note, a TRACE_EVENT() is defined as a DECLARE_EVENT_CLASS()/DEFINE_EVENT() pair) -- Steve > +#endif /* _TRACE_INTEL_IOMMU_H */ > + > +/* This part must be outside protection */ > +#include