Received: by 10.192.165.156 with SMTP id m28csp1133877imm; Mon, 16 Apr 2018 14:50:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx49QAxpR2L/icaMDUWpV6p2dgngZ+u/RtVEueV8I9bY2Mj9LqItGFaXTqrtOIEwEjEZczKkB X-Received: by 2002:a17:902:b7c9:: with SMTP id v9-v6mr10171433plz.35.1523915459343; Mon, 16 Apr 2018 14:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523915459; cv=none; d=google.com; s=arc-20160816; b=lpD0tmFIh5cpKHvp4GCsb3DrIXkZnAe9aDOfgSPUpObHhm7RQuI+yDApEUbNLzHkIA 3JRt3yePHvlYucMc5W0+ckr4IY5/SfCA5GTkYBVtukSVl0sN0vwqeudk5ScvVLLqSka4 7XinzHiNPUlT+bILn4SjY7AtivpX7DpN/88nB3iIJzFU6wcot/9eZa4KEeSWlnbsSFER IFX2sNFhO839NbFe++Tz30osnULrDWnI1sp+Puj2PU0RnTm8yRg2EMJfRfEl96drFadK p6SukgA3jIkImG4JPN8LGcaDIrljqPKcxQTbHnnDjN2jl9/4mzChq51MbVD8oUzN9JIZ imlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=LQy54NNnfUMaAYolZleLvjD6T+YJkEX5uNF9K+MYKgM=; b=k24Mz3Nch8eIklRT2R8pjO7Q/LXqKQ19Gv74H3OikEq2yWdrcT26PB2H2MHr5WOh29 FDvtHDDN1Bboicb8VuLpNpT6LONC3Tzqu0n6e7SfUsKwelArFZULSq5VfQdkIBDmWmbX gAAMUnaD3frmvZamwZZm8/b+GM6e84e9TuymDW6/uF4cJLXbJyvXMgNVw+tNEGPwGX3f ++E1esN1fJ/fSjN8rYZVGnkLVVbnPdb+tj7DRY1mnVFrjBZdq7PIvF/+7o4l7XhK78bd QVKScevD2tUQnFSxhyF2Fr2GYkKGDAE/9LOGonZzTUyGbHYfRuxFcT7oYDMUGxGbQ5et CCnw== 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 g130si10333221pgc.225.2018.04.16.14.50.44; Mon, 16 Apr 2018 14:50:59 -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 S1753196AbeDPVrj (ORCPT + 99 others); Mon, 16 Apr 2018 17:47:39 -0400 Received: from mga09.intel.com ([134.134.136.24]:12292 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752939AbeDPVqv (ORCPT ); Mon, 16 Apr 2018 17:46:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2018 14:46:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,460,1517904000"; d="scan'208";a="34740200" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga006.jf.intel.com with ESMTP; 16 Apr 2018 14:46:43 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Greg Kroah-Hartman , Alex Williamson , Jean-Philippe Brucker Cc: Rafael Wysocki , "Liu, Yi L" , "Tian, Kevin" , Raj Ashok , Jean Delvare , "Christoph Hellwig" , "Lu Baolu" , Jacob Pan Subject: [PATCH v4 21/22] trace/iommu: add sva trace events Date: Mon, 16 Apr 2018 14:49:10 -0700 Message-Id: <1523915351-54415-22-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Jacob Pan --- include/trace/events/iommu.h | 112 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h index 72b4582..e64eb29 100644 --- a/include/trace/events/iommu.h +++ b/include/trace/events/iommu.h @@ -12,6 +12,8 @@ #define _TRACE_IOMMU_H #include +#include +#include struct device; @@ -161,6 +163,116 @@ DEFINE_EVENT(iommu_error, io_page_fault, TP_ARGS(dev, iova, flags) ); + +TRACE_EVENT(dev_fault, + + TP_PROTO(struct device *dev, struct iommu_fault_event *evt), + + TP_ARGS(dev, evt), + + TP_STRUCT__entry( + __string(device, dev_name(dev)) + __field(int, type) + __field(int, reason) + __field(u64, addr) + __field(u32, pasid) + __field(u32, pgid) + __field(u32, last_req) + __field(u32, prot) + ), + + TP_fast_assign( + __assign_str(device, dev_name(dev)); + __entry->type = evt->type; + __entry->reason = evt->reason; + __entry->addr = evt->addr; + __entry->pasid = evt->pasid; + __entry->pgid = evt->page_req_group_id; + __entry->last_req = evt->last_req; + __entry->prot = evt->prot; + ), + + TP_printk("IOMMU:%s type=%d reason=%d addr=0x%016llx pasid=%d group=%d last=%d prot=%d", + __get_str(device), + __entry->type, + __entry->reason, + __entry->addr, + __entry->pasid, + __entry->pgid, + __entry->last_req, + __entry->prot + ) +); + +TRACE_EVENT(dev_page_response, + + TP_PROTO(struct device *dev, struct page_response_msg *msg), + + TP_ARGS(dev, msg), + + TP_STRUCT__entry( + __string(device, dev_name(dev)) + __field(int, code) + __field(u64, addr) + __field(u32, pasid) + __field(u32, pgid) + ), + + TP_fast_assign( + __assign_str(device, dev_name(dev)); + __entry->code = msg->resp_code; + __entry->addr = msg->addr; + __entry->pasid = msg->pasid; + __entry->pgid = msg->page_req_group_id; + ), + + TP_printk("IOMMU:%s code=%d addr=0x%016llx pasid=%d group=%d", + __get_str(device), + __entry->code, + __entry->addr, + __entry->pasid, + __entry->pgid + ) +); + +TRACE_EVENT(sva_invalidate, + + TP_PROTO(struct device *dev, struct tlb_invalidate_info *ti), + + TP_ARGS(dev, ti), + + TP_STRUCT__entry( + __string(device, dev_name(dev)) + __field(int, type) + __field(u32, granu) + __field(u32, flags) + __field(u8, size) + __field(u32, pasid) + __field(u64, addr) + ), + + TP_fast_assign( + __assign_str(device, dev_name(dev)); + __entry->type = ti->hdr.type; + __entry->flags = ti->flags; + __entry->granu = ti->granularity; + __entry->size = ti->size; + __entry->pasid = ti->pasid; + __entry->addr = ti->addr; + ), + + TP_printk("IOMMU:%s type=%d flags=0x%08x granu=%d size=%d pasid=%d addr=0x%016llx", + __get_str(device), + __entry->type, + __entry->flags, + __entry->granu, + __entry->size, + __entry->pasid, + __entry->addr + ) +); + + #endif /* _TRACE_IOMMU_H */ /* This part must be outside protection */ -- 2.7.4