STRUCT SPI_STATISTICS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct spi_statistics(9)

okay so bestie, welcome to the kernel API manual ✨ β€” this one's all about struct spi_statistics, and ngl it's kind of a vibe. Sit down, grab a lil snack πŸ“, and let's get into it.


🌸 NAME 🌸

struct spi_statistics β€” statistics for spi transfers. that's it, that's the whole thing, it's literally the receipts for your SPI traffic πŸ§ΎπŸ’–


✨ SYNOPSIS ✨

struct spi_statistics {
    struct u64_stats_sync   syncp;
    u64_stats_t messages;
    u64_stats_t transfers;
    u64_stats_t errors;
    u64_stats_t timedout;
    u64_stats_t spi_sync;
    u64_stats_t spi_sync_immediate;
    u64_stats_t spi_async;
    u64_stats_t bytes;
    u64_stats_t bytes_rx;
    u64_stats_t bytes_tx;
  #define SPI_STATISTICS_HISTO_SIZE 17;
    u64_stats_t transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE];
    u64_stats_t transfers_split_maxsize;
 };

look at her. she's beautiful. she's bookkeeping πŸŽ€


πŸ‘‘ Members πŸ‘‘

okay so the members, one by one, no skipping, we don't do that here 🫢

  • syncp β€” seqcount to protect members in this struct for per-cpu update on 32-bit systems. she's the bodyguard πŸ’ͺ don't touch the counters without going through her, fr fr.
  • messages β€” number of spi-messages handled. the big-picture count 🌈
  • transfers β€” number of spi_transfers handled. one level deeper, the way that messages break down into transfers, yk?
  • errors β€” number of errors during spi_transfer. 😭 not the errors. but we count them anyway, that's the whole point of stats.
  • timedout β€” number of timeouts during spi_transfer. ⏰ the "we waited, and nothing happened" counter.
  • spi_sync β€” number of times spi_sync is used.
  • spi_sync_immediate β€” number of times spi_sync is executed immediately in calling context without queuing and scheduling. lowkey the impatient one πŸ”₯ β€” no queue, no schedule, just vibes and immediate execution.
  • spi_async β€” number of times spi_async is used.
  • bytes β€” number of bytes transferred to/from device. both directions, all the bytes, every single one πŸ’œ
  • bytes_rx β€” number of bytes received from device. incoming! πŸ“₯
  • bytes_tx β€” number of bytes sent to device. outgoing! πŸ“€
  • transfer_bytes_histo β€” transfer bytes histogram. and bestie, the size of it is defined by SPI_STATISTICS_HISTO_SIZE which is 17 β€” iconic number, no notes πŸŽ€
  • transfers_split_maxsize β€” number of transfers that have been split because of maxsize limit. the "she got divided for the algorithm" counter βœ‚οΈπŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/spi/spi.h, plus the whole friend group honestly:


and that's the page, bestie! πŸ’– this lil gem lives in ./include/linux/spi and it's dated October 2026, filed under struct spi_statistics(9). go forth and count your transfers, periodt. 🧚✨

πŸ“¦ where this page comes from