Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6389416ybi; Tue, 4 Jun 2019 23:57:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqySa3PPv+TPg4/TVu28iZ7nrAyv6JZWkwUWY/7bp7/6B2+9/FK0tEt7rSVZlq4Lss9CACps X-Received: by 2002:aa7:8203:: with SMTP id k3mr40672322pfi.124.1559717849404; Tue, 04 Jun 2019 23:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559717849; cv=none; d=google.com; s=arc-20160816; b=aOHAf6vXjNRwGtmQt3baRsdVH8W46PF8WvSZ2g9zGQJDCH2pMZgkxkh2HUP4ccda6u zDKa6pYMERBWYkcexwx2MxOADO6uF890CZg+ENnjctWrHstAtneEjjS8XeArvjQaoN8s tA43OpEXP5fyWT4uH/hzUEuIMxl129N2SjtoqbgJWsfnefC3AXqXAeE82ucKPYNAvTHb IUEjS1dxeSxQGp8BuiB7K4ivmCWJlJjKgS1Enbtkbg/vU34pgYH4hrrudEEzO5h9y3T7 yEhEd2b6Yrkcj4FO7EKB5U4dj7lCM8QfGrR1K6igKJYS2ET77oRPaXcdT5ACqWiFBoSh 6sWw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc; bh=LGLGQGJAAPSb3O2dMGgFbHiGRWbPn6CMztycARvdh1M=; b=oTiTlI/pSEeTaNpdPSBN2yLYpceDQ6z7Kyw5vX4/sVZCzYC6yP1/TPAuIQ8FmPd+Cz /rwwu+0LBjFfKUPJPKkByceitE+Y+tIqzjGNYlSJgsmGfZQ8EWpzyoxfStuf1wjfEMIJ LLy9CeeqPgwxempEEqM0h4aP7m3Ff5ffIQDNt8k8w1WCnyBE8PqikKQ3UQtEMaYTt3B8 6lsV12ub1acH2JO0G20XJtIBGIJeGkKBCKfvRlpItFnBghIf3FZIVPV1yZZBL57YFYZ9 vdLLIcqOy1MI3Ng0jzot5HCQcxgj99koyuKC22qb8jUNbCYgjCcz9WvefrgMeRIvkhwb z60w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q204si25200527pgq.470.2019.06.04.23.57.13; Tue, 04 Jun 2019 23:57:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726690AbfFEGzu (ORCPT + 99 others); Wed, 5 Jun 2019 02:55:50 -0400 Received: from mga03.intel.com ([134.134.136.65]:33713 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfFEGzu (ORCPT ); Wed, 5 Jun 2019 02:55:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2019 23:55:49 -0700 X-ExtLoop1: 1 Received: from allen-box.sh.intel.com (HELO [10.239.159.136]) ([10.239.159.136]) by orsmga004.jf.intel.com with ESMTP; 04 Jun 2019 23:55:45 -0700 Cc: baolu.lu@linux.intel.com, 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 To: Steven Rostedt References: <20190603011620.31999-1-baolu.lu@linux.intel.com> <20190603011620.31999-8-baolu.lu@linux.intel.com> <20190604050122.4a095569@oasis.local.home> From: Lu Baolu Message-ID: <759e5f85-354c-fdf0-f31d-5df90481d75e@linux.intel.com> Date: Wed, 5 Jun 2019 14:48:45 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190604050122.4a095569@oasis.local.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve, On 6/4/19 5:01 PM, Steven Rostedt wrote: > 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) Thanks for reviewing. I will rework this patch according to your comments here. > > -- Steve > Best regards, Baolu > >> +#endif /* _TRACE_INTEL_IOMMU_H */ >> + >> +/* This part must be outside protection */ >> +#include > >