Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/hfi1: Add static trace for iowait

This patch adds the static trace for resource wait.

Reviewed-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

authored by

Kaike Wan and committed by
Jason Gunthorpe
15b796bc 5da0fc9d

+59 -1
+3
drivers/infiniband/hw/hfi1/iowait.c
··· 4 4 * 5 5 */ 6 6 #include "iowait.h" 7 + #include "trace_iowait.h" 7 8 8 9 void iowait_set_flag(struct iowait *wait, u32 flag) 9 10 { 11 + trace_hfi1_iowait_set(wait, flag); 10 12 set_bit(flag, &wait->flags); 11 13 } 12 14 ··· 19 17 20 18 inline void iowait_clear_flag(struct iowait *wait, u32 flag) 21 19 { 20 + trace_hfi1_iowait_clear(wait, flag); 22 21 clear_bit(flag, &wait->flags); 23 22 } 24 23
+2 -1
drivers/infiniband/hw/hfi1/trace.h
··· 1 1 /* 2 - * Copyright(c) 2015 - 2017 Intel Corporation. 2 + * Copyright(c) 2015 - 2018 Intel Corporation. 3 3 * 4 4 * This file is provided under a dual BSD/GPLv2 license. When using or 5 5 * redistributing this file, you may do so under either license. ··· 62 62 #include "trace_rx.h" 63 63 #include "trace_tx.h" 64 64 #include "trace_mmu.h" 65 + #include "trace_iowait.h"
+54
drivers/infiniband/hw/hfi1/trace_iowait.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ 2 + /* 3 + * Copyright(c) 2018 Intel Corporation. 4 + * 5 + */ 6 + #if !defined(__HFI1_TRACE_IOWAIT_H) || defined(TRACE_HEADER_MULTI_READ) 7 + #define __HFI1_TRACE_IOWAIT_H 8 + 9 + #include <linux/tracepoint.h> 10 + #include "iowait.h" 11 + #include "verbs.h" 12 + 13 + #undef TRACE_SYSTEM 14 + #define TRACE_SYSTEM hfi1_iowait 15 + 16 + DECLARE_EVENT_CLASS(hfi1_iowait_template, 17 + TP_PROTO(struct iowait *wait, u32 flag), 18 + TP_ARGS(wait, flag), 19 + TP_STRUCT__entry(/* entry */ 20 + __field(unsigned long, addr) 21 + __field(unsigned long, flags) 22 + __field(u32, flag) 23 + __field(u32, qpn) 24 + ), 25 + TP_fast_assign(/* assign */ 26 + __entry->addr = (unsigned long)wait; 27 + __entry->flags = wait->flags; 28 + __entry->flag = (1 << flag); 29 + __entry->qpn = iowait_to_qp(wait)->ibqp.qp_num; 30 + ), 31 + TP_printk(/* print */ 32 + "iowait 0x%lx qp %u flags 0x%lx flag 0x%x", 33 + __entry->addr, 34 + __entry->qpn, 35 + __entry->flags, 36 + __entry->flag 37 + ) 38 + ); 39 + 40 + DEFINE_EVENT(hfi1_iowait_template, hfi1_iowait_set, 41 + TP_PROTO(struct iowait *wait, u32 flag), 42 + TP_ARGS(wait, flag)); 43 + 44 + DEFINE_EVENT(hfi1_iowait_template, hfi1_iowait_clear, 45 + TP_PROTO(struct iowait *wait, u32 flag), 46 + TP_ARGS(wait, flag)); 47 + 48 + #endif /* __HFI1_TRACE_IOWAIT_H */ 49 + 50 + #undef TRACE_INCLUDE_PATH 51 + #undef TRACE_INCLUDE_FILE 52 + #define TRACE_INCLUDE_PATH . 53 + #define TRACE_INCLUDE_FILE trace_iowait 54 + #include <trace/define_trace.h>