1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2 /* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ 3 4 #undef TRACE_SYSTEM 5 #define TRACE_SYSTEM mlx5 6 7 #if !defined(_MLX5_SF_DEV_TP_) || defined(TRACE_HEADER_MULTI_READ) 8 #define _MLX5_SF_DEV_TP_ 9 10 #include <linux/tracepoint.h> 11 #include <linux/mlx5/driver.h> 12 #include "../../dev/dev.h" 13 14 DECLARE_EVENT_CLASS(mlx5_sf_dev_template, 15 TP_PROTO(const struct mlx5_core_dev *dev, 16 const struct mlx5_sf_dev *sfdev, 17 int aux_id), 18 TP_ARGS(dev, sfdev, aux_id), 19 TP_STRUCT__entry(__string(devname, dev_name(dev->device)) 20 __field(const struct mlx5_sf_dev*, sfdev) 21 __field(int, aux_id) 22 __field(u16, hw_fn_id) 23 __field(u32, sfnum) 24 ), 25 TP_fast_assign(__assign_str(devname); 26 __entry->sfdev = sfdev; 27 __entry->aux_id = aux_id; 28 __entry->hw_fn_id = sfdev->fn_id; 29 __entry->sfnum = sfdev->sfnum; 30 ), 31 TP_printk("(%s) sfdev=%pK aux_id=%d hw_id=0x%x sfnum=%u\n", 32 __get_str(devname), __entry->sfdev, 33 __entry->aux_id, __entry->hw_fn_id, 34 __entry->sfnum) 35 ); 36 37 DEFINE_EVENT(mlx5_sf_dev_template, mlx5_sf_dev_add, 38 TP_PROTO(const struct mlx5_core_dev *dev, 39 const struct mlx5_sf_dev *sfdev, 40 int aux_id), 41 TP_ARGS(dev, sfdev, aux_id) 42 ); 43 44 DEFINE_EVENT(mlx5_sf_dev_template, mlx5_sf_dev_del, 45 TP_PROTO(const struct mlx5_core_dev *dev, 46 const struct mlx5_sf_dev *sfdev, 47 int aux_id), 48 TP_ARGS(dev, sfdev, aux_id) 49 ); 50 51 #endif /* _MLX5_SF_DEV_TP_ */ 52 53 /* This part must be outside protection */ 54 #undef TRACE_INCLUDE_PATH 55 #define TRACE_INCLUDE_PATH sf/dev/diag 56 #undef TRACE_INCLUDE_FILE 57 #define TRACE_INCLUDE_FILE dev_tracepoint 58 #include <trace/define_trace.h> 59