1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * VFIO PCI mmap/mmap_fault tracepoints
5 * Copyright (C) 2018 IBM Corp. All rights reserved.
6 * Author: Alexey Kardashevskiy <aik@ozlabs.ru>
10 #define TRACE_SYSTEM vfio_pci
12 #if !defined(_TRACE_VFIO_PCI_H) || defined(TRACE_HEADER_MULTI_READ)
13 #define _TRACE_VFIO_PCI_H
15 #include <linux/tracepoint.h>
17 TRACE_EVENT(vfio_pci_nvgpu_mmap_fault
,
18 TP_PROTO(struct pci_dev
*pdev
, unsigned long hpa
, unsigned long ua
,
20 TP_ARGS(pdev
, hpa
, ua
, ret
),
23 __field(const char *, name
)
24 __field(unsigned long, hpa
)
25 __field(unsigned long, ua
)
30 __entry
->name
= dev_name(&pdev
->dev
),
36 TP_printk("%s: %lx -> %lx ret=%d", __entry
->name
, __entry
->hpa
,
37 __entry
->ua
, __entry
->ret
)
40 TRACE_EVENT(vfio_pci_nvgpu_mmap
,
41 TP_PROTO(struct pci_dev
*pdev
, unsigned long hpa
, unsigned long ua
,
42 unsigned long size
, int ret
),
43 TP_ARGS(pdev
, hpa
, ua
, size
, ret
),
46 __field(const char *, name
)
47 __field(unsigned long, hpa
)
48 __field(unsigned long, ua
)
49 __field(unsigned long, size
)
54 __entry
->name
= dev_name(&pdev
->dev
),
61 TP_printk("%s: %lx -> %lx size=%lx ret=%d", __entry
->name
, __entry
->hpa
,
62 __entry
->ua
, __entry
->size
, __entry
->ret
)
65 TRACE_EVENT(vfio_pci_npu2_mmap
,
66 TP_PROTO(struct pci_dev
*pdev
, unsigned long hpa
, unsigned long ua
,
67 unsigned long size
, int ret
),
68 TP_ARGS(pdev
, hpa
, ua
, size
, ret
),
71 __field(const char *, name
)
72 __field(unsigned long, hpa
)
73 __field(unsigned long, ua
)
74 __field(unsigned long, size
)
79 __entry
->name
= dev_name(&pdev
->dev
),
86 TP_printk("%s: %lx -> %lx size=%lx ret=%d", __entry
->name
, __entry
->hpa
,
87 __entry
->ua
, __entry
->size
, __entry
->ret
)
90 #endif /* _TRACE_VFIO_PCI_H */
92 #undef TRACE_INCLUDE_PATH
93 #define TRACE_INCLUDE_PATH ../../drivers/vfio/pci
94 #undef TRACE_INCLUDE_FILE
95 #define TRACE_INCLUDE_FILE trace
97 /* This part must be outside protection */
98 #include <trace/define_trace.h>