gnet_stats_copy_queue(9)
π gnet_stats_copy_queue(9) π
okay bestie, welcome to the Kernel API Manual β¨ this one's a little kernel function from ./net/core and she's literally the queue-statistics bestie you didn't know you needed π«Ά
πΈ NAME πΈ
gnet_stats_copy_queue β copy queue statistics into statistics TLV π
π SYNOPSIS π
int gnet_stats_copy_queue (struct gnet_dump *d , const struct
gnet_stats_queue __percpu *cpu_q , const struct gnet_stats_queue *q ,
__u32 qlen );
like, that's the whole signature, no cap β four arguments and an int return, iconic π
π¦ ARGUMENTS π¦
dβ the dumping handle π― your main character, the thing doing the dumpingcpu_qβ per cpu queue statistics π§ yes, per cpu, she's a__percpupointer and everythingqβ queue statistics π the regular, non-per-cpu stats bestieqlenβ queue length statistics π a__u32, keeping it cute and numeric
β¨ DESCRIPTION β¨
So what she actually does: she appends the queue statistics to the top level TLV that was created by gnet_stats_start_copy π« and she uses the per cpu queue statistics if they are available β like, if they're there, she's using them, periodt π
Returns 0 on success π₯³ or -1 with the statistic lock released if the room in the socket buffer was not sufficient π β and yes, the lock being released on that -1 path is important, ngl, don't sleep on it.
β οΈ lowkey important: on -1, the statistic lock gets released. that's part of the deal, fr fr π
π₯ SEE ALSO π₯
- Kernel file
./net/core/gen_stats.cπ gnet_stats_start_copy_compat(9)gnet_stats_start_copy(9)gnet_stats_copy_basic(9)gnet_stats_copy_basic_hw(9)gnet_stats_copy_rate_est(9)gnet_stats_copy_app(9)gnet_stats_finish_copy(9)
and that's the whole page, bestie π she lives in ./net/core, dated October 2026, and honestly? slay π go copy some queue statistics, iykyk π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms