STRUCT SPI_STATISTICS(9)
π 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 ofspi_transfershandled. one level deeper, the way that messages break down into transfers, yk?errorsβ number of errors duringspi_transfer. π not the errors. but we count them anyway, that's the whole point of stats.timedoutβ number of timeouts duringspi_transfer. β° the "we waited, and nothing happened" counter.spi_syncβ number of timesspi_syncis used.spi_sync_immediateβ number of timesspi_syncis 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 timesspi_asyncis 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 bySPI_STATISTICS_HISTO_SIZEwhich is17β 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:
struct spi_delay(9)struct spi_device(9)struct spi_driver(9)spi_unregister_driver(9)module_spi_driver(9)struct spi_controller(9)struct spi_res(9)struct spi_transfer(9)struct spi_message(9)spi_message_init_with_transfers(9)spi_is_bpw_supported(9)spi_bpw_to_bytes(9)spi_controller_xfer_timeout(9)struct spi_replaced_transfers(9)spi_sync_transfer(9)spi_write(9)spi_read(9)spi_w8r8(9)spi_w8r16(9)spi_w8r16be(9)struct spi_board_info(9)
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
- 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