drivers/usb/core/trace.h
Source file repositories/reference/linux-study-clean/drivers/usb/core/trace.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/core/trace.h- Extension
.h- Size
- 1445 bytes
- Lines
- 62
- Domain
- Driver Families
- Bucket
- drivers/usb
- 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/types.hlinux/tracepoint.hlinux/usb.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 usbcore
#if !defined(_USB_CORE_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _USB_CORE_TRACE_H
#include <linux/types.h>
#include <linux/tracepoint.h>
#include <linux/usb.h>
DECLARE_EVENT_CLASS(usb_core_log_usb_device,
TP_PROTO(struct usb_device *udev),
TP_ARGS(udev),
TP_STRUCT__entry(
__string(name, dev_name(&udev->dev))
__field(enum usb_device_speed, speed)
__field(enum usb_device_state, state)
__field(unsigned short, bus_mA)
__field(unsigned, authorized)
),
TP_fast_assign(
__assign_str(name);
__entry->speed = udev->speed;
__entry->state = udev->state;
__entry->bus_mA = udev->bus_mA;
__entry->authorized = udev->authorized;
),
TP_printk("usb %s speed %s state %s %dmA [%s]",
__get_str(name),
usb_speed_string(__entry->speed),
usb_state_string(__entry->state),
__entry->bus_mA,
__entry->authorized ? "authorized" : "unauthorized")
);
DEFINE_EVENT(usb_core_log_usb_device, usb_set_device_state,
TP_PROTO(struct usb_device *udev),
TP_ARGS(udev)
);
DEFINE_EVENT(usb_core_log_usb_device, usb_alloc_dev,
TP_PROTO(struct usb_device *udev),
TP_ARGS(udev)
);
#endif /* _USB_CORE_TRACE_H */
/* this part has to be here */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace
#include <trace/define_trace.h>
Annotation
- Immediate include surface: `linux/types.h`, `linux/tracepoint.h`, `linux/usb.h`, `trace/define_trace.h`.
- Atlas domain: Driver Families / drivers/usb.
- 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.