Let frakturO be a compact discrete valuation ring of characteristic 0. Given a module M of matrices over frakturO, we study the generating function encoding the average sizes of the kernels of the elements of M over finite quotients of frakturO. We prove rationality and establish fundamental properties of these generating functions and determine them explicitly for various natural families of modules M. Using p‐adic Lie theory, we then show that special cases of these generating functions enumerate orbits and conjugacy classes of suitable linear pro‐p groups.