--- zzzz-none-000/linux-4.4.60/mm/slab.h 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-1750e-727/linux-4.4.60/mm/slab.h 2021-02-04 17:41:59.000000000 +0000 @@ -120,8 +120,11 @@ #if defined(CONFIG_DEBUG_SLAB) #define SLAB_DEBUG_FLAGS (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER) #elif defined(CONFIG_SLUB_DEBUG) -#define SLAB_DEBUG_FLAGS (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \ +#define SLAB_DEBUG_FLAGS (SLAB_RED_ZONE | SLAB_POISON | \ + SLAB_STORE_USER | SLAB_STORE_USER_LITE | \ SLAB_TRACE | SLAB_DEBUG_FREE) +#elif defined(CONFIG_DEBUG_SLAB_AVM_LITE) +#define SLAB_DEBUG_FLAGS (SLAB_POISON | SLAB_STORE_USER_AND_TIME) #else #define SLAB_DEBUG_FLAGS (0) #endif @@ -371,4 +374,25 @@ void slab_stop(struct seq_file *m, void *p); int memcg_slab_show(struct seq_file *m, void *p); +#if defined(CONFIG_SLUB_AVM_ALLOC_LIST) || defined(CONFIG_DEBUG_SLAB_AVM_LITE) +extern unsigned int slab_track_time; + +struct _slab_avm_alloc_entry { + unsigned long caller; + unsigned int count; + unsigned long long sum_time; +}; + +struct _slab_avm_topalloclist { + struct _slab_avm_alloc_entry entry[128]; + unsigned int entries; + unsigned int ignored; /*--- not enough entries ---*/ + unsigned long sum_count; /*--- all caller-count + ignored ---*/ +}; + +void cache_avm_topalloc_list(struct _slab_avm_topalloclist *ptoplist, + struct kmem_cache *cachep, + unsigned long tresh_jiffiesdiff); +#endif/*--- #if defined(CONFIG_SLUB_AVM_ALLOC_LIST) ---*/ + #endif /* MM_SLAB_H */