Re: [Intel-gfx] [patch V2 08/29] mm/kmemleak: Simplify stacktrace handling

2019-04-20 Thread Catalin Marinas
On Thu, Apr 18, 2019 at 10:41:27AM +0200, Thomas Gleixner wrote:
> Replace the indirection through struct stack_trace by using the storage
> array based interfaces.
> 
> Signed-off-by: Thomas Gleixner 
> Cc: Catalin Marinas 
> Cc: linux...@kvack.org

Acked-by: Catalin Marinas 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Intel-gfx] [patch V2 08/29] mm/kmemleak: Simplify stacktrace handling

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace by using the storage
array based interfaces.

Signed-off-by: Thomas Gleixner 
Cc: Catalin Marinas 
Cc: linux...@kvack.org
---
 mm/kmemleak.c |   24 +++-
 1 file changed, 3 insertions(+), 21 deletions(-)

--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -410,11 +410,6 @@ static void print_unreferenced(struct se
  */
 static void dump_object_info(struct kmemleak_object *object)
 {
-   struct stack_trace trace;
-
-   trace.nr_entries = object->trace_len;
-   trace.entries = object->trace;
-
pr_notice("Object 0x%08lx (size %zu):\n",
  object->pointer, object->size);
pr_notice("  comm \"%s\", pid %d, jiffies %lu\n",
@@ -424,7 +419,7 @@ static void dump_object_info(struct kmem
pr_notice("  flags = 0x%x\n", object->flags);
pr_notice("  checksum = %u\n", object->checksum);
pr_notice("  backtrace:\n");
-   print_stack_trace(, 4);
+   stack_trace_print(object->trace, object->trace_len, 4);
 }
 
 /*
@@ -553,15 +548,7 @@ static struct kmemleak_object *find_and_
  */
 static int __save_stack_trace(unsigned long *trace)
 {
-   struct stack_trace stack_trace;
-
-   stack_trace.max_entries = MAX_TRACE;
-   stack_trace.nr_entries = 0;
-   stack_trace.entries = trace;
-   stack_trace.skip = 2;
-   save_stack_trace(_trace);
-
-   return stack_trace.nr_entries;
+   return stack_trace_save(trace, MAX_TRACE, 2);
 }
 
 /*
@@ -2019,13 +2006,8 @@ early_param("kmemleak", kmemleak_boot_co
 
 static void __init print_log_trace(struct early_log *log)
 {
-   struct stack_trace trace;
-
-   trace.nr_entries = log->trace_len;
-   trace.entries = log->trace;
-
pr_notice("Early log backtrace:\n");
-   print_stack_trace(, 2);
+   stack_trace_print(log->trace, log->trace_len, 2);
 }
 
 /*


___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx