aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/cam_ccb.h
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2016-10-31 23:09:52 +0000
committerConrad Meyer <cem@FreeBSD.org>2016-10-31 23:09:52 +0000
commit8532d381a91f1e201ab95ab7f913b723e8912571 (patch)
tree38a4d4d75a173395017b59aa5d986d25e29e841a /sys/cam/cam_ccb.h
parent2d5386cc2c570cf781c45cc948a800c8f8d4f0d0 (diff)
downloadsrc-8532d381a91f1e201ab95ab7f913b723e8912571.tar.gz
src-8532d381a91f1e201ab95ab7f913b723e8912571.zip
Add BUF_TRACKING and FULL_BUF_TRACKING buffer debugging
Upstream the BUF_TRACKING and FULL_BUF_TRACKING buffer debugging code. This can be handy in tracking down what code touched hung bios and bufs last. The full history is especially useful, but adds enough bloat that it shouldn't be enabled in release builds. Function names (or arbitrary string constants) are tracked in a fixed-size ring in bufs. Bios gain a pointer to the upper buf for tracking. SCSI CCBs gain a pointer to the upper bio for tracking. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8366
Notes
Notes: svn path=/head/; revision=308155
Diffstat (limited to 'sys/cam/cam_ccb.h')
-rw-r--r--sys/cam/cam_ccb.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h
index 9ec266e84cc1..b638ab1dba9f 100644
--- a/sys/cam/cam_ccb.h
+++ b/sys/cam/cam_ccb.h
@@ -744,6 +744,9 @@ struct ccb_scsiio {
#define CAM_TAG_ACTION_NONE 0x00
u_int tag_id; /* tag id from initator (target mode) */
u_int init_id; /* initiator id of who selected */
+#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING)
+ struct bio *bio; /* Associated bio */
+#endif
};
static __inline uint8_t *
@@ -1335,6 +1338,9 @@ cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries,
csio->sense_len = sense_len;
csio->cdb_len = cdb_len;
csio->tag_action = tag_action;
+#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING)
+ csio->bio = NULL;
+#endif
}
static __inline void