drivers/hwtracing/ptt/hisi_ptt.h
Source file repositories/reference/linux-study-clean/drivers/hwtracing/ptt/hisi_ptt.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwtracing/ptt/hisi_ptt.h- Extension
.h- Size
- 8762 bytes
- Lines
- 258
- Domain
- Driver Families
- Bucket
- drivers/hwtracing
- 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/bits.hlinux/cpumask.hlinux/device.hlinux/kfifo.hlinux/list.hlinux/mutex.hlinux/notifier.hlinux/pci.hlinux/perf_event.hlinux/spinlock.hlinux/types.hlinux/workqueue.h
Detected Declarations
struct hisi_ptt_tune_descstruct hisi_ptt_dma_bufferstruct hisi_ptt_trace_ctrlstruct hisi_ptt_filter_descstruct hisi_ptt_filter_update_infostruct hisi_ptt_pmu_bufstruct hisi_ptt
Annotated Snippet
struct hisi_ptt_tune_desc {
struct hisi_ptt *hisi_ptt;
const char *name;
u32 event_code;
};
/**
* struct hisi_ptt_dma_buffer - Describe a single trace buffer of PTT trace.
* The detail of the data format is described
* in the documentation of PTT device.
* @dma: DMA address of this buffer visible to the device
* @addr: virtual address of this buffer visible to the cpu
*/
struct hisi_ptt_dma_buffer {
dma_addr_t dma;
void *addr;
};
/**
* struct hisi_ptt_trace_ctrl - Control and status of PTT trace
* @trace_buf: array of the trace buffers for holding the trace data.
* the length will be HISI_PTT_TRACE_BUF_CNT.
* @handle: perf output handle of current trace session
* @buf_index: the index of current using trace buffer
* @on_cpu: current tracing cpu
* @started: current trace status, true for started
* @is_port: whether we're tracing root port or not
* @direction: direction of the TLP headers to trace
* @filter: filter value for tracing the TLP headers
* @format: format of the TLP headers to trace
* @type: type of the TLP headers to trace
*/
struct hisi_ptt_trace_ctrl {
struct hisi_ptt_dma_buffer *trace_buf;
struct perf_output_handle handle;
u32 buf_index;
int on_cpu;
bool started;
bool is_port;
u32 direction:2;
u32 filter:16;
u32 format:1;
u32 type:4;
};
/*
* sysfs attribute group name for root port filters and requester filters:
* /sys/devices/hisi_ptt<sicl_id>_<core_id>/root_port_filters
* and
* /sys/devices/hisi_ptt<sicl_id>_<core_id>/requester_filters
*/
#define HISI_PTT_RP_FILTERS_GRP_NAME "root_port_filters"
#define HISI_PTT_REQ_FILTERS_GRP_NAME "requester_filters"
/**
* struct hisi_ptt_filter_desc - Descriptor of the PTT trace filter
* @attr: sysfs attribute of this filter
* @list: entry of this descriptor in the filter list
* @is_port: the PCI device of the filter is a Root Port or not
* @name: name of this filter, same as the name of the related PCI device
* @devid: the PCI device's devid of the filter
*/
struct hisi_ptt_filter_desc {
struct device_attribute attr;
struct list_head list;
bool is_port;
char *name;
u16 devid;
};
/**
* struct hisi_ptt_filter_update_info - Information for PTT filter updating
* @is_port: the PCI device to update is a Root Port or not
* @is_add: adding to the filter or not
* @devid: the PCI device's devid of the filter
*/
struct hisi_ptt_filter_update_info {
bool is_port;
bool is_add;
u16 devid;
};
/**
* struct hisi_ptt_pmu_buf - Descriptor of the AUX buffer of PTT trace
* @length: size of the AUX buffer
* @nr_pages: number of pages of the AUX buffer
* @base: start address of AUX buffer
* @pos: position in the AUX buffer to commit traced data
*/
struct hisi_ptt_pmu_buf {
Annotation
- Immediate include surface: `linux/bits.h`, `linux/cpumask.h`, `linux/device.h`, `linux/kfifo.h`, `linux/list.h`, `linux/mutex.h`, `linux/notifier.h`, `linux/pci.h`.
- Detected declarations: `struct hisi_ptt_tune_desc`, `struct hisi_ptt_dma_buffer`, `struct hisi_ptt_trace_ctrl`, `struct hisi_ptt_filter_desc`, `struct hisi_ptt_filter_update_info`, `struct hisi_ptt_pmu_buf`, `struct hisi_ptt`.
- Atlas domain: Driver Families / drivers/hwtracing.
- 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.