|
4 | 4 | *
|
5 | 5 | * Debug traces for zfcp.
|
6 | 6 | *
|
7 |
| - * Copyright IBM Corp. 2002, 2020 |
| 7 | + * Copyright IBM Corp. 2002, 2023 |
8 | 8 | */
|
9 | 9 |
|
10 | 10 | #define KMSG_COMPONENT "zfcp"
|
@@ -145,6 +145,48 @@ void zfcp_dbf_hba_fsf_fces(char *tag, const struct zfcp_fsf_req *req, u64 wwpn,
|
145 | 145 | spin_unlock_irqrestore(&dbf->hba_lock, flags);
|
146 | 146 | }
|
147 | 147 |
|
| 148 | +/** |
| 149 | + * zfcp_dbf_hba_fsf_reqid - trace only the tag and a request ID |
| 150 | + * @tag: tag documenting the source |
| 151 | + * @level: trace level |
| 152 | + * @adapter: adapter instance the request ID belongs to |
| 153 | + * @req_id: the request ID to trace |
| 154 | + */ |
| 155 | +void zfcp_dbf_hba_fsf_reqid(const char *const tag, const int level, |
| 156 | + struct zfcp_adapter *const adapter, |
| 157 | + const u64 req_id) |
| 158 | +{ |
| 159 | + struct zfcp_dbf *const dbf = adapter->dbf; |
| 160 | + struct zfcp_dbf_hba *const rec = &dbf->hba_buf; |
| 161 | + struct zfcp_dbf_hba_res *const res = &rec->u.res; |
| 162 | + unsigned long flags; |
| 163 | + |
| 164 | + if (unlikely(!debug_level_enabled(dbf->hba, level))) |
| 165 | + return; |
| 166 | + |
| 167 | + spin_lock_irqsave(&dbf->hba_lock, flags); |
| 168 | + memset(rec, 0, sizeof(*rec)); |
| 169 | + |
| 170 | + memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN); |
| 171 | + |
| 172 | + rec->id = ZFCP_DBF_HBA_RES; |
| 173 | + rec->fsf_req_id = req_id; |
| 174 | + rec->fsf_req_status = ~0u; |
| 175 | + rec->fsf_cmd = ~0u; |
| 176 | + rec->fsf_seq_no = ~0u; |
| 177 | + |
| 178 | + res->req_issued = ~0ull; |
| 179 | + res->prot_status = ~0u; |
| 180 | + memset(res->prot_status_qual, 0xff, sizeof(res->prot_status_qual)); |
| 181 | + res->fsf_status = ~0u; |
| 182 | + memset(res->fsf_status_qual, 0xff, sizeof(res->fsf_status_qual)); |
| 183 | + res->port_handle = ~0u; |
| 184 | + res->lun_handle = ~0u; |
| 185 | + |
| 186 | + debug_event(dbf->hba, level, rec, sizeof(*rec)); |
| 187 | + spin_unlock_irqrestore(&dbf->hba_lock, flags); |
| 188 | +} |
| 189 | + |
148 | 190 | /**
|
149 | 191 | * zfcp_dbf_hba_fsf_uss - trace event for an unsolicited status buffer
|
150 | 192 | * @tag: tag indicating which kind of unsolicited status has been received
|
|
0 commit comments