gnet_stats_start_copy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gnet_stats_start_copy β€” it's giving "let's dump some stats" ✨

okay so real talk, this page lives in the Kernel API Manual section 9 (that's the kernel API girlies, not your regular command-line besties) and honestly? she's a whole function and she ATE. let's get into it πŸŽ€


🌸 NAME 🌸

gnet_stats_start_copy β€” start the dumping procedure in compatibility mode. yes bestie, compatibility mode β€” she's keeping it cute and backwards-friendly 🫢


✨ SYNOPSIS ✨

int gnet_stats_start_copy (struct sk_buff *skb , int type , spinlock_t
*lock , struct gnet_dump *d , int padattr );

like, five args, one int back, no cap. it's giving "simple but she has range" πŸ’œ


πŸ¦‹ ARGUMENTS πŸ¦‹

  • skb β€” the socket buffer you're putting your statistics TLVs into. it's the little container of destiny, ngl πŸ“¦
  • type β€” the TLV type for the top level statistic TLV. like the big label on the outside of the box, ykwim?
  • lock β€” the statistics lock πŸ”’ (yes you gotta grab it, we're being polite and thread-safe)
  • d β€” your dumping handle. the main character of this whole operation honestly πŸ‘‘
  • padattr β€” the padding attribute. because alignment is self-care ✨

πŸ’– DESCRIPTION πŸ’–

so what she actually does: she initializes the dumping handle, grabs the statistic lock, and then appends an empty TLV header to the socket buffer so it can be used as a container for all the other statistic TLVs. like setting up the group chat before you add everyone to it, fr fr πŸ“±πŸ’¬

and then she tells you how it went: returns 0 on success, or -1 if the room in the socket buffer was not sufficient 😭 (buffer said "no vacancy", and honestly? valid).

⚠️ heads up bestie: check that return value. -1 means the socket buffer didn't have room, and pretending you didn't see it is not the vibe. πŸ™ˆ

🧚 SEE ALSO 🧚

the whole squad, all in the kernel file ./net/core/gen_stats.c 🌈:


and that's the page!! mwah πŸ’‹ this one's sourced from ./net/core and dated October 2026 β€” so she's fresh, she's iconic, she's the moment. go forth and dump those stats responsibly, bestie πŸ“πŸ’œ

πŸ“¦ where this page comes from