drivers/infiniband/hw/hns/hns_roce_trace.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/hns/hns_roce_trace.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/hns/hns_roce_trace.h- Extension
.h- Size
- 7028 bytes
- Lines
- 217
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/tracepoint.hlinux/string_choices.hhns_roce_device.hhns_roce_hw_v2.htrace/define_trace.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#undef TRACE_SYSTEM
#define TRACE_SYSTEM hns_roce
#if !defined(__HNS_ROCE_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define __HNS_ROCE_TRACE_H
#include <linux/tracepoint.h>
#include <linux/string_choices.h>
#include "hns_roce_device.h"
#include "hns_roce_hw_v2.h"
DECLARE_EVENT_CLASS(flush_head_template,
TP_PROTO(unsigned long qpn, u32 pi,
enum hns_roce_trace_type type),
TP_ARGS(qpn, pi, type),
TP_STRUCT__entry(__field(unsigned long, qpn)
__field(u32, pi)
__field(enum hns_roce_trace_type, type)
),
TP_fast_assign(__entry->qpn = qpn;
__entry->pi = pi;
__entry->type = type;
),
TP_printk("%s 0x%lx flush head 0x%x.",
trace_type_to_str(__entry->type),
__entry->qpn, __entry->pi)
);
DEFINE_EVENT(flush_head_template, hns_sq_flush_cqe,
TP_PROTO(unsigned long qpn, u32 pi,
enum hns_roce_trace_type type),
TP_ARGS(qpn, pi, type));
DEFINE_EVENT(flush_head_template, hns_rq_flush_cqe,
TP_PROTO(unsigned long qpn, u32 pi,
enum hns_roce_trace_type type),
TP_ARGS(qpn, pi, type));
#define MAX_SGE_PER_WQE 64
#define MAX_WQE_SIZE (MAX_SGE_PER_WQE * HNS_ROCE_SGE_SIZE)
DECLARE_EVENT_CLASS(wqe_template,
TP_PROTO(unsigned long qpn, u32 idx, void *wqe, u32 len,
u64 id, enum hns_roce_trace_type type),
TP_ARGS(qpn, idx, wqe, len, id, type),
TP_STRUCT__entry(__field(unsigned long, qpn)
__field(u32, idx)
__array(u32, wqe,
MAX_WQE_SIZE / sizeof(__le32))
__field(u32, len)
__field(u64, id)
__field(enum hns_roce_trace_type, type)
),
TP_fast_assign(__entry->qpn = qpn;
__entry->idx = idx;
__entry->id = id;
__entry->len = len / sizeof(__le32);
__entry->type = type;
for (int i = 0; i < __entry->len; i++)
__entry->wqe[i] = le32_to_cpu(((__le32 *)wqe)[i]);
),
TP_printk("%s 0x%lx wqe(0x%x/0x%llx): %s",
trace_type_to_str(__entry->type),
__entry->qpn, __entry->idx, __entry->id,
__print_array(__entry->wqe, __entry->len,
sizeof(__le32)))
);
DEFINE_EVENT(wqe_template, hns_sq_wqe,
TP_PROTO(unsigned long qpn, u32 idx, void *wqe, u32 len, u64 id,
enum hns_roce_trace_type type),
TP_ARGS(qpn, idx, wqe, len, id, type));
DEFINE_EVENT(wqe_template, hns_rq_wqe,
TP_PROTO(unsigned long qpn, u32 idx, void *wqe, u32 len, u64 id,
enum hns_roce_trace_type type),
TP_ARGS(qpn, idx, wqe, len, id, type));
DEFINE_EVENT(wqe_template, hns_srq_wqe,
TP_PROTO(unsigned long qpn, u32 idx, void *wqe, u32 len, u64 id,
enum hns_roce_trace_type type),
TP_ARGS(qpn, idx, wqe, len, id, type));
TRACE_EVENT(hns_ae_info,
TP_PROTO(int event_type, void *aeqe, unsigned int len),
TP_ARGS(event_type, aeqe, len),
TP_STRUCT__entry(__field(int, event_type)
Annotation
- Immediate include surface: `linux/tracepoint.h`, `linux/string_choices.h`, `hns_roce_device.h`, `hns_roce_hw_v2.h`, `trace/define_trace.h`.
- Atlas domain: Driver Families / drivers/infiniband.
- 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.