Lines Matching refs:buf
700 char buf[100]; in slab_err() local
703 vsnprintf(buf, sizeof(buf), fmt, args); in slab_err()
705 slab_bug(s, "%s", buf); in slab_err()
4611 static int list_locations(struct kmem_cache *s, char *buf, in list_locations() argument
4624 return sprintf(buf, "Out of memory\n"); in list_locations()
4649 len += sprintf(buf + len, "%7ld ", l->count); in list_locations()
4652 len += sprintf(buf + len, "%pS", (void *)l->addr); in list_locations()
4654 len += sprintf(buf + len, "<not-available>"); in list_locations()
4657 len += sprintf(buf + len, " age=%ld/%ld/%ld", in list_locations()
4662 len += sprintf(buf + len, " age=%ld", in list_locations()
4666 len += sprintf(buf + len, " pid=%ld-%ld", in list_locations()
4669 len += sprintf(buf + len, " pid=%ld", in list_locations()
4675 len += scnprintf(buf + len, PAGE_SIZE - len - 50, in list_locations()
4681 len += scnprintf(buf + len, PAGE_SIZE - len - 50, in list_locations()
4685 len += sprintf(buf + len, "\n"); in list_locations()
4691 len += sprintf(buf, "No data\n"); in list_locations()
4788 char *buf, unsigned long flags) in show_slab_objects() argument
4882 x = sprintf(buf, "%lu", total); in show_slab_objects()
4886 x += sprintf(buf + x, " N%d=%lu", in show_slab_objects()
4890 return x + sprintf(buf + x, "\n"); in show_slab_objects()
4912 ssize_t (*show)(struct kmem_cache *s, char *buf);
4924 static ssize_t slab_size_show(struct kmem_cache *s, char *buf) in slab_size_show() argument
4926 return sprintf(buf, "%u\n", s->size); in slab_size_show()
4930 static ssize_t align_show(struct kmem_cache *s, char *buf) in align_show() argument
4932 return sprintf(buf, "%u\n", s->align); in align_show()
4936 static ssize_t object_size_show(struct kmem_cache *s, char *buf) in object_size_show() argument
4938 return sprintf(buf, "%u\n", s->object_size); in object_size_show()
4942 static ssize_t objs_per_slab_show(struct kmem_cache *s, char *buf) in objs_per_slab_show() argument
4944 return sprintf(buf, "%u\n", oo_objects(s->oo)); in objs_per_slab_show()
4949 const char *buf, size_t length) in order_store() argument
4954 err = kstrtouint(buf, 10, &order); in order_store()
4965 static ssize_t order_show(struct kmem_cache *s, char *buf) in order_show() argument
4967 return sprintf(buf, "%u\n", oo_order(s->oo)); in order_show()
4971 static ssize_t min_partial_show(struct kmem_cache *s, char *buf) in min_partial_show() argument
4973 return sprintf(buf, "%lu\n", s->min_partial); in min_partial_show()
4976 static ssize_t min_partial_store(struct kmem_cache *s, const char *buf, in min_partial_store() argument
4982 err = kstrtoul(buf, 10, &min); in min_partial_store()
4991 static ssize_t cpu_partial_show(struct kmem_cache *s, char *buf) in cpu_partial_show() argument
4993 return sprintf(buf, "%u\n", slub_cpu_partial(s)); in cpu_partial_show()
4996 static ssize_t cpu_partial_store(struct kmem_cache *s, const char *buf, in cpu_partial_store() argument
5002 err = kstrtouint(buf, 10, &objects); in cpu_partial_store()
5014 static ssize_t ctor_show(struct kmem_cache *s, char *buf) in ctor_show() argument
5018 return sprintf(buf, "%pS\n", s->ctor); in ctor_show()
5022 static ssize_t aliases_show(struct kmem_cache *s, char *buf) in aliases_show() argument
5024 return sprintf(buf, "%d\n", s->refcount < 0 ? 0 : s->refcount - 1); in aliases_show()
5028 static ssize_t partial_show(struct kmem_cache *s, char *buf) in partial_show() argument
5030 return show_slab_objects(s, buf, SO_PARTIAL); in partial_show()
5034 static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf) in cpu_slabs_show() argument
5036 return show_slab_objects(s, buf, SO_CPU); in cpu_slabs_show()
5040 static ssize_t objects_show(struct kmem_cache *s, char *buf) in objects_show() argument
5042 return show_slab_objects(s, buf, SO_ALL|SO_OBJECTS); in objects_show()
5046 static ssize_t objects_partial_show(struct kmem_cache *s, char *buf) in objects_partial_show() argument
5048 return show_slab_objects(s, buf, SO_PARTIAL|SO_OBJECTS); in objects_partial_show()
5052 static ssize_t slabs_cpu_partial_show(struct kmem_cache *s, char *buf) in slabs_cpu_partial_show() argument
5070 len = sprintf(buf, "%d(%d)", objects, pages); in slabs_cpu_partial_show()
5079 len += sprintf(buf + len, " C%d=%d(%d)", cpu, in slabs_cpu_partial_show()
5083 return len + sprintf(buf + len, "\n"); in slabs_cpu_partial_show()
5087 static ssize_t reclaim_account_show(struct kmem_cache *s, char *buf) in reclaim_account_show() argument
5089 return sprintf(buf, "%d\n", !!(s->flags & SLAB_RECLAIM_ACCOUNT)); in reclaim_account_show()
5093 const char *buf, size_t length) in reclaim_account_store() argument
5096 if (buf[0] == '1') in reclaim_account_store()
5102 static ssize_t hwcache_align_show(struct kmem_cache *s, char *buf) in hwcache_align_show() argument
5104 return sprintf(buf, "%d\n", !!(s->flags & SLAB_HWCACHE_ALIGN)); in hwcache_align_show()
5109 static ssize_t cache_dma_show(struct kmem_cache *s, char *buf) in cache_dma_show() argument
5111 return sprintf(buf, "%d\n", !!(s->flags & SLAB_CACHE_DMA)); in cache_dma_show()
5116 static ssize_t usersize_show(struct kmem_cache *s, char *buf) in usersize_show() argument
5118 return sprintf(buf, "%u\n", s->usersize); in usersize_show()
5122 static ssize_t destroy_by_rcu_show(struct kmem_cache *s, char *buf) in destroy_by_rcu_show() argument
5124 return sprintf(buf, "%d\n", !!(s->flags & SLAB_TYPESAFE_BY_RCU)); in destroy_by_rcu_show()
5129 static ssize_t slabs_show(struct kmem_cache *s, char *buf) in slabs_show() argument
5131 return show_slab_objects(s, buf, SO_ALL); in slabs_show()
5135 static ssize_t total_objects_show(struct kmem_cache *s, char *buf) in total_objects_show() argument
5137 return show_slab_objects(s, buf, SO_ALL|SO_TOTAL); in total_objects_show()
5141 static ssize_t sanity_checks_show(struct kmem_cache *s, char *buf) in sanity_checks_show() argument
5143 return sprintf(buf, "%d\n", !!(s->flags & SLAB_CONSISTENCY_CHECKS)); in sanity_checks_show()
5147 const char *buf, size_t length) in sanity_checks_store() argument
5150 if (buf[0] == '1') { in sanity_checks_store()
5158 static ssize_t trace_show(struct kmem_cache *s, char *buf) in trace_show() argument
5160 return sprintf(buf, "%d\n", !!(s->flags & SLAB_TRACE)); in trace_show()
5163 static ssize_t trace_store(struct kmem_cache *s, const char *buf, in trace_store() argument
5175 if (buf[0] == '1') { in trace_store()
5183 static ssize_t red_zone_show(struct kmem_cache *s, char *buf) in red_zone_show() argument
5185 return sprintf(buf, "%d\n", !!(s->flags & SLAB_RED_ZONE)); in red_zone_show()
5189 const char *buf, size_t length) in red_zone_store() argument
5195 if (buf[0] == '1') { in red_zone_store()
5203 static ssize_t poison_show(struct kmem_cache *s, char *buf) in poison_show() argument
5205 return sprintf(buf, "%d\n", !!(s->flags & SLAB_POISON)); in poison_show()
5209 const char *buf, size_t length) in poison_store() argument
5215 if (buf[0] == '1') { in poison_store()
5223 static ssize_t store_user_show(struct kmem_cache *s, char *buf) in store_user_show() argument
5225 return sprintf(buf, "%d\n", !!(s->flags & SLAB_STORE_USER)); in store_user_show()
5229 const char *buf, size_t length) in store_user_store() argument
5235 if (buf[0] == '1') { in store_user_store()
5244 static ssize_t validate_show(struct kmem_cache *s, char *buf) in validate_show() argument
5250 const char *buf, size_t length) in validate_store() argument
5254 if (buf[0] == '1') { in validate_store()
5263 static ssize_t alloc_calls_show(struct kmem_cache *s, char *buf) in alloc_calls_show() argument
5267 return list_locations(s, buf, TRACK_ALLOC); in alloc_calls_show()
5271 static ssize_t free_calls_show(struct kmem_cache *s, char *buf) in free_calls_show() argument
5275 return list_locations(s, buf, TRACK_FREE); in free_calls_show()
5281 static ssize_t failslab_show(struct kmem_cache *s, char *buf) in failslab_show() argument
5283 return sprintf(buf, "%d\n", !!(s->flags & SLAB_FAILSLAB)); in failslab_show()
5286 static ssize_t failslab_store(struct kmem_cache *s, const char *buf, in failslab_store() argument
5293 if (buf[0] == '1') in failslab_store()
5300 static ssize_t shrink_show(struct kmem_cache *s, char *buf) in shrink_show() argument
5306 const char *buf, size_t length) in shrink_store() argument
5308 if (buf[0] == '1') in shrink_store()
5317 static ssize_t remote_node_defrag_ratio_show(struct kmem_cache *s, char *buf) in remote_node_defrag_ratio_show() argument
5319 return sprintf(buf, "%u\n", s->remote_node_defrag_ratio / 10); in remote_node_defrag_ratio_show()
5323 const char *buf, size_t length) in remote_node_defrag_ratio_store() argument
5328 err = kstrtouint(buf, 10, &ratio); in remote_node_defrag_ratio_store()
5342 static int show_stat(struct kmem_cache *s, char *buf, enum stat_item si) in show_stat() argument
5359 len = sprintf(buf, "%lu", sum); in show_stat()
5364 len += sprintf(buf + len, " C%d=%u", cpu, data[cpu]); in show_stat()
5368 return len + sprintf(buf + len, "\n"); in show_stat()
5380 static ssize_t text##_show(struct kmem_cache *s, char *buf) \
5382 return show_stat(s, buf, si); \
5385 const char *buf, size_t length) \
5387 if (buf[0] != '0') \
5501 char *buf) in slab_attr_show() argument
5513 err = attribute->show(s, buf); in slab_attr_show()
5520 const char *buf, size_t len) in slab_attr_store() argument
5532 err = attribute->store(s, buf, len); in slab_attr_store()
5559 attribute->store(c, buf, len); in slab_attr_store()
5587 char *buf; in memcg_propagate_slab_attrs() local
5604 buf = buffer; in memcg_propagate_slab_attrs()
5606 buf = mbuf; in memcg_propagate_slab_attrs()
5611 buf = buffer; in memcg_propagate_slab_attrs()
5614 len = attr->show(root_cache, buf); in memcg_propagate_slab_attrs()
5616 attr->store(s, buf, len); in memcg_propagate_slab_attrs()