drivers/infiniband/hw/hfi1/trace.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/hfi1/trace.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/hfi1/trace.c- Extension
.c- Size
- 15361 bytes
- Lines
- 533
- Domain
- Driver Families
- Bucket
- drivers/infiniband
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
trace.hexp_rcv.hipoib.h
Detected Declarations
struct hfi1_ctxt_histfunction Copyrightfunction __get_16b_hdr_lenfunction hfi1_trace_packet_hdr_lenfunction hfi1_trace_opa_hdr_lenfunction hfi1_trace_parse_9b_bthfunction hfi1_trace_parse_16b_bthfunction ib_get_lenfunction hfi1_trace_parse_9b_hdrfunction hfi1_trace_parse_16b_hdrfunction hfi1_trace_get_tid_ctrlfunction hfi1_trace_get_tid_lenfunction hfi1_trace_get_tid_idx
Annotated Snippet
struct hfi1_ctxt_hist {
atomic_t count;
atomic_t data[255];
};
static struct hfi1_ctxt_hist hist = {
.count = ATOMIC_INIT(0)
};
const char *hfi1_trace_print_rsm_hist(struct trace_seq *p, unsigned int ctxt)
{
int i, len = ARRAY_SIZE(hist.data);
const char *ret = trace_seq_buffer_ptr(p);
unsigned long packet_count = atomic_fetch_inc(&hist.count);
trace_seq_printf(p, "packet[%lu]", packet_count);
for (i = 0; i < len; ++i) {
unsigned long val;
atomic_t *count = &hist.data[i];
if (ctxt == i)
val = atomic_fetch_inc(count);
else
val = atomic_read(count);
if (val)
trace_seq_printf(p, "(%d:%lu)", i, val);
}
trace_seq_putc(p, 0);
return ret;
}
__hfi1_trace_fn(AFFINITY);
__hfi1_trace_fn(PKT);
__hfi1_trace_fn(PROC);
__hfi1_trace_fn(SDMA);
__hfi1_trace_fn(LINKVERB);
__hfi1_trace_fn(DEBUG);
__hfi1_trace_fn(SNOOP);
__hfi1_trace_fn(CNTR);
__hfi1_trace_fn(PIO);
__hfi1_trace_fn(DC8051);
__hfi1_trace_fn(FIRMWARE);
__hfi1_trace_fn(RCVCTRL);
__hfi1_trace_fn(TID);
__hfi1_trace_fn(MMU);
__hfi1_trace_fn(IOCTL);
Annotation
- Immediate include surface: `trace.h`, `exp_rcv.h`, `ipoib.h`.
- Detected declarations: `struct hfi1_ctxt_hist`, `function Copyright`, `function __get_16b_hdr_len`, `function hfi1_trace_packet_hdr_len`, `function hfi1_trace_opa_hdr_len`, `function hfi1_trace_parse_9b_bth`, `function hfi1_trace_parse_16b_bth`, `function ib_get_len`, `function hfi1_trace_parse_9b_hdr`, `function hfi1_trace_parse_16b_hdr`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.