1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2 /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ 3 4 #undef TRACE_SYSTEM 5 #define TRACE_SYSTEM mlx5 6 7 #if !defined(_MLX5_CMD_TP_H_) || defined(TRACE_HEADER_MULTI_READ) 8 #define _MLX5_CMD_TP_H_ 9 10 #include <linux/tracepoint.h> 11 #include <linux/trace_seq.h> 12 13 TRACE_EVENT(mlx5_cmd, 14 TP_PROTO(const char *command_str, u16 opcode, u16 op_mod, 15 const char *status_str, u8 status, u32 syndrome, int err), 16 TP_ARGS(command_str, opcode, op_mod, status_str, status, syndrome, err), 17 TP_STRUCT__entry(__string(command_str, command_str) 18 __field(u16, opcode) 19 __field(u16, op_mod) 20 __string(status_str, status_str) 21 __field(u8, status) 22 __field(u32, syndrome) 23 __field(int, err) 24 ), 25 TP_fast_assign(__assign_str(command_str, command_str); 26 __entry->opcode = opcode; 27 __entry->op_mod = op_mod; 28 __assign_str(status_str, status_str); 29 __entry->status = status; 30 __entry->syndrome = syndrome; 31 __entry->err = err; 32 ), 33 TP_printk("%s(0x%x) op_mod(0x%x) failed, status %s(0x%x), syndrome (0x%x), err(%d)", 34 __get_str(command_str), __entry->opcode, __entry->op_mod, 35 __get_str(status_str), __entry->status, __entry->syndrome, 36 __entry->err) 37 ); 38 39 #endif /* _MLX5_CMD_TP_H_ */ 40 41 #undef TRACE_INCLUDE_PATH 42 #define TRACE_INCLUDE_PATH ./diag 43 #undef TRACE_INCLUDE_FILE 44 #define TRACE_INCLUDE_FILE cmd_tracepoint 45 #include <trace/define_trace.h> 46