Lines Matching refs:mtp

89 memstat_mtl_next(struct memory_type *mtp)  in memstat_mtl_next()  argument
92 return (LIST_NEXT(mtp, mt_list)); in memstat_mtl_next()
98 struct memory_type *mtp; in _memstat_mtl_empty() local
100 while ((mtp = LIST_FIRST(&list->mtl_list))) { in _memstat_mtl_empty()
101 free(mtp->mt_percpu_alloc); in _memstat_mtl_empty()
102 free(mtp->mt_percpu_cache); in _memstat_mtl_empty()
103 LIST_REMOVE(mtp, mt_list); in _memstat_mtl_empty()
104 free(mtp); in _memstat_mtl_empty()
132 struct memory_type *mtp; in memstat_mtl_find() local
134 LIST_FOREACH(mtp, &list->mtl_list, mt_list) { in memstat_mtl_find()
135 if ((mtp->mt_allocator == allocator || in memstat_mtl_find()
137 strcmp(mtp->mt_name, name) == 0) in memstat_mtl_find()
138 return (mtp); in memstat_mtl_find()
153 struct memory_type *mtp; in _memstat_mt_allocate() local
155 mtp = malloc(sizeof(*mtp)); in _memstat_mt_allocate()
156 if (mtp == NULL) in _memstat_mt_allocate()
159 bzero(mtp, sizeof(*mtp)); in _memstat_mt_allocate()
161 mtp->mt_allocator = allocator; in _memstat_mt_allocate()
162 mtp->mt_percpu_alloc = malloc(sizeof(struct mt_percpu_alloc_s) * in _memstat_mt_allocate()
164 mtp->mt_percpu_cache = malloc(sizeof(struct mt_percpu_cache_s) * in _memstat_mt_allocate()
166 strlcpy(mtp->mt_name, name, MEMTYPE_MAXNAME); in _memstat_mt_allocate()
167 LIST_INSERT_HEAD(&list->mtl_list, mtp, mt_list); in _memstat_mt_allocate()
168 return (mtp); in _memstat_mt_allocate()
179 _memstat_mt_reset_stats(struct memory_type *mtp, int maxcpus) in _memstat_mt_reset_stats() argument
183 mtp->mt_countlimit = 0; in _memstat_mt_reset_stats()
184 mtp->mt_byteslimit = 0; in _memstat_mt_reset_stats()
185 mtp->mt_sizemask = 0; in _memstat_mt_reset_stats()
186 mtp->mt_size = 0; in _memstat_mt_reset_stats()
188 mtp->mt_memalloced = 0; in _memstat_mt_reset_stats()
189 mtp->mt_memfreed = 0; in _memstat_mt_reset_stats()
190 mtp->mt_numallocs = 0; in _memstat_mt_reset_stats()
191 mtp->mt_numfrees = 0; in _memstat_mt_reset_stats()
192 mtp->mt_bytes = 0; in _memstat_mt_reset_stats()
193 mtp->mt_count = 0; in _memstat_mt_reset_stats()
194 mtp->mt_free = 0; in _memstat_mt_reset_stats()
195 mtp->mt_failures = 0; in _memstat_mt_reset_stats()
196 mtp->mt_sleeps = 0; in _memstat_mt_reset_stats()
198 mtp->mt_zonefree = 0; in _memstat_mt_reset_stats()
199 mtp->mt_kegfree = 0; in _memstat_mt_reset_stats()
202 mtp->mt_percpu_alloc[i].mtp_memalloced = 0; in _memstat_mt_reset_stats()
203 mtp->mt_percpu_alloc[i].mtp_memfreed = 0; in _memstat_mt_reset_stats()
204 mtp->mt_percpu_alloc[i].mtp_numallocs = 0; in _memstat_mt_reset_stats()
205 mtp->mt_percpu_alloc[i].mtp_numfrees = 0; in _memstat_mt_reset_stats()
206 mtp->mt_percpu_alloc[i].mtp_sizemask = 0; in _memstat_mt_reset_stats()
207 mtp->mt_percpu_cache[i].mtp_free = 0; in _memstat_mt_reset_stats()
216 memstat_get_name(const struct memory_type *mtp) in memstat_get_name() argument
219 return (mtp->mt_name); in memstat_get_name()
223 memstat_get_allocator(const struct memory_type *mtp) in memstat_get_allocator() argument
226 return (mtp->mt_allocator); in memstat_get_allocator()
230 memstat_get_countlimit(const struct memory_type *mtp) in memstat_get_countlimit() argument
233 return (mtp->mt_countlimit); in memstat_get_countlimit()
237 memstat_get_byteslimit(const struct memory_type *mtp) in memstat_get_byteslimit() argument
240 return (mtp->mt_byteslimit); in memstat_get_byteslimit()
244 memstat_get_sizemask(const struct memory_type *mtp) in memstat_get_sizemask() argument
247 return (mtp->mt_sizemask); in memstat_get_sizemask()
251 memstat_get_size(const struct memory_type *mtp) in memstat_get_size() argument
254 return (mtp->mt_size); in memstat_get_size()
258 memstat_get_rsize(const struct memory_type *mtp) in memstat_get_rsize() argument
261 return (mtp->mt_rsize); in memstat_get_rsize()
265 memstat_get_memalloced(const struct memory_type *mtp) in memstat_get_memalloced() argument
268 return (mtp->mt_memalloced); in memstat_get_memalloced()
272 memstat_get_memfreed(const struct memory_type *mtp) in memstat_get_memfreed() argument
275 return (mtp->mt_memfreed); in memstat_get_memfreed()
279 memstat_get_numallocs(const struct memory_type *mtp) in memstat_get_numallocs() argument
282 return (mtp->mt_numallocs); in memstat_get_numallocs()
286 memstat_get_numfrees(const struct memory_type *mtp) in memstat_get_numfrees() argument
289 return (mtp->mt_numfrees); in memstat_get_numfrees()
293 memstat_get_bytes(const struct memory_type *mtp) in memstat_get_bytes() argument
296 return (mtp->mt_bytes); in memstat_get_bytes()
300 memstat_get_count(const struct memory_type *mtp) in memstat_get_count() argument
303 return (mtp->mt_count); in memstat_get_count()
307 memstat_get_free(const struct memory_type *mtp) in memstat_get_free() argument
310 return (mtp->mt_free); in memstat_get_free()
314 memstat_get_failures(const struct memory_type *mtp) in memstat_get_failures() argument
317 return (mtp->mt_failures); in memstat_get_failures()
321 memstat_get_sleeps(const struct memory_type *mtp) in memstat_get_sleeps() argument
324 return (mtp->mt_sleeps); in memstat_get_sleeps()
328 memstat_get_xdomain(const struct memory_type *mtp) in memstat_get_xdomain() argument
331 return (mtp->mt_xdomain); in memstat_get_xdomain()
335 memstat_get_caller_pointer(const struct memory_type *mtp, int index) in memstat_get_caller_pointer() argument
338 return (mtp->mt_caller_pointer[index]); in memstat_get_caller_pointer()
342 memstat_set_caller_pointer(struct memory_type *mtp, int index, void *value) in memstat_set_caller_pointer() argument
345 mtp->mt_caller_pointer[index] = value; in memstat_set_caller_pointer()
349 memstat_get_caller_uint64(const struct memory_type *mtp, int index) in memstat_get_caller_uint64() argument
352 return (mtp->mt_caller_uint64[index]); in memstat_get_caller_uint64()
356 memstat_set_caller_uint64(struct memory_type *mtp, int index, uint64_t value) in memstat_set_caller_uint64() argument
359 mtp->mt_caller_uint64[index] = value; in memstat_set_caller_uint64()
363 memstat_get_zonefree(const struct memory_type *mtp) in memstat_get_zonefree() argument
366 return (mtp->mt_zonefree); in memstat_get_zonefree()
370 memstat_get_kegfree(const struct memory_type *mtp) in memstat_get_kegfree() argument
373 return (mtp->mt_kegfree); in memstat_get_kegfree()
377 memstat_get_percpu_memalloced(const struct memory_type *mtp, int cpu) in memstat_get_percpu_memalloced() argument
380 return (mtp->mt_percpu_alloc[cpu].mtp_memalloced); in memstat_get_percpu_memalloced()
384 memstat_get_percpu_memfreed(const struct memory_type *mtp, int cpu) in memstat_get_percpu_memfreed() argument
387 return (mtp->mt_percpu_alloc[cpu].mtp_memfreed); in memstat_get_percpu_memfreed()
391 memstat_get_percpu_numallocs(const struct memory_type *mtp, int cpu) in memstat_get_percpu_numallocs() argument
394 return (mtp->mt_percpu_alloc[cpu].mtp_numallocs); in memstat_get_percpu_numallocs()
398 memstat_get_percpu_numfrees(const struct memory_type *mtp, int cpu) in memstat_get_percpu_numfrees() argument
401 return (mtp->mt_percpu_alloc[cpu].mtp_numfrees); in memstat_get_percpu_numfrees()
405 memstat_get_percpu_sizemask(const struct memory_type *mtp, int cpu) in memstat_get_percpu_sizemask() argument
408 return (mtp->mt_percpu_alloc[cpu].mtp_sizemask); in memstat_get_percpu_sizemask()
412 memstat_get_percpu_caller_pointer(const struct memory_type *mtp, int cpu, in memstat_get_percpu_caller_pointer() argument
416 return (mtp->mt_percpu_alloc[cpu].mtp_caller_pointer[index]); in memstat_get_percpu_caller_pointer()
420 memstat_set_percpu_caller_pointer(struct memory_type *mtp, int cpu, in memstat_set_percpu_caller_pointer() argument
424 mtp->mt_percpu_alloc[cpu].mtp_caller_pointer[index] = value; in memstat_set_percpu_caller_pointer()
428 memstat_get_percpu_caller_uint64(const struct memory_type *mtp, int cpu, in memstat_get_percpu_caller_uint64() argument
432 return (mtp->mt_percpu_alloc[cpu].mtp_caller_uint64[index]); in memstat_get_percpu_caller_uint64()
436 memstat_set_percpu_caller_uint64(struct memory_type *mtp, int cpu, int index, in memstat_set_percpu_caller_uint64() argument
440 mtp->mt_percpu_alloc[cpu].mtp_caller_uint64[index] = value; in memstat_set_percpu_caller_uint64()
444 memstat_get_percpu_free(const struct memory_type *mtp, int cpu) in memstat_get_percpu_free() argument
447 return (mtp->mt_percpu_cache[cpu].mtp_free); in memstat_get_percpu_free()