net/dsa/trace.h
Source file repositories/reference/linux-study-clean/net/dsa/trace.h
File Facts
- System
- Linux kernel
- Corpus path
net/dsa/trace.h- Extension
.h- Size
- 12805 bytes
- Lines
- 448
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/dsa.hnet/switchdev.hlinux/etherdevice.hlinux/if_bridge.hlinux/refcount.hlinux/tracepoint.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 dsa
#if !defined(_NET_DSA_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _NET_DSA_TRACE_H
#include <net/dsa.h>
#include <net/switchdev.h>
#include <linux/etherdevice.h>
#include <linux/if_bridge.h>
#include <linux/refcount.h>
#include <linux/tracepoint.h>
/* Enough to fit "bridge %s num %d" where num has 3 digits */
#define DSA_DB_BUFSIZ (IFNAMSIZ + 16)
void dsa_db_print(const struct dsa_db *db, char buf[DSA_DB_BUFSIZ]);
const char *dsa_port_kind(const struct dsa_port *dp);
DECLARE_EVENT_CLASS(dsa_port_addr_op_hw,
TP_PROTO(const struct dsa_port *dp, const unsigned char *addr, u16 vid,
const struct dsa_db *db, int err),
TP_ARGS(dp, addr, vid, db, err),
TP_STRUCT__entry(
__string(dev, dev_name(dp->ds->dev))
__string(kind, dsa_port_kind(dp))
__field(int, port)
__array(unsigned char, addr, ETH_ALEN)
__field(u16, vid)
__array(char, db_buf, DSA_DB_BUFSIZ)
__field(int, err)
),
TP_fast_assign(
__assign_str(dev);
__assign_str(kind);
__entry->port = dp->index;
ether_addr_copy(__entry->addr, addr);
__entry->vid = vid;
dsa_db_print(db, __entry->db_buf);
__entry->err = err;
),
TP_printk("%s %s port %d addr %pM vid %u db \"%s\" err %d",
__get_str(dev), __get_str(kind), __entry->port, __entry->addr,
__entry->vid, __entry->db_buf, __entry->err)
);
/* Add unicast/multicast address to hardware, either on user ports
* (where no refcounting is kept), or on shared ports when the entry
* is first seen and its refcount is 1.
*/
DEFINE_EVENT(dsa_port_addr_op_hw, dsa_fdb_add_hw,
TP_PROTO(const struct dsa_port *dp, const unsigned char *addr,
u16 vid, const struct dsa_db *db, int err),
TP_ARGS(dp, addr, vid, db, err));
DEFINE_EVENT(dsa_port_addr_op_hw, dsa_mdb_add_hw,
TP_PROTO(const struct dsa_port *dp, const unsigned char *addr,
u16 vid, const struct dsa_db *db, int err),
TP_ARGS(dp, addr, vid, db, err));
/* Delete unicast/multicast address from hardware, either on user ports or
* when the refcount on shared ports reaches 0
*/
DEFINE_EVENT(dsa_port_addr_op_hw, dsa_fdb_del_hw,
TP_PROTO(const struct dsa_port *dp, const unsigned char *addr,
u16 vid, const struct dsa_db *db, int err),
TP_ARGS(dp, addr, vid, db, err));
DEFINE_EVENT(dsa_port_addr_op_hw, dsa_mdb_del_hw,
TP_PROTO(const struct dsa_port *dp, const unsigned char *addr,
u16 vid, const struct dsa_db *db, int err),
TP_ARGS(dp, addr, vid, db, err));
DECLARE_EVENT_CLASS(dsa_port_addr_op_refcount,
TP_PROTO(const struct dsa_port *dp, const unsigned char *addr, u16 vid,
const struct dsa_db *db, const refcount_t *refcount),
TP_ARGS(dp, addr, vid, db, refcount),
TP_STRUCT__entry(
__string(dev, dev_name(dp->ds->dev))
__string(kind, dsa_port_kind(dp))
__field(int, port)
__array(unsigned char, addr, ETH_ALEN)
Annotation
- Immediate include surface: `net/dsa.h`, `net/switchdev.h`, `linux/etherdevice.h`, `linux/if_bridge.h`, `linux/refcount.h`, `linux/tracepoint.h`, `trace/define_trace.h`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.