aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stackdepot.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-11-10 13:46:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-11-11 11:12:37 -0500
commitae65a21fb851f09bf6341761d884fb86b644b75a (patch)
treeb51be95172c143bf68aa824f595dd1e6446b5847 /lib/stackdepot.c
parentd7c19b066dcf4bd19c4385e8065558d4e74f9e73 (diff)
lib/stackdepot: export save/fetch stack for drivers
Some drivers would like to record stacktraces in order to aide leak tracing. As stackdepot already provides a facility for only storing the unique traces, thereby reducing the memory required, export that functionality for use by drivers. The code was originally created for KASAN and moved under lib in commit cd11016e5f521 ("mm, kasan: stackdepot implementation. Enable stackdepot for SLAB") so that it could be shared with mm/. In turn, we want to share it now with drivers. Link: http://lkml.kernel.org/r/20161108133209.22704-1-chris@chris-wilson.co.uk Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Alexander Potapenko <glider@google.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/stackdepot.c')
-rw-r--r--lib/stackdepot.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/stackdepot.c b/lib/stackdepot.c
index 4d830e299989..f87d138e9672 100644
--- a/lib/stackdepot.c
+++ b/lib/stackdepot.c
@@ -192,6 +192,7 @@ void depot_fetch_stack(depot_stack_handle_t handle, struct stack_trace *trace)
192 trace->entries = stack->entries; 192 trace->entries = stack->entries;
193 trace->skip = 0; 193 trace->skip = 0;
194} 194}
195EXPORT_SYMBOL_GPL(depot_fetch_stack);
195 196
196/** 197/**
197 * depot_save_stack - save stack in a stack depot. 198 * depot_save_stack - save stack in a stack depot.
@@ -283,3 +284,4 @@ exit:
283fast_exit: 284fast_exit:
284 return retval; 285 return retval;
285} 286}
287EXPORT_SYMBOL_GPL(depot_save_stack);