cam_debug.h (c3aac50f284c6cca5b4f2eb46aaa13812cb8b630) cam_debug.h (c447342094276b4d604449bb776063c7b88c4992)
1/*
2 * Macros for tracing/loging information in the CAM layer
3 *
4 * Copyright (c) 1997 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 16 unchanged lines hidden (view full) ---

25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD$
29 */
30#ifndef _CAM_CAM_DEBUG_H
31#define _CAM_CAM_DEBUG_H 1
32
1/*
2 * Macros for tracing/loging information in the CAM layer
3 *
4 * Copyright (c) 1997 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 16 unchanged lines hidden (view full) ---

25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD$
29 */
30#ifndef _CAM_CAM_DEBUG_H
31#define _CAM_CAM_DEBUG_H 1
32
33#if defined(CAMDEBUG) && defined(KERNEL)
33#if defined(CAMDEBUG) && defined(_KERNEL)
34#include <machine/clock.h>
34#include <machine/clock.h>
35#endif /* CAMDEBUG && KERNEL */
35#endif /* CAMDEBUG && _KERNEL */
36
37/*
38 * Debugging flags.
39 */
40typedef enum {
41 CAM_DEBUG_NONE = 0x00, /* no debugging */
42 CAM_DEBUG_INFO = 0x01, /* scsi commands, errors, data */
43 CAM_DEBUG_TRACE = 0x02, /* routine flow tracking */
44 CAM_DEBUG_SUBTRACE = 0x04, /* internal to routine flows */
45 CAM_DEBUG_CDB = 0x08, /* print out SCSI CDBs only */
46 CAM_DEBUG_XPT = 0x10, /* print out xpt scheduling */
47 CAM_DEBUG_PERIPH = 0x20 /* print out peripheral calls */
48} cam_debug_flags;
49
36
37/*
38 * Debugging flags.
39 */
40typedef enum {
41 CAM_DEBUG_NONE = 0x00, /* no debugging */
42 CAM_DEBUG_INFO = 0x01, /* scsi commands, errors, data */
43 CAM_DEBUG_TRACE = 0x02, /* routine flow tracking */
44 CAM_DEBUG_SUBTRACE = 0x04, /* internal to routine flows */
45 CAM_DEBUG_CDB = 0x08, /* print out SCSI CDBs only */
46 CAM_DEBUG_XPT = 0x10, /* print out xpt scheduling */
47 CAM_DEBUG_PERIPH = 0x20 /* print out peripheral calls */
48} cam_debug_flags;
49
50#if defined(CAMDEBUG) && defined(KERNEL)
50#if defined(CAMDEBUG) && defined(_KERNEL)
51
52/* Path we want to debug */
53extern struct cam_path *cam_dpath;
54/* Current debug levels set */
55extern u_int32_t cam_dflags;
56/* Printf delay value (to prevent scrolling */
57extern u_int32_t cam_debug_delay;
58

--- 16 unchanged lines hidden (view full) ---

75#define CAM_DEBUG_PRINT(flag, printfargs) \
76 if (cam_dflags & (flag)) { \
77 printf("cam_debug: "); \
78 printf printfargs; \
79 if (cam_debug_delay != 0) \
80 DELAY(cam_debug_delay); \
81 }
82
51
52/* Path we want to debug */
53extern struct cam_path *cam_dpath;
54/* Current debug levels set */
55extern u_int32_t cam_dflags;
56/* Printf delay value (to prevent scrolling */
57extern u_int32_t cam_debug_delay;
58

--- 16 unchanged lines hidden (view full) ---

75#define CAM_DEBUG_PRINT(flag, printfargs) \
76 if (cam_dflags & (flag)) { \
77 printf("cam_debug: "); \
78 printf printfargs; \
79 if (cam_debug_delay != 0) \
80 DELAY(cam_debug_delay); \
81 }
82
83#else /* !CAMDEBUG || !KERNEL */
83#else /* !CAMDEBUG || !_KERNEL */
84
85#define CAM_DEBUGGED(A, B) 0
86#define CAM_DEBUG(A, B, C)
87#define CAM_DEBUG_PRINT(A, B)
88
84
85#define CAM_DEBUGGED(A, B) 0
86#define CAM_DEBUG(A, B, C)
87#define CAM_DEBUG_PRINT(A, B)
88
89#endif /* CAMDEBUG && KERNEL */
89#endif /* CAMDEBUG && _KERNEL */
90
91#endif /* _CAM_CAM_DEBUG_H */
90
91#endif /* _CAM_CAM_DEBUG_H */