drivers/usb/gadget/udc/trace.h
Source file repositories/reference/linux-study-clean/drivers/usb/gadget/udc/trace.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/gadget/udc/trace.h- Extension
.h- Size
- 8531 bytes
- Lines
- 300
- 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.hasm/byteorder.hlinux/usb/gadget.htrace/define_trace.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* udc.c - Core UDC Framework
*
* Copyright (C) 2016 Intel Corporation
* Author: Felipe Balbi <felipe.balbi@linux.intel.com>
*/
#undef TRACE_SYSTEM
#define TRACE_SYSTEM gadget
#if !defined(__UDC_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define __UDC_TRACE_H
#include <linux/types.h>
#include <linux/tracepoint.h>
#include <asm/byteorder.h>
#include <linux/usb/gadget.h>
DECLARE_EVENT_CLASS(udc_log_gadget,
TP_PROTO(struct usb_gadget *g, int ret),
TP_ARGS(g, ret),
TP_STRUCT__entry(
__field(enum usb_device_speed, speed)
__field(enum usb_device_speed, max_speed)
__field(enum usb_device_state, state)
__field(unsigned, mA)
__field(unsigned, sg_supported)
__field(unsigned, is_otg)
__field(unsigned, is_a_peripheral)
__field(unsigned, b_hnp_enable)
__field(unsigned, a_hnp_support)
__field(unsigned, hnp_polling_support)
__field(unsigned, host_request_flag)
__field(unsigned, quirk_ep_out_aligned_size)
__field(unsigned, quirk_altset_not_supp)
__field(unsigned, quirk_stall_not_supp)
__field(unsigned, quirk_zlp_not_supp)
__field(unsigned, is_selfpowered)
__field(unsigned, deactivated)
__field(unsigned, connected)
__field(int, ret)
),
TP_fast_assign(
__entry->speed = g->speed;
__entry->max_speed = g->max_speed;
__entry->state = g->state;
__entry->mA = g->mA;
__entry->sg_supported = g->sg_supported;
__entry->is_otg = g->is_otg;
__entry->is_a_peripheral = g->is_a_peripheral;
__entry->b_hnp_enable = g->b_hnp_enable;
__entry->a_hnp_support = g->a_hnp_support;
__entry->hnp_polling_support = g->hnp_polling_support;
__entry->host_request_flag = g->host_request_flag;
__entry->quirk_ep_out_aligned_size = g->quirk_ep_out_aligned_size;
__entry->quirk_altset_not_supp = g->quirk_altset_not_supp;
__entry->quirk_stall_not_supp = g->quirk_stall_not_supp;
__entry->quirk_zlp_not_supp = g->quirk_zlp_not_supp;
__entry->is_selfpowered = g->is_selfpowered;
__entry->deactivated = g->deactivated;
__entry->connected = g->connected;
__entry->ret = ret;
),
TP_printk("speed %d/%d state %d %dmA [%s%s%s%s%s%s%s%s%s%s%s%s%s%s] --> %d",
__entry->speed, __entry->max_speed, __entry->state, __entry->mA,
__entry->sg_supported ? "sg:" : "",
__entry->is_otg ? "OTG:" : "",
__entry->is_a_peripheral ? "a_peripheral:" : "",
__entry->b_hnp_enable ? "b_hnp:" : "",
__entry->a_hnp_support ? "a_hnp:" : "",
__entry->hnp_polling_support ? "hnp_poll:" : "",
__entry->host_request_flag ? "hostreq:" : "",
__entry->quirk_ep_out_aligned_size ? "out_aligned:" : "",
__entry->quirk_altset_not_supp ? "no_altset:" : "",
__entry->quirk_stall_not_supp ? "no_stall:" : "",
__entry->quirk_zlp_not_supp ? "no_zlp" : "",
__entry->is_selfpowered ? "self-powered:" : "bus-powered:",
__entry->deactivated ? "deactivated:" : "activated:",
__entry->connected ? "connected" : "disconnected",
__entry->ret)
);
DEFINE_EVENT(udc_log_gadget, usb_gadget_set_state,
TP_PROTO(struct usb_gadget *g, int ret),
TP_ARGS(g, ret)
);
DEFINE_EVENT(udc_log_gadget, usb_gadget_frame_number,
TP_PROTO(struct usb_gadget *g, int ret),
Annotation
- Immediate include surface: `linux/types.h`, `linux/tracepoint.h`, `asm/byteorder.h`, `linux/usb/gadget.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.