slab: use __func__ to trace function name
authorgumingtao <gumingtao1225@gmail.com>
Tue, 29 Jun 2021 02:34:27 +0000 (19:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Jun 2021 17:53:46 +0000 (10:53 -0700)
It is better to use __func__ to trace function name.

Link: https://lkml.kernel.org/r/31fdbad5c45cd1e26be9ff37be321b8586b80fee.1624355507.git.gumingtao@xiaomi.com
Signed-off-by: gumingtao <gumingtao@xiaomi.com>
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Aaron Tomlin <atomlin@redhat.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slab_common.c

index 7cab77655f11aca1f145bdea44112d224335b6f4..1ded52592b56393f1a423c640c041a9d47a27486 100644 (file)
@@ -377,11 +377,11 @@ out_unlock:
 
        if (err) {
                if (flags & SLAB_PANIC)
-                       panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",
-                               name, err);
+                       panic("%s: Failed to create slab '%s'. Error %d\n",
+                               __func__, name, err);
                else {
-                       pr_warn("kmem_cache_create(%s) failed with error %d\n",
-                               name, err);
+                       pr_warn("%s(%s) failed with error %d\n",
+                               __func__, name, err);
                        dump_stack();
                }
                return NULL;
@@ -508,8 +508,8 @@ void kmem_cache_destroy(struct kmem_cache *s)
 
        err = shutdown_cache(s);
        if (err) {
-               pr_err("kmem_cache_destroy %s: Slab cache still has objects\n",
-                      s->name);
+               pr_err("%s %s: Slab cache still has objects\n",
+                      __func__, s->name);
                dump_stack();
        }
 out_unlock: