aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h
blob: 7f7c9af5deed99d858b3c9654bbf36f1c5754fd8 (plain) (blame)
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
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM mlx5

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

#include <linux/tracepoint.h>
#include <linux/mlx5/driver.h>
#include "../../dev/dev.h"

DECLARE_EVENT_CLASS(mlx5_sf_dev_template,
		    TP_PROTO(const struct mlx5_core_dev *dev,
			     const struct mlx5_sf_dev *sfdev,
			     int aux_id),
		    TP_ARGS(dev, sfdev, aux_id),
		    TP_STRUCT__entry(__string(devname, dev_name(dev->device))
				     __field(const struct mlx5_sf_dev*, sfdev)
				     __field(int, aux_id)
				     __field(u16, hw_fn_id)
				     __field(u32, sfnum)
		    ),
		    TP_fast_assign(__assign_str(devname, dev_name(dev->device));
				   __entry->sfdev = sfdev;
				   __entry->aux_id = aux_id;
				   __entry->hw_fn_id = sfdev->fn_id;
				   __entry->sfnum = sfdev->sfnum;
		    ),
		    TP_printk("(%s) sfdev=%pK aux_id=%d hw_id=0x%x sfnum=%u\n",
			      __get_str(devname), __entry->sfdev,
			      __entry->aux_id, __entry->hw_fn_id,
			      __entry->sfnum)
);

DEFINE_EVENT(mlx5_sf_dev_template, mlx5_sf_dev_add,
	     TP_PROTO(const struct mlx5_core_dev *dev,
		      const struct mlx5_sf_dev *sfdev,
		      int aux_id),
	     TP_ARGS(dev, sfdev, aux_id)
	     );

DEFINE_EVENT(mlx5_sf_dev_template, mlx5_sf_dev_del,
	     TP_PROTO(const struct mlx5_core_dev *dev,
		      const struct mlx5_sf_dev *sfdev,
		      int aux_id),
	     TP_ARGS(dev, sfdev, aux_id)
	     );

#endif /* _MLX5_SF_DEV_TP_ */

/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH sf/dev/diag
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE dev_tracepoint
#include <trace/define_trace.h>