summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/pci/trace.h
blob: 4d13e510590e7b9a56ca8a57ef4a2737200f55ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * VFIO PCI mmap/mmap_fault tracepoints
 *
 * Copyright (C) 2018 IBM Corp.  All rights reserved.
 *     Author: Alexey Kardashevskiy <aik@ozlabs.ru>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM vfio_pci

#if !defined(_TRACE_VFIO_PCI_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_VFIO_PCI_H

#include <linux/tracepoint.h>

TRACE_EVENT(vfio_pci_nvgpu_mmap_fault,
	TP_PROTO(struct pci_dev *pdev, unsigned long hpa, unsigned long ua,
			vm_fault_t ret),
	TP_ARGS(pdev, hpa, ua, ret),

	TP_STRUCT__entry(
		__field(const char *, name)
		__field(unsigned long, hpa)
		__field(unsigned long, ua)
		__field(int, ret)
	),

	TP_fast_assign(
		__entry->name = dev_name(&pdev->dev),
		__entry->hpa = hpa;
		__entry->ua = ua;
		__entry->ret = ret;
	),

	TP_printk("%s: %lx -> %lx ret=%d", __entry->name, __entry->hpa,
			__entry->ua, __entry->ret)
);

TRACE_EVENT(vfio_pci_nvgpu_mmap,
	TP_PROTO(struct pci_dev *pdev, unsigned long hpa, unsigned long ua,
			unsigned long size, int ret),
	TP_ARGS(pdev, hpa, ua, size, ret),

	TP_STRUCT__entry(
		__field(const char *, name)
		__field(unsigned long, hpa)
		__field(unsigned long, ua)
		__field(unsigned long, size)
		__field(int, ret)
	),

	TP_fast_assign(
		__entry->name = dev_name(&pdev->dev),
		__entry->hpa = hpa;
		__entry->ua = ua;
		__entry->size = size;
		__entry->ret = ret;
	),

	TP_printk("%s: %lx -> %lx size=%lx ret=%d", __entry->name, __entry->hpa,
			__entry->ua, __entry->size, __entry->ret)
);

TRACE_EVENT(vfio_pci_npu2_mmap,
	TP_PROTO(struct pci_dev *pdev, unsigned long hpa, unsigned long ua,
			unsigned long size, int ret),
	TP_ARGS(pdev, hpa, ua, size, ret),

	TP_STRUCT__entry(
		__field(const char *, name)
		__field(unsigned long, hpa)
		__field(unsigned long, ua)
		__field(unsigned long, size)
		__field(int, ret)
	),

	TP_fast_assign(
		__entry->name = dev_name(&pdev->dev),
		__entry->hpa = hpa;
		__entry->ua = ua;
		__entry->size = size;
		__entry->ret = ret;
	),

	TP_printk("%s: %lx -> %lx size=%lx ret=%d", __entry->name, __entry->hpa,
			__entry->ua, __entry->size, __entry->ret)
);

#endif /* _TRACE_VFIO_PCI_H */

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH ../../drivers/vfio/pci
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace

/* This part must be outside protection */
#include <trace/define_trace.h>