diff mbox series

[v3] slab: Use __func__ to trace function name

Message ID 31fdbad5c45cd1e26be9ff37be321b8586b80fee.1624355507.git.gumingtao@xiaomi.com (mailing list archive)
State New
Headers show
Series [v3] slab: Use __func__ to trace function name | expand

Commit Message

gumingtao June 22, 2021, 9:59 a.m. UTC
It is better to use __func__ to trace function name.

Signed-off-by: gumingtao <gumingtao@xiaomi.com>
---
 mm/slab_common.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Christoph Lameter June 22, 2021, 11:55 a.m. UTC | #1
On Tue, 22 Jun 2021, gumingtao wrote:

> It is better to use __func__ to trace function name.

Acked-by: Christoph Lameter <cl@linux.com>
David Rientjes June 22, 2021, 11:48 p.m. UTC | #2
On Tue, 22 Jun 2021, gumingtao wrote:

> It is better to use __func__ to trace function name.
> 
> Signed-off-by: gumingtao <gumingtao@xiaomi.com>

Acked-by: David Rientjes <rientjes@google.com>
Aaron Tomlin June 23, 2021, 8:17 a.m. UTC | #3
On Tue 2021-06-22 17:59 +0800, gumingtao wrote:
> It is better to use __func__ to trace function name.
> 
> Signed-off-by: gumingtao <gumingtao@xiaomi.com>
> ---
>  mm/slab_common.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Aaron Tomlin <atomlin@redhat.com>
diff mbox series

Patch

diff --git a/mm/slab_common.c b/mm/slab_common.c
index a4a5714..ffa3b11 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -378,11 +378,11 @@  kmem_cache_create_usercopy(const char *name,
 
 	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;
@@ -509,8 +509,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: