Where is ptv and kstats defined and what do they do?

I’m looking at the source-af-packet.c file and there are many refrences to kstats and ptv. Where are these defined and what is there purpose?

They are defined in the same file. kstats is used to get stats from afpacket, ptv is storing thread local variables.