dim_calc_stats(9)
π dim_calc_stats(9) π
okay so this is a page from the Kernel API Manual (yes, section 9, kernel-space girlies know) and literally the whole vibe is: it's dim_calc_stats, and it's about finding the difference between two samples. slay.
β¨ NAME β¨
dim_calc_stats β calculate the difference between two samples π
πΈ SYNOPSIS πΈ
bool dim_calc_stats (const struct dim_sample *start , const struct
dim_sample *end , struct dim_stats *curr_stats );
like, it returns a bool, bestie. remember that, it matters later π
π¦ ARGUMENTS π¦
startβ your start sample, the before pic πΈendβ your end sample, the after pic πΈcurr_statsβ the delta between samples, aka the glow-up, the actual difference, the receipts π
π DESCRIPTION π
so what it actually does? it calculates the delta between two samples β and yeah, in data rates, that's the unit we're living in β¨
it also takes into consideration counter wrap-around, which lowkey is the whole point, because counters wrap and if you didn't handle it your math would just be wrong. not cute. π
and the returned boolean? that's your vibe check β it indicates whether curr_stats are reliable. so like, if it comes back false, do not trust those numbers, bestie, fr fr. π
ngl the reliability flag is the main character here β always check it before you go building anything on top of curr_stats. π
π SEE ALSO π
the whole friend group, no cap:
- Kernel file
./include/linux/dim.h struct dim_cq_moder(9)struct dim_irq_moder(9)struct dim_sample(9)struct dim_stats(9)struct dim(9)enum dim_cq_period_mode(9)enum dim_state(9)enum dim_tune_state(9)enum dim_stats_state(9)enum dim_step_result(9)net_dim_init_irq_moder(9)net_dim_free_irq_moder(9)net_dim_setting(9)net_dim_work_cancel(9)net_dim_get_rx_irq_moder(9)net_dim_get_tx_irq_moder(9)net_dim_set_rx_mode(9)net_dim_set_tx_mode(9)dim_on_top(9)dim_turn(9)dim_park_on_top(9)dim_park_tired(9)dim_update_sample(9)dim_update_sample_with_comps(9)net_dim_get_rx_moderation(9)net_dim_get_def_rx_moderation(9)net_dim_get_tx_moderation(9)net_dim_get_def_tx_moderation(9)net_dim(9)rdma_dim(9)
like, go read all of them, i'll wait π«Ά
and that's the page!! mwah π this one lives in ./include/linux and the version/date stamp on it is October 2026 β so yeah, she's dated, but she's iconic, and that's the sign-off πβ¨ bye bestie, go check your booleans π
π¦ 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