drivers/scsi/fnic/fnic_trace.h
Source file repositories/reference/linux-study-clean/drivers/scsi/fnic/fnic_trace.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/fnic/fnic_trace.h- Extension
.h- Size
- 3171 bytes
- Lines
- 116
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct fnic_trace_datastruct fc_trace_hdr
Annotated Snippet
struct fnic_trace_data {
union {
struct {
u32 low;
u32 high;
};
u64 val;
} timestamp, fnaddr;
u32 host_no;
u32 tag;
u64 data[5];
} __attribute__((__packed__));
typedef struct fnic_trace_data fnic_trace_data_t;
struct fc_trace_hdr {
struct timespec64 time_stamp;
u32 host_no;
u8 frame_type;
u8 frame_len;
} __attribute__((__packed__));
#define FC_TRACE_ADDRESS(a) \
((unsigned long)(a) + sizeof(struct fc_trace_hdr))
#define FNIC_TRACE_ENTRY_SIZE \
(FNIC_ENTRY_SIZE_BYTES - sizeof(fnic_trace_data_t))
#define FNIC_TRACE(_fn, _hn, _t, _a, _b, _c, _d, _e) \
if (unlikely(fnic_tracing_enabled)) { \
fnic_trace_data_t *trace_buf = fnic_trace_get_buf(); \
if (trace_buf) { \
if (sizeof(unsigned long) < 8) { \
trace_buf->timestamp.low = jiffies; \
trace_buf->fnaddr.low = (u32)(unsigned long)_fn; \
} else { \
trace_buf->timestamp.val = jiffies; \
trace_buf->fnaddr.val = (u64)(unsigned long)_fn; \
} \
trace_buf->host_no = _hn; \
trace_buf->tag = _t; \
trace_buf->data[0] = (u64)(unsigned long)_a; \
trace_buf->data[1] = (u64)(unsigned long)_b; \
trace_buf->data[2] = (u64)(unsigned long)_c; \
trace_buf->data[3] = (u64)(unsigned long)_d; \
trace_buf->data[4] = (u64)(unsigned long)_e; \
} \
}
fnic_trace_data_t *fnic_trace_get_buf(void);
int fnic_get_trace_data(fnic_dbgfs_t *);
int fnic_trace_buf_init(void);
void fnic_trace_free(void);
int fnic_debugfs_init(void);
void fnic_debugfs_terminate(void);
void fnic_trace_debugfs_init(void);
void fnic_trace_debugfs_terminate(void);
/* Fnic FC CTLR Trace releated function */
int fnic_fc_trace_init(void);
void fnic_fc_trace_free(void);
int fnic_fc_trace_set_data(u32 host_no, u8 frame_type,
char *frame, u32 fc_frame_len);
int fnic_fc_trace_get_data(fnic_dbgfs_t *fnic_dbgfs_prt, u8 rdata_flag);
void copy_and_format_trace_data(struct fc_trace_hdr *tdata,
fnic_dbgfs_t *fnic_dbgfs_prt,
int *len, u8 rdata_flag);
void fnic_fc_trace_debugfs_init(void);
void fnic_fc_trace_debugfs_terminate(void);
#endif
Annotation
- Detected declarations: `struct fnic_trace_data`, `struct fc_trace_hdr`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.