diff options
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-devtrace-data.h | 79 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-devtrace-io.h | 155 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h | 200 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h | 97 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h | 81 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-devtrace.h | 438 |
6 files changed, 618 insertions, 432 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h new file mode 100644 index 000000000000..04e6649340b8 --- /dev/null +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * | ||
| 3 | * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of version 2 of the GNU General Public License as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
| 17 | * | ||
| 18 | * The full GNU General Public License is included in this distribution in the | ||
| 19 | * file called LICENSE. | ||
| 20 | * | ||
| 21 | * Contact Information: | ||
| 22 | * Intel Linux Wireless <ilw@linux.intel.com> | ||
| 23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
| 24 | * | ||
| 25 | *****************************************************************************/ | ||
| 26 | |||
| 27 | #if !defined(__IWLWIFI_DEVICE_TRACE_DATA) || defined(TRACE_HEADER_MULTI_READ) | ||
| 28 | #define __IWLWIFI_DEVICE_TRACE_DATA | ||
| 29 | |||
| 30 | #include <linux/tracepoint.h> | ||
| 31 | |||
| 32 | #undef TRACE_SYSTEM | ||
| 33 | #define TRACE_SYSTEM iwlwifi_data | ||
| 34 | |||
| 35 | TRACE_EVENT(iwlwifi_dev_tx_data, | ||
| 36 | TP_PROTO(const struct device *dev, | ||
| 37 | struct sk_buff *skb, | ||
| 38 | void *data, size_t data_len), | ||
| 39 | TP_ARGS(dev, skb, data, data_len), | ||
| 40 | TP_STRUCT__entry( | ||
| 41 | DEV_ENTRY | ||
| 42 | |||
| 43 | __dynamic_array(u8, data, iwl_trace_data(skb) ? data_len : 0) | ||
| 44 | ), | ||
| 45 | TP_fast_assign( | ||
| 46 | DEV_ASSIGN; | ||
| 47 | if (iwl_trace_data(skb)) | ||
| 48 | memcpy(__get_dynamic_array(data), data, data_len); | ||
| 49 | ), | ||
| 50 | TP_printk("[%s] TX frame data", __get_str(dev)) | ||
| 51 | ); | ||
| 52 | |||
| 53 | TRACE_EVENT(iwlwifi_dev_rx_data, | ||
| 54 | TP_PROTO(const struct device *dev, | ||
| 55 | const struct iwl_trans *trans, | ||
| 56 | void *rxbuf, size_t len), | ||
| 57 | TP_ARGS(dev, trans, rxbuf, len), | ||
| 58 | TP_STRUCT__entry( | ||
| 59 | DEV_ENTRY | ||
| 60 | |||
| 61 | __dynamic_array(u8, data, | ||
| 62 | len - iwl_rx_trace_len(trans, rxbuf, len)) | ||
| 63 | ), | ||
| 64 | TP_fast_assign( | ||
| 65 | size_t offs = iwl_rx_trace_len(trans, rxbuf, len); | ||
| 66 | DEV_ASSIGN; | ||
| 67 | if (offs < len) | ||
| 68 | memcpy(__get_dynamic_array(data), | ||
| 69 | ((u8 *)rxbuf) + offs, len - offs); | ||
| 70 | ), | ||
| 71 | TP_printk("[%s] RX frame data", __get_str(dev)) | ||
| 72 | ); | ||
| 73 | #endif /* __IWLWIFI_DEVICE_TRACE_DATA */ | ||
| 74 | |||
| 75 | #undef TRACE_INCLUDE_PATH | ||
| 76 | #define TRACE_INCLUDE_PATH . | ||
| 77 | #undef TRACE_INCLUDE_FILE | ||
| 78 | #define TRACE_INCLUDE_FILE iwl-devtrace-data | ||
| 79 | #include <trace/define_trace.h> | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-io.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-io.h new file mode 100644 index 000000000000..f62c54485852 --- /dev/null +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-io.h | |||
| @@ -0,0 +1,155 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * | ||
| 3 | * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of version 2 of the GNU General Public License as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
| 17 | * | ||
| 18 | * The full GNU General Public License is included in this distribution in the | ||
| 19 | * file called LICENSE. | ||
| 20 | * | ||
| 21 | * Contact Information: | ||
| 22 | * Intel Linux Wireless <ilw@linux.intel.com> | ||
| 23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
| 24 | * | ||
| 25 | *****************************************************************************/ | ||
| 26 | |||
| 27 | #if !defined(__IWLWIFI_DEVICE_TRACE_IO) || defined(TRACE_HEADER_MULTI_READ) | ||
| 28 | #define __IWLWIFI_DEVICE_TRACE_IO | ||
| 29 | |||
| 30 | #include <linux/tracepoint.h> | ||
| 31 | |||
| 32 | #undef TRACE_SYSTEM | ||
| 33 | #define TRACE_SYSTEM iwlwifi_io | ||
| 34 | |||
| 35 | TRACE_EVENT(iwlwifi_dev_ioread32, | ||
| 36 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
| 37 | TP_ARGS(dev, offs, val), | ||
| 38 | TP_STRUCT__entry( | ||
| 39 | DEV_ENTRY | ||
| 40 | __field(u32, offs) | ||
| 41 | __field(u32, val) | ||
| 42 | ), | ||
| 43 | TP_fast_assign( | ||
| 44 | DEV_ASSIGN; | ||
| 45 | __entry->offs = offs; | ||
| 46 | __entry->val = val; | ||
| 47 | ), | ||
| 48 | TP_printk("[%s] read io[%#x] = %#x", | ||
| 49 | __get_str(dev), __entry->offs, __entry->val) | ||
| 50 | ); | ||
| 51 | |||
| 52 | TRACE_EVENT(iwlwifi_dev_iowrite8, | ||
| 53 | TP_PROTO(const struct device *dev, u32 offs, u8 val), | ||
| 54 | TP_ARGS(dev, offs, val), | ||
| 55 | TP_STRUCT__entry( | ||
| 56 | DEV_ENTRY | ||
| 57 | __field(u32, offs) | ||
| 58 | __field(u8, val) | ||
| 59 | ), | ||
| 60 | TP_fast_assign( | ||
| 61 | DEV_ASSIGN; | ||
| 62 | __entry->offs = offs; | ||
| 63 | __entry->val = val; | ||
| 64 | ), | ||
| 65 | TP_printk("[%s] write io[%#x] = %#x)", | ||
| 66 | __get_str(dev), __entry->offs, __entry->val) | ||
| 67 | ); | ||
| 68 | |||
| 69 | TRACE_EVENT(iwlwifi_dev_iowrite32, | ||
| 70 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
| 71 | TP_ARGS(dev, offs, val), | ||
| 72 | TP_STRUCT__entry( | ||
| 73 | DEV_ENTRY | ||
| 74 | __field(u32, offs) | ||
| 75 | __field(u32, val) | ||
| 76 | ), | ||
| 77 | TP_fast_assign( | ||
| 78 | DEV_ASSIGN; | ||
| 79 | __entry->offs = offs; | ||
| 80 | __entry->val = val; | ||
| 81 | ), | ||
| 82 | TP_printk("[%s] write io[%#x] = %#x)", | ||
| 83 | __get_str(dev), __entry->offs, __entry->val) | ||
| 84 | ); | ||
| 85 | |||
| 86 | TRACE_EVENT(iwlwifi_dev_iowrite_prph32, | ||
| 87 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
| 88 | TP_ARGS(dev, offs, val), | ||
| 89 | TP_STRUCT__entry( | ||
| 90 | DEV_ENTRY | ||
| 91 | __field(u32, offs) | ||
| 92 | __field(u32, val) | ||
| 93 | ), | ||
| 94 | TP_fast_assign( | ||
| 95 | DEV_ASSIGN; | ||
| 96 | __entry->offs = offs; | ||
| 97 | __entry->val = val; | ||
| 98 | ), | ||
| 99 | TP_printk("[%s] write PRPH[%#x] = %#x)", | ||
| 100 | __get_str(dev), __entry->offs, __entry->val) | ||
| 101 | ); | ||
| 102 | |||
| 103 | TRACE_EVENT(iwlwifi_dev_ioread_prph32, | ||
| 104 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
| 105 | TP_ARGS(dev, offs, val), | ||
| 106 | TP_STRUCT__entry( | ||
| 107 | DEV_ENTRY | ||
| 108 | __field(u32, offs) | ||
| 109 | __field(u32, val) | ||
| 110 | ), | ||
| 111 | TP_fast_assign( | ||
| 112 | DEV_ASSIGN; | ||
| 113 | __entry->offs = offs; | ||
| 114 | __entry->val = val; | ||
| 115 | ), | ||
| 116 | TP_printk("[%s] read PRPH[%#x] = %#x", | ||
| 117 | __get_str(dev), __entry->offs, __entry->val) | ||
| 118 | ); | ||
| 119 | |||
| 120 | TRACE_EVENT(iwlwifi_dev_irq, | ||
| 121 | TP_PROTO(const struct device *dev), | ||
| 122 | TP_ARGS(dev), | ||
| 123 | TP_STRUCT__entry( | ||
| 124 | DEV_ENTRY | ||
| 125 | ), | ||
| 126 | TP_fast_assign( | ||
| 127 | DEV_ASSIGN; | ||
| 128 | ), | ||
| 129 | /* TP_printk("") doesn't compile */ | ||
| 130 | TP_printk("%d", 0) | ||
| 131 | ); | ||
| 132 | |||
| 133 | TRACE_EVENT(iwlwifi_dev_ict_read, | ||
| 134 | TP_PROTO(const struct device *dev, u32 index, u32 value), | ||
| 135 | TP_ARGS(dev, index, value), | ||
| 136 | TP_STRUCT__entry( | ||
| 137 | DEV_ENTRY | ||
| 138 | __field(u32, index) | ||
| 139 | __field(u32, value) | ||
| 140 | ), | ||
| 141 | TP_fast_assign( | ||
| 142 | DEV_ASSIGN; | ||
| 143 | __entry->index = index; | ||
| 144 | __entry->value = value; | ||
| 145 | ), | ||
| 146 | TP_printk("[%s] read ict[%d] = %#.8x", | ||
| 147 | __get_str(dev), __entry->index, __entry->value) | ||
| 148 | ); | ||
| 149 | #endif /* __IWLWIFI_DEVICE_TRACE_IO */ | ||
| 150 | |||
| 151 | #undef TRACE_INCLUDE_PATH | ||
| 152 | #define TRACE_INCLUDE_PATH . | ||
| 153 | #undef TRACE_INCLUDE_FILE | ||
| 154 | #define TRACE_INCLUDE_FILE iwl-devtrace-io | ||
| 155 | #include <trace/define_trace.h> | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h new file mode 100644 index 000000000000..6cb66a988271 --- /dev/null +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h | |||
| @@ -0,0 +1,200 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * | ||
| 3 | * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of version 2 of the GNU General Public License as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
| 17 | * | ||
| 18 | * The full GNU General Public License is included in this distribution in the | ||
| 19 | * file called LICENSE. | ||
| 20 | * | ||
| 21 | * Contact Information: | ||
| 22 | * Intel Linux Wireless <ilw@linux.intel.com> | ||
| 23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
| 24 | * | ||
| 25 | *****************************************************************************/ | ||
| 26 | |||
| 27 | #if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI) || defined(TRACE_HEADER_MULTI_READ) | ||
| 28 | #define __IWLWIFI_DEVICE_TRACE_IWLWIFI | ||
| 29 | |||
| 30 | #include <linux/tracepoint.h> | ||
| 31 | |||
| 32 | #undef TRACE_SYSTEM | ||
| 33 | #define TRACE_SYSTEM iwlwifi | ||
| 34 | |||
| 35 | TRACE_EVENT(iwlwifi_dev_hcmd, | ||
| 36 | TP_PROTO(const struct device *dev, | ||
| 37 | struct iwl_host_cmd *cmd, u16 total_size, | ||
| 38 | struct iwl_cmd_header *hdr), | ||
| 39 | TP_ARGS(dev, cmd, total_size, hdr), | ||
| 40 | TP_STRUCT__entry( | ||
| 41 | DEV_ENTRY | ||
| 42 | __dynamic_array(u8, hcmd, total_size) | ||
| 43 | __field(u32, flags) | ||
| 44 | ), | ||
| 45 | TP_fast_assign( | ||
| 46 | int i, offset = sizeof(*hdr); | ||
| 47 | |||
| 48 | DEV_ASSIGN; | ||
| 49 | __entry->flags = cmd->flags; | ||
| 50 | memcpy(__get_dynamic_array(hcmd), hdr, sizeof(*hdr)); | ||
| 51 | |||
| 52 | for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) { | ||
| 53 | if (!cmd->len[i]) | ||
| 54 | continue; | ||
| 55 | memcpy((u8 *)__get_dynamic_array(hcmd) + offset, | ||
| 56 | cmd->data[i], cmd->len[i]); | ||
| 57 | offset += cmd->len[i]; | ||
| 58 | } | ||
| 59 | ), | ||
| 60 | TP_printk("[%s] hcmd %#.2x (%ssync)", | ||
| 61 | __get_str(dev), ((u8 *)__get_dynamic_array(hcmd))[0], | ||
| 62 | __entry->flags & CMD_ASYNC ? "a" : "") | ||
| 63 | ); | ||
| 64 | |||
| 65 | TRACE_EVENT(iwlwifi_dev_rx, | ||
| 66 | TP_PROTO(const struct device *dev, const struct iwl_trans *trans, | ||
| 67 | void *rxbuf, size_t len), | ||
| 68 | TP_ARGS(dev, trans, rxbuf, len), | ||
| 69 | TP_STRUCT__entry( | ||
| 70 | DEV_ENTRY | ||
| 71 | __dynamic_array(u8, rxbuf, iwl_rx_trace_len(trans, rxbuf, len)) | ||
| 72 | ), | ||
| 73 | TP_fast_assign( | ||
| 74 | DEV_ASSIGN; | ||
| 75 | memcpy(__get_dynamic_array(rxbuf), rxbuf, | ||
| 76 | iwl_rx_trace_len(trans, rxbuf, len)); | ||
| 77 | ), | ||
| 78 | TP_printk("[%s] RX cmd %#.2x", | ||
| 79 | __get_str(dev), ((u8 *)__get_dynamic_array(rxbuf))[4]) | ||
| 80 | ); | ||
| 81 | |||
| 82 | TRACE_EVENT(iwlwifi_dev_tx, | ||
| 83 | TP_PROTO(const struct device *dev, struct sk_buff *skb, | ||
| 84 | void *tfd, size_t tfdlen, | ||
| 85 | void *buf0, size_t buf0_len, | ||
| 86 | void *buf1, size_t buf1_len), | ||
| 87 | TP_ARGS(dev, skb, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len), | ||
| 88 | TP_STRUCT__entry( | ||
| 89 | DEV_ENTRY | ||
| 90 | |||
| 91 | __field(size_t, framelen) | ||
| 92 | __dynamic_array(u8, tfd, tfdlen) | ||
| 93 | |||
| 94 | /* | ||
| 95 | * Do not insert between or below these items, | ||
| 96 | * we want to keep the frame together (except | ||
| 97 | * for the possible padding). | ||
| 98 | */ | ||
| 99 | __dynamic_array(u8, buf0, buf0_len) | ||
| 100 | __dynamic_array(u8, buf1, iwl_trace_data(skb) ? 0 : buf1_len) | ||
| 101 | ), | ||
| 102 | TP_fast_assign( | ||
| 103 | DEV_ASSIGN; | ||
| 104 | __entry->framelen = buf0_len + buf1_len; | ||
| 105 | memcpy(__get_dynamic_array(tfd), tfd, tfdlen); | ||
| 106 | memcpy(__get_dynamic_array(buf0), buf0, buf0_len); | ||
| 107 | if (!iwl_trace_data(skb)) | ||
| 108 | memcpy(__get_dynamic_array(buf1), buf1, buf1_len); | ||
| 109 | ), | ||
| 110 | TP_printk("[%s] TX %.2x (%zu bytes)", | ||
| 111 | __get_str(dev), ((u8 *)__get_dynamic_array(buf0))[0], | ||
| 112 | __entry->framelen) | ||
| 113 | ); | ||
| 114 | |||
| 115 | TRACE_EVENT(iwlwifi_dev_ucode_error, | ||
| 116 | TP_PROTO(const struct device *dev, u32 desc, u32 tsf_low, | ||
| 117 | u32 data1, u32 data2, u32 line, u32 blink1, | ||
| 118 | u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time, | ||
| 119 | u32 gp1, u32 gp2, u32 gp3, u32 ucode_ver, u32 hw_ver, | ||
| 120 | u32 brd_ver), | ||
| 121 | TP_ARGS(dev, desc, tsf_low, data1, data2, line, | ||
| 122 | blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2, | ||
| 123 | gp3, ucode_ver, hw_ver, brd_ver), | ||
| 124 | TP_STRUCT__entry( | ||
| 125 | DEV_ENTRY | ||
| 126 | __field(u32, desc) | ||
| 127 | __field(u32, tsf_low) | ||
| 128 | __field(u32, data1) | ||
| 129 | __field(u32, data2) | ||
| 130 | __field(u32, line) | ||
| 131 | __field(u32, blink1) | ||
| 132 | __field(u32, blink2) | ||
| 133 | __field(u32, ilink1) | ||
| 134 | __field(u32, ilink2) | ||
| 135 | __field(u32, bcon_time) | ||
| 136 | __field(u32, gp1) | ||
| 137 | __field(u32, gp2) | ||
| 138 | __field(u32, gp3) | ||
| 139 | __field(u32, ucode_ver) | ||
| 140 | __field(u32, hw_ver) | ||
| 141 | __field(u32, brd_ver) | ||
| 142 | ), | ||
| 143 | TP_fast_assign( | ||
| 144 | DEV_ASSIGN; | ||
| 145 | __entry->desc = desc; | ||
| 146 | __entry->tsf_low = tsf_low; | ||
| 147 | __entry->data1 = data1; | ||
| 148 | __entry->data2 = data2; | ||
| 149 | __entry->line = line; | ||
| 150 | __entry->blink1 = blink1; | ||
| 151 | __entry->blink2 = blink2; | ||
| 152 | __entry->ilink1 = ilink1; | ||
| 153 | __entry->ilink2 = ilink2; | ||
| 154 | __entry->bcon_time = bcon_time; | ||
| 155 | __entry->gp1 = gp1; | ||
| 156 | __entry->gp2 = gp2; | ||
| 157 | __entry->gp3 = gp3; | ||
| 158 | __entry->ucode_ver = ucode_ver; | ||
| 159 | __entry->hw_ver = hw_ver; | ||
| 160 | __entry->brd_ver = brd_ver; | ||
| 161 | ), | ||
| 162 | TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, " | ||
| 163 | "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X " | ||
| 164 | "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X uCode 0x%08X " | ||
| 165 | "hw 0x%08X brd 0x%08X", | ||
| 166 | __get_str(dev), __entry->desc, __entry->tsf_low, | ||
| 167 | __entry->data1, | ||
| 168 | __entry->data2, __entry->line, __entry->blink1, | ||
| 169 | __entry->blink2, __entry->ilink1, __entry->ilink2, | ||
| 170 | __entry->bcon_time, __entry->gp1, __entry->gp2, | ||
| 171 | __entry->gp3, __entry->ucode_ver, __entry->hw_ver, | ||
| 172 | __entry->brd_ver) | ||
| 173 | ); | ||
| 174 | |||
| 175 | TRACE_EVENT(iwlwifi_dev_ucode_event, | ||
| 176 | TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev), | ||
| 177 | TP_ARGS(dev, time, data, ev), | ||
| 178 | TP_STRUCT__entry( | ||
| 179 | DEV_ENTRY | ||
| 180 | |||
| 181 | __field(u32, time) | ||
| 182 | __field(u32, data) | ||
| 183 | __field(u32, ev) | ||
| 184 | ), | ||
| 185 | TP_fast_assign( | ||
| 186 | DEV_ASSIGN; | ||
| 187 | __entry->time = time; | ||
| 188 | __entry->data = data; | ||
| 189 | __entry->ev = ev; | ||
| 190 | ), | ||
| 191 | TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u", | ||
| 192 | __get_str(dev), __entry->time, __entry->data, __entry->ev) | ||
| 193 | ); | ||
| 194 | #endif /* __IWLWIFI_DEVICE_TRACE_IWLWIFI */ | ||
| 195 | |||
| 196 | #undef TRACE_INCLUDE_PATH | ||
| 197 | #define TRACE_INCLUDE_PATH . | ||
| 198 | #undef TRACE_INCLUDE_FILE | ||
| 199 | #define TRACE_INCLUDE_FILE iwl-devtrace-iwlwifi | ||
| 200 | #include <trace/define_trace.h> | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h new file mode 100644 index 000000000000..a3b3c2465f89 --- /dev/null +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-msg.h | |||
| @@ -0,0 +1,97 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * | ||
| 3 | * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of version 2 of the GNU General Public License as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
| 17 | * | ||
| 18 | * The full GNU General Public License is included in this distribution in the | ||
| 19 | * file called LICENSE. | ||
| 20 | * | ||
| 21 | * Contact Information: | ||
| 22 | * Intel Linux Wireless <ilw@linux.intel.com> | ||
| 23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
| 24 | * | ||
| 25 | *****************************************************************************/ | ||
| 26 | |||
| 27 | #if !defined(__IWLWIFI_DEVICE_TRACE_MSG) || defined(TRACE_HEADER_MULTI_READ) | ||
| 28 | #define __IWLWIFI_DEVICE_TRACE_MSG | ||
| 29 | |||
| 30 | #include <linux/tracepoint.h> | ||
| 31 | |||
| 32 | #undef TRACE_SYSTEM | ||
| 33 | #define TRACE_SYSTEM iwlwifi_msg | ||
| 34 | |||
| 35 | #define MAX_MSG_LEN 110 | ||
| 36 | |||
| 37 | DECLARE_EVENT_CLASS(iwlwifi_msg_event, | ||
| 38 | TP_PROTO(struct va_format *vaf), | ||
| 39 | TP_ARGS(vaf), | ||
| 40 | TP_STRUCT__entry( | ||
| 41 | __dynamic_array(char, msg, MAX_MSG_LEN) | ||
| 42 | ), | ||
| 43 | TP_fast_assign( | ||
| 44 | WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), | ||
| 45 | MAX_MSG_LEN, vaf->fmt, | ||
| 46 | *vaf->va) >= MAX_MSG_LEN); | ||
| 47 | ), | ||
| 48 | TP_printk("%s", __get_str(msg)) | ||
| 49 | ); | ||
| 50 | |||
| 51 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err, | ||
| 52 | TP_PROTO(struct va_format *vaf), | ||
| 53 | TP_ARGS(vaf) | ||
| 54 | ); | ||
| 55 | |||
| 56 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn, | ||
| 57 | TP_PROTO(struct va_format *vaf), | ||
| 58 | TP_ARGS(vaf) | ||
| 59 | ); | ||
| 60 | |||
| 61 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info, | ||
| 62 | TP_PROTO(struct va_format *vaf), | ||
| 63 | TP_ARGS(vaf) | ||
| 64 | ); | ||
| 65 | |||
| 66 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit, | ||
| 67 | TP_PROTO(struct va_format *vaf), | ||
| 68 | TP_ARGS(vaf) | ||
| 69 | ); | ||
| 70 | |||
| 71 | TRACE_EVENT(iwlwifi_dbg, | ||
| 72 | TP_PROTO(u32 level, bool in_interrupt, const char *function, | ||
| 73 | struct va_format *vaf), | ||
| 74 | TP_ARGS(level, in_interrupt, function, vaf), | ||
| 75 | TP_STRUCT__entry( | ||
| 76 | __field(u32, level) | ||
| 77 | __field(u8, in_interrupt) | ||
| 78 | __string(function, function) | ||
| 79 | __dynamic_array(char, msg, MAX_MSG_LEN) | ||
| 80 | ), | ||
| 81 | TP_fast_assign( | ||
| 82 | __entry->level = level; | ||
| 83 | __entry->in_interrupt = in_interrupt; | ||
| 84 | __assign_str(function, function); | ||
| 85 | WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), | ||
| 86 | MAX_MSG_LEN, vaf->fmt, | ||
| 87 | *vaf->va) >= MAX_MSG_LEN); | ||
| 88 | ), | ||
| 89 | TP_printk("%s", __get_str(msg)) | ||
| 90 | ); | ||
| 91 | #endif /* __IWLWIFI_DEVICE_TRACE_MSG */ | ||
| 92 | |||
| 93 | #undef TRACE_INCLUDE_PATH | ||
| 94 | #define TRACE_INCLUDE_PATH . | ||
| 95 | #undef TRACE_INCLUDE_FILE | ||
| 96 | #define TRACE_INCLUDE_FILE iwl-devtrace-msg | ||
| 97 | #include <trace/define_trace.h> | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h new file mode 100644 index 000000000000..10839fae9cd9 --- /dev/null +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-ucode.h | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * | ||
| 3 | * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of version 2 of the GNU General Public License as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
| 17 | * | ||
| 18 | * The full GNU General Public License is included in this distribution in the | ||
| 19 | * file called LICENSE. | ||
| 20 | * | ||
| 21 | * Contact Information: | ||
| 22 | * Intel Linux Wireless <ilw@linux.intel.com> | ||
| 23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
| 24 | * | ||
| 25 | *****************************************************************************/ | ||
| 26 | |||
| 27 | #if !defined(__IWLWIFI_DEVICE_TRACE_UCODE) || defined(TRACE_HEADER_MULTI_READ) | ||
| 28 | #define __IWLWIFI_DEVICE_TRACE_UCODE | ||
| 29 | |||
| 30 | #include <linux/tracepoint.h> | ||
| 31 | |||
| 32 | #undef TRACE_SYSTEM | ||
| 33 | #define TRACE_SYSTEM iwlwifi_ucode | ||
| 34 | |||
| 35 | TRACE_EVENT(iwlwifi_dev_ucode_cont_event, | ||
| 36 | TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev), | ||
| 37 | TP_ARGS(dev, time, data, ev), | ||
| 38 | TP_STRUCT__entry( | ||
| 39 | DEV_ENTRY | ||
| 40 | |||
| 41 | __field(u32, time) | ||
| 42 | __field(u32, data) | ||
| 43 | __field(u32, ev) | ||
| 44 | ), | ||
| 45 | TP_fast_assign( | ||
| 46 | DEV_ASSIGN; | ||
| 47 | __entry->time = time; | ||
| 48 | __entry->data = data; | ||
| 49 | __entry->ev = ev; | ||
| 50 | ), | ||
| 51 | TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u", | ||
| 52 | __get_str(dev), __entry->time, __entry->data, __entry->ev) | ||
| 53 | ); | ||
| 54 | |||
| 55 | TRACE_EVENT(iwlwifi_dev_ucode_wrap_event, | ||
| 56 | TP_PROTO(const struct device *dev, u32 wraps, u32 n_entry, u32 p_entry), | ||
| 57 | TP_ARGS(dev, wraps, n_entry, p_entry), | ||
| 58 | TP_STRUCT__entry( | ||
| 59 | DEV_ENTRY | ||
| 60 | |||
| 61 | __field(u32, wraps) | ||
| 62 | __field(u32, n_entry) | ||
| 63 | __field(u32, p_entry) | ||
| 64 | ), | ||
| 65 | TP_fast_assign( | ||
| 66 | DEV_ASSIGN; | ||
| 67 | __entry->wraps = wraps; | ||
| 68 | __entry->n_entry = n_entry; | ||
| 69 | __entry->p_entry = p_entry; | ||
| 70 | ), | ||
| 71 | TP_printk("[%s] wraps=#%02d n=0x%X p=0x%X", | ||
| 72 | __get_str(dev), __entry->wraps, __entry->n_entry, | ||
| 73 | __entry->p_entry) | ||
| 74 | ); | ||
| 75 | #endif /* __IWLWIFI_DEVICE_TRACE_UCODE */ | ||
| 76 | |||
| 77 | #undef TRACE_INCLUDE_PATH | ||
| 78 | #define TRACE_INCLUDE_PATH . | ||
| 79 | #undef TRACE_INCLUDE_FILE | ||
| 80 | #define TRACE_INCLUDE_FILE iwl-devtrace-ucode | ||
| 81 | #include <trace/define_trace.h> | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/iwlwifi/iwl-devtrace.h index 78bd41bf34b0..b87acd6a229b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-devtrace.h +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.h | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | * | 24 | * |
| 25 | *****************************************************************************/ | 25 | *****************************************************************************/ |
| 26 | 26 | ||
| 27 | #if !defined(__IWLWIFI_DEVICE_TRACE) || defined(TRACE_HEADER_MULTI_READ) | 27 | #ifndef __IWLWIFI_DEVICE_TRACE |
| 28 | #include <linux/skbuff.h> | 28 | #include <linux/skbuff.h> |
| 29 | #include <linux/ieee80211.h> | 29 | #include <linux/ieee80211.h> |
| 30 | #include <net/cfg80211.h> | 30 | #include <net/cfg80211.h> |
| @@ -80,436 +80,10 @@ static inline void trace_ ## name(proto) {} | |||
| 80 | #define DEV_ENTRY __string(dev, dev_name(dev)) | 80 | #define DEV_ENTRY __string(dev, dev_name(dev)) |
| 81 | #define DEV_ASSIGN __assign_str(dev, dev_name(dev)) | 81 | #define DEV_ASSIGN __assign_str(dev, dev_name(dev)) |
| 82 | 82 | ||
| 83 | #undef TRACE_SYSTEM | 83 | #include "iwl-devtrace-io.h" |
| 84 | #define TRACE_SYSTEM iwlwifi_io | 84 | #include "iwl-devtrace-ucode.h" |
| 85 | #include "iwl-devtrace-msg.h" | ||
| 86 | #include "iwl-devtrace-data.h" | ||
| 87 | #include "iwl-devtrace-iwlwifi.h" | ||
| 85 | 88 | ||
| 86 | TRACE_EVENT(iwlwifi_dev_ioread32, | ||
| 87 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
| 88 | TP_ARGS(dev, offs, val), | ||
| 89 | TP_STRUCT__entry( | ||
| 90 | DEV_ENTRY | ||
| 91 | __field(u32, offs) | ||
| 92 | __field(u32, val) | ||
| 93 | ), | ||
| 94 | TP_fast_assign( | ||
| 95 | DEV_ASSIGN; | ||
| 96 | __entry->offs = offs; | ||
| 97 | __entry->val = val; | ||
| 98 | ), | ||
| 99 | TP_printk("[%s] read io[%#x] = %#x", | ||
| 100 | __get_str(dev), __entry->offs, __entry->val) | ||
| 101 | ); | ||
| 102 | |||
| 103 | TRACE_EVENT(iwlwifi_dev_iowrite8, | ||
| 104 | TP_PROTO(const struct device *dev, u32 offs, u8 val), | ||
| 105 | TP_ARGS(dev, offs, val), | ||
| 106 | TP_STRUCT__entry( | ||
| 107 | DEV_ENTRY | ||
| 108 | __field(u32, offs) | ||
| 109 | __field(u8, val) | ||
| 110 | ), | ||
| 111 | TP_fast_assign( | ||
| 112 | DEV_ASSIGN; | ||
| 113 | __entry->offs = offs; | ||
| 114 | __entry->val = val; | ||
| 115 | ), | ||
| 116 | TP_printk("[%s] write io[%#x] = %#x)", | ||
| 117 | __get_str(dev), __entry->offs, __entry->val) | ||
| 118 | ); | ||
| 119 | |||
| 120 | TRACE_EVENT(iwlwifi_dev_iowrite32, | ||
| 121 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
| 122 | TP_ARGS(dev, offs, val), | ||
| 123 | TP_STRUCT__entry( | ||
| 124 | DEV_ENTRY | ||
| 125 | __field(u32, offs) | ||
| 126 | __field(u32, val) | ||
| 127 | ), | ||
| 128 | TP_fast_assign( | ||
| 129 | DEV_ASSIGN; | ||
| 130 | __entry->offs = offs; | ||
| 131 | __entry->val = val; | ||
| 132 | ), | ||
| 133 | TP_printk("[%s] write io[%#x] = %#x)", | ||
| 134 | __get_str(dev), __entry->offs, __entry->val) | ||
| 135 | ); | ||
| 136 | |||
| 137 | TRACE_EVENT(iwlwifi_dev_iowrite_prph32, | ||
| 138 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
| 139 | TP_ARGS(dev, offs, val), | ||
| 140 | TP_STRUCT__entry( | ||
| 141 | DEV_ENTRY | ||
| 142 | __field(u32, offs) | ||
| 143 | __field(u32, val) | ||
| 144 | ), | ||
| 145 | TP_fast_assign( | ||
| 146 | DEV_ASSIGN; | ||
| 147 | __entry->offs = offs; | ||
| 148 | __entry->val = val; | ||
| 149 | ), | ||
| 150 | TP_printk("[%s] write PRPH[%#x] = %#x)", | ||
| 151 | __get_str(dev), __entry->offs, __entry->val) | ||
| 152 | ); | ||
| 153 | |||
| 154 | TRACE_EVENT(iwlwifi_dev_ioread_prph32, | ||
| 155 | TP_PROTO(const struct device *dev, u32 offs, u32 val), | ||
| 156 | TP_ARGS(dev, offs, val), | ||
| 157 | TP_STRUCT__entry( | ||
| 158 | DEV_ENTRY | ||
| 159 | __field(u32, offs) | ||
| 160 | __field(u32, val) | ||
| 161 | ), | ||
| 162 | TP_fast_assign( | ||
| 163 | DEV_ASSIGN; | ||
| 164 | __entry->offs = offs; | ||
| 165 | __entry->val = val; | ||
| 166 | ), | ||
| 167 | TP_printk("[%s] read PRPH[%#x] = %#x", | ||
| 168 | __get_str(dev), __entry->offs, __entry->val) | ||
| 169 | ); | ||
| 170 | |||
| 171 | TRACE_EVENT(iwlwifi_dev_irq, | ||
| 172 | TP_PROTO(const struct device *dev), | ||
| 173 | TP_ARGS(dev), | ||
| 174 | TP_STRUCT__entry( | ||
| 175 | DEV_ENTRY | ||
| 176 | ), | ||
| 177 | TP_fast_assign( | ||
| 178 | DEV_ASSIGN; | ||
| 179 | ), | ||
| 180 | /* TP_printk("") doesn't compile */ | ||
| 181 | TP_printk("%d", 0) | ||
| 182 | ); | ||
| 183 | |||
| 184 | TRACE_EVENT(iwlwifi_dev_ict_read, | ||
| 185 | TP_PROTO(const struct device *dev, u32 index, u32 value), | ||
| 186 | TP_ARGS(dev, index, value), | ||
| 187 | TP_STRUCT__entry( | ||
| 188 | DEV_ENTRY | ||
| 189 | __field(u32, index) | ||
| 190 | __field(u32, value) | ||
| 191 | ), | ||
| 192 | TP_fast_assign( | ||
| 193 | DEV_ASSIGN; | ||
| 194 | __entry->index = index; | ||
| 195 | __entry->value = value; | ||
| 196 | ), | ||
| 197 | TP_printk("[%s] read ict[%d] = %#.8x", | ||
| 198 | __get_str(dev), __entry->index, __entry->value) | ||
| 199 | ); | ||
| 200 | |||
| 201 | #undef TRACE_SYSTEM | ||
| 202 | #define TRACE_SYSTEM iwlwifi_ucode | ||
| 203 | |||
| 204 | TRACE_EVENT(iwlwifi_dev_ucode_cont_event, | ||
| 205 | TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev), | ||
| 206 | TP_ARGS(dev, time, data, ev), | ||
| 207 | TP_STRUCT__entry( | ||
| 208 | DEV_ENTRY | ||
| 209 | |||
| 210 | __field(u32, time) | ||
| 211 | __field(u32, data) | ||
| 212 | __field(u32, ev) | ||
| 213 | ), | ||
| 214 | TP_fast_assign( | ||
| 215 | DEV_ASSIGN; | ||
| 216 | __entry->time = time; | ||
| 217 | __entry->data = data; | ||
| 218 | __entry->ev = ev; | ||
| 219 | ), | ||
| 220 | TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u", | ||
| 221 | __get_str(dev), __entry->time, __entry->data, __entry->ev) | ||
| 222 | ); | ||
| 223 | |||
| 224 | TRACE_EVENT(iwlwifi_dev_ucode_wrap_event, | ||
| 225 | TP_PROTO(const struct device *dev, u32 wraps, u32 n_entry, u32 p_entry), | ||
| 226 | TP_ARGS(dev, wraps, n_entry, p_entry), | ||
| 227 | TP_STRUCT__entry( | ||
| 228 | DEV_ENTRY | ||
| 229 | |||
| 230 | __field(u32, wraps) | ||
| 231 | __field(u32, n_entry) | ||
| 232 | __field(u32, p_entry) | ||
| 233 | ), | ||
| 234 | TP_fast_assign( | ||
| 235 | DEV_ASSIGN; | ||
| 236 | __entry->wraps = wraps; | ||
| 237 | __entry->n_entry = n_entry; | ||
| 238 | __entry->p_entry = p_entry; | ||
| 239 | ), | ||
| 240 | TP_printk("[%s] wraps=#%02d n=0x%X p=0x%X", | ||
| 241 | __get_str(dev), __entry->wraps, __entry->n_entry, | ||
| 242 | __entry->p_entry) | ||
| 243 | ); | ||
| 244 | |||
| 245 | #undef TRACE_SYSTEM | ||
| 246 | #define TRACE_SYSTEM iwlwifi_msg | ||
| 247 | |||
| 248 | #define MAX_MSG_LEN 110 | ||
| 249 | |||
| 250 | DECLARE_EVENT_CLASS(iwlwifi_msg_event, | ||
| 251 | TP_PROTO(struct va_format *vaf), | ||
| 252 | TP_ARGS(vaf), | ||
| 253 | TP_STRUCT__entry( | ||
| 254 | __dynamic_array(char, msg, MAX_MSG_LEN) | ||
| 255 | ), | ||
| 256 | TP_fast_assign( | ||
| 257 | WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), | ||
| 258 | MAX_MSG_LEN, vaf->fmt, | ||
| 259 | *vaf->va) >= MAX_MSG_LEN); | ||
| 260 | ), | ||
| 261 | TP_printk("%s", __get_str(msg)) | ||
| 262 | ); | ||
| 263 | |||
| 264 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err, | ||
| 265 | TP_PROTO(struct va_format *vaf), | ||
| 266 | TP_ARGS(vaf) | ||
| 267 | ); | ||
| 268 | |||
| 269 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn, | ||
| 270 | TP_PROTO(struct va_format *vaf), | ||
| 271 | TP_ARGS(vaf) | ||
| 272 | ); | ||
| 273 | |||
| 274 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info, | ||
| 275 | TP_PROTO(struct va_format *vaf), | ||
| 276 | TP_ARGS(vaf) | ||
| 277 | ); | ||
| 278 | |||
| 279 | DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit, | ||
| 280 | TP_PROTO(struct va_format *vaf), | ||
| 281 | TP_ARGS(vaf) | ||
| 282 | ); | ||
| 283 | |||
| 284 | TRACE_EVENT(iwlwifi_dbg, | ||
| 285 | TP_PROTO(u32 level, bool in_interrupt, const char *function, | ||
| 286 | struct va_format *vaf), | ||
| 287 | TP_ARGS(level, in_interrupt, function, vaf), | ||
| 288 | TP_STRUCT__entry( | ||
| 289 | __field(u32, level) | ||
| 290 | __field(u8, in_interrupt) | ||
| 291 | __string(function, function) | ||
| 292 | __dynamic_array(char, msg, MAX_MSG_LEN) | ||
| 293 | ), | ||
| 294 | TP_fast_assign( | ||
| 295 | __entry->level = level; | ||
| 296 | __entry->in_interrupt = in_interrupt; | ||
| 297 | __assign_str(function, function); | ||
| 298 | WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), | ||
| 299 | MAX_MSG_LEN, vaf->fmt, | ||
| 300 | *vaf->va) >= MAX_MSG_LEN); | ||
| 301 | ), | ||
| 302 | TP_printk("%s", __get_str(msg)) | ||
| 303 | ); | ||
| 304 | |||
| 305 | #undef TRACE_SYSTEM | ||
| 306 | #define TRACE_SYSTEM iwlwifi_data | ||
| 307 | |||
| 308 | TRACE_EVENT(iwlwifi_dev_tx_data, | ||
| 309 | TP_PROTO(const struct device *dev, | ||
| 310 | struct sk_buff *skb, | ||
| 311 | void *data, size_t data_len), | ||
| 312 | TP_ARGS(dev, skb, data, data_len), | ||
| 313 | TP_STRUCT__entry( | ||
| 314 | DEV_ENTRY | ||
| 315 | |||
| 316 | __dynamic_array(u8, data, iwl_trace_data(skb) ? data_len : 0) | ||
| 317 | ), | ||
| 318 | TP_fast_assign( | ||
| 319 | DEV_ASSIGN; | ||
| 320 | if (iwl_trace_data(skb)) | ||
| 321 | memcpy(__get_dynamic_array(data), data, data_len); | ||
| 322 | ), | ||
| 323 | TP_printk("[%s] TX frame data", __get_str(dev)) | ||
| 324 | ); | ||
| 325 | |||
| 326 | TRACE_EVENT(iwlwifi_dev_rx_data, | ||
| 327 | TP_PROTO(const struct device *dev, | ||
| 328 | const struct iwl_trans *trans, | ||
| 329 | void *rxbuf, size_t len), | ||
| 330 | TP_ARGS(dev, trans, rxbuf, len), | ||
| 331 | TP_STRUCT__entry( | ||
| 332 | DEV_ENTRY | ||
| 333 | |||
| 334 | __dynamic_array(u8, data, | ||
| 335 | len - iwl_rx_trace_len(trans, rxbuf, len)) | ||
| 336 | ), | ||
| 337 | TP_fast_assign( | ||
| 338 | size_t offs = iwl_rx_trace_len(trans, rxbuf, len); | ||
| 339 | DEV_ASSIGN; | ||
| 340 | if (offs < len) | ||
| 341 | memcpy(__get_dynamic_array(data), | ||
| 342 | ((u8 *)rxbuf) + offs, len - offs); | ||
| 343 | ), | ||
| 344 | TP_printk("[%s] RX frame data", __get_str(dev)) | ||
| 345 | ); | ||
| 346 | |||
| 347 | #undef TRACE_SYSTEM | ||
| 348 | #define TRACE_SYSTEM iwlwifi | ||
| 349 | |||
| 350 | TRACE_EVENT(iwlwifi_dev_hcmd, | ||
| 351 | TP_PROTO(const struct device *dev, | ||
| 352 | struct iwl_host_cmd *cmd, u16 total_size, | ||
| 353 | struct iwl_cmd_header *hdr), | ||
| 354 | TP_ARGS(dev, cmd, total_size, hdr), | ||
| 355 | TP_STRUCT__entry( | ||
| 356 | DEV_ENTRY | ||
| 357 | __dynamic_array(u8, hcmd, total_size) | ||
| 358 | __field(u32, flags) | ||
| 359 | ), | ||
| 360 | TP_fast_assign( | ||
| 361 | int i, offset = sizeof(*hdr); | ||
| 362 | |||
| 363 | DEV_ASSIGN; | ||
| 364 | __entry->flags = cmd->flags; | ||
| 365 | memcpy(__get_dynamic_array(hcmd), hdr, sizeof(*hdr)); | ||
| 366 | |||
| 367 | for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) { | ||
| 368 | if (!cmd->len[i]) | ||
| 369 | continue; | ||
| 370 | memcpy((u8 *)__get_dynamic_array(hcmd) + offset, | ||
| 371 | cmd->data[i], cmd->len[i]); | ||
| 372 | offset += cmd->len[i]; | ||
| 373 | } | ||
| 374 | ), | ||
| 375 | TP_printk("[%s] hcmd %#.2x (%ssync)", | ||
| 376 | __get_str(dev), ((u8 *)__get_dynamic_array(hcmd))[0], | ||
| 377 | __entry->flags & CMD_ASYNC ? "a" : "") | ||
| 378 | ); | ||
| 379 | |||
| 380 | TRACE_EVENT(iwlwifi_dev_rx, | ||
| 381 | TP_PROTO(const struct device *dev, const struct iwl_trans *trans, | ||
| 382 | void *rxbuf, size_t len), | ||
| 383 | TP_ARGS(dev, trans, rxbuf, len), | ||
| 384 | TP_STRUCT__entry( | ||
| 385 | DEV_ENTRY | ||
| 386 | __dynamic_array(u8, rxbuf, iwl_rx_trace_len(trans, rxbuf, len)) | ||
| 387 | ), | ||
| 388 | TP_fast_assign( | ||
| 389 | DEV_ASSIGN; | ||
| 390 | memcpy(__get_dynamic_array(rxbuf), rxbuf, | ||
| 391 | iwl_rx_trace_len(trans, rxbuf, len)); | ||
| 392 | ), | ||
| 393 | TP_printk("[%s] RX cmd %#.2x", | ||
| 394 | __get_str(dev), ((u8 *)__get_dynamic_array(rxbuf))[4]) | ||
| 395 | ); | ||
| 396 | |||
| 397 | TRACE_EVENT(iwlwifi_dev_tx, | ||
| 398 | TP_PROTO(const struct device *dev, struct sk_buff *skb, | ||
| 399 | void *tfd, size_t tfdlen, | ||
| 400 | void *buf0, size_t buf0_len, | ||
| 401 | void *buf1, size_t buf1_len), | ||
| 402 | TP_ARGS(dev, skb, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len), | ||
| 403 | TP_STRUCT__entry( | ||
| 404 | DEV_ENTRY | ||
| 405 | |||
| 406 | __field(size_t, framelen) | ||
| 407 | __dynamic_array(u8, tfd, tfdlen) | ||
| 408 | |||
| 409 | /* | ||
| 410 | * Do not insert between or below these items, | ||
| 411 | * we want to keep the frame together (except | ||
| 412 | * for the possible padding). | ||
| 413 | */ | ||
| 414 | __dynamic_array(u8, buf0, buf0_len) | ||
| 415 | __dynamic_array(u8, buf1, iwl_trace_data(skb) ? 0 : buf1_len) | ||
| 416 | ), | ||
| 417 | TP_fast_assign( | ||
| 418 | DEV_ASSIGN; | ||
| 419 | __entry->framelen = buf0_len + buf1_len; | ||
| 420 | memcpy(__get_dynamic_array(tfd), tfd, tfdlen); | ||
| 421 | memcpy(__get_dynamic_array(buf0), buf0, buf0_len); | ||
| 422 | if (!iwl_trace_data(skb)) | ||
| 423 | memcpy(__get_dynamic_array(buf1), buf1, buf1_len); | ||
| 424 | ), | ||
| 425 | TP_printk("[%s] TX %.2x (%zu bytes)", | ||
| 426 | __get_str(dev), ((u8 *)__get_dynamic_array(buf0))[0], | ||
| 427 | __entry->framelen) | ||
| 428 | ); | ||
| 429 | |||
| 430 | TRACE_EVENT(iwlwifi_dev_ucode_error, | ||
| 431 | TP_PROTO(const struct device *dev, u32 desc, u32 tsf_low, | ||
| 432 | u32 data1, u32 data2, u32 line, u32 blink1, | ||
| 433 | u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time, | ||
| 434 | u32 gp1, u32 gp2, u32 gp3, u32 ucode_ver, u32 hw_ver, | ||
| 435 | u32 brd_ver), | ||
| 436 | TP_ARGS(dev, desc, tsf_low, data1, data2, line, | ||
| 437 | blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2, | ||
| 438 | gp3, ucode_ver, hw_ver, brd_ver), | ||
| 439 | TP_STRUCT__entry( | ||
| 440 | DEV_ENTRY | ||
| 441 | __field(u32, desc) | ||
| 442 | __field(u32, tsf_low) | ||
| 443 | __field(u32, data1) | ||
| 444 | __field(u32, data2) | ||
| 445 | __field(u32, line) | ||
| 446 | __field(u32, blink1) | ||
| 447 | __field(u32, blink2) | ||
| 448 | __field(u32, ilink1) | ||
| 449 | __field(u32, ilink2) | ||
| 450 | __field(u32, bcon_time) | ||
| 451 | __field(u32, gp1) | ||
| 452 | __field(u32, gp2) | ||
| 453 | __field(u32, gp3) | ||
| 454 | __field(u32, ucode_ver) | ||
| 455 | __field(u32, hw_ver) | ||
| 456 | __field(u32, brd_ver) | ||
| 457 | ), | ||
| 458 | TP_fast_assign( | ||
| 459 | DEV_ASSIGN; | ||
| 460 | __entry->desc = desc; | ||
| 461 | __entry->tsf_low = tsf_low; | ||
| 462 | __entry->data1 = data1; | ||
| 463 | __entry->data2 = data2; | ||
| 464 | __entry->line = line; | ||
| 465 | __entry->blink1 = blink1; | ||
| 466 | __entry->blink2 = blink2; | ||
| 467 | __entry->ilink1 = ilink1; | ||
| 468 | __entry->ilink2 = ilink2; | ||
| 469 | __entry->bcon_time = bcon_time; | ||
| 470 | __entry->gp1 = gp1; | ||
| 471 | __entry->gp2 = gp2; | ||
| 472 | __entry->gp3 = gp3; | ||
| 473 | __entry->ucode_ver = ucode_ver; | ||
| 474 | __entry->hw_ver = hw_ver; | ||
| 475 | __entry->brd_ver = brd_ver; | ||
| 476 | ), | ||
| 477 | TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, " | ||
| 478 | "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X " | ||
| 479 | "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X uCode 0x%08X " | ||
| 480 | "hw 0x%08X brd 0x%08X", | ||
| 481 | __get_str(dev), __entry->desc, __entry->tsf_low, | ||
| 482 | __entry->data1, | ||
| 483 | __entry->data2, __entry->line, __entry->blink1, | ||
| 484 | __entry->blink2, __entry->ilink1, __entry->ilink2, | ||
| 485 | __entry->bcon_time, __entry->gp1, __entry->gp2, | ||
| 486 | __entry->gp3, __entry->ucode_ver, __entry->hw_ver, | ||
| 487 | __entry->brd_ver) | ||
| 488 | ); | ||
| 489 | |||
| 490 | TRACE_EVENT(iwlwifi_dev_ucode_event, | ||
| 491 | TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev), | ||
| 492 | TP_ARGS(dev, time, data, ev), | ||
| 493 | TP_STRUCT__entry( | ||
| 494 | DEV_ENTRY | ||
| 495 | |||
| 496 | __field(u32, time) | ||
| 497 | __field(u32, data) | ||
| 498 | __field(u32, ev) | ||
| 499 | ), | ||
| 500 | TP_fast_assign( | ||
| 501 | DEV_ASSIGN; | ||
| 502 | __entry->time = time; | ||
| 503 | __entry->data = data; | ||
| 504 | __entry->ev = ev; | ||
| 505 | ), | ||
| 506 | TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u", | ||
| 507 | __get_str(dev), __entry->time, __entry->data, __entry->ev) | ||
| 508 | ); | ||
| 509 | #endif /* __IWLWIFI_DEVICE_TRACE */ | 89 | #endif /* __IWLWIFI_DEVICE_TRACE */ |
| 510 | |||
| 511 | #undef TRACE_INCLUDE_PATH | ||
| 512 | #define TRACE_INCLUDE_PATH . | ||
| 513 | #undef TRACE_INCLUDE_FILE | ||
| 514 | #define TRACE_INCLUDE_FILE iwl-devtrace | ||
| 515 | #include <trace/define_trace.h> | ||
