WIP FPC-III support
[linux/fpc-iii.git] / drivers / vfio / pci / trace.h
blobb2aa986ab9ed0572fb4fe71b41d1c2b8645d5de1
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * VFIO PCI mmap/mmap_fault tracepoints
5 * Copyright (C) 2018 IBM Corp. All rights reserved.
6 * Author: Alexey Kardashevskiy <aik@ozlabs.ru>
7 */
9 #undef TRACE_SYSTEM
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,
19 vm_fault_t ret),
20 TP_ARGS(pdev, hpa, ua, ret),
22 TP_STRUCT__entry(
23 __field(const char *, name)
24 __field(unsigned long, hpa)
25 __field(unsigned long, ua)
26 __field(int, ret)
29 TP_fast_assign(
30 __entry->name = dev_name(&pdev->dev),
31 __entry->hpa = hpa;
32 __entry->ua = ua;
33 __entry->ret = ret;
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),
45 TP_STRUCT__entry(
46 __field(const char *, name)
47 __field(unsigned long, hpa)
48 __field(unsigned long, ua)
49 __field(unsigned long, size)
50 __field(int, ret)
53 TP_fast_assign(
54 __entry->name = dev_name(&pdev->dev),
55 __entry->hpa = hpa;
56 __entry->ua = ua;
57 __entry->size = size;
58 __entry->ret = ret;
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),
70 TP_STRUCT__entry(
71 __field(const char *, name)
72 __field(unsigned long, hpa)
73 __field(unsigned long, ua)
74 __field(unsigned long, size)
75 __field(int, ret)
78 TP_fast_assign(
79 __entry->name = dev_name(&pdev->dev),
80 __entry->hpa = hpa;
81 __entry->ua = ua;
82 __entry->size = size;
83 __entry->ret = ret;
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>