* [PATCH] mm/kmemleak: Do not skip stack frames
@ 2014-10-21 12:19 Thierry Reding
2014-10-21 15:58 ` Catalin Marinas
0 siblings, 1 reply; 2+ messages in thread
From: Thierry Reding @ 2014-10-21 12:19 UTC (permalink / raw)
To: Catalin Marinas; +Cc: linux-mm, linux-kernel
From: Thierry Reding <treding@nvidia.com>
Trying to chase down memory leaks is much easier when the complete stack
trace is available.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
It seems like this was initially set to 1 when merged in commit
3c7b4e6b8be4 (kmemleak: Add the base support) and later increased to 2
in commit fd6789675ebf (kmemleak: Save the stack trace for early
allocations). Perhaps there was a reason to skip the first few frames,
but I've certainly found it difficult to find leaks when the stack trace
doesn't point at the proper location.
---
mm/kmemleak.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 3cda50c1e394..55d9ad0f40d4 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -503,7 +503,7 @@ static int __save_stack_trace(unsigned long *trace)
stack_trace.max_entries = MAX_TRACE;
stack_trace.nr_entries = 0;
stack_trace.entries = trace;
- stack_trace.skip = 2;
+ stack_trace.skip = 0;
save_stack_trace(&stack_trace);
return stack_trace.nr_entries;
--
2.1.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm/kmemleak: Do not skip stack frames
2014-10-21 12:19 [PATCH] mm/kmemleak: Do not skip stack frames Thierry Reding
@ 2014-10-21 15:58 ` Catalin Marinas
0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2014-10-21 15:58 UTC (permalink / raw)
To: Thierry Reding; +Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
On Tue, Oct 21, 2014 at 01:19:29PM +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Trying to chase down memory leaks is much easier when the complete stack
> trace is available.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> It seems like this was initially set to 1 when merged in commit
> 3c7b4e6b8be4 (kmemleak: Add the base support) and later increased to 2
> in commit fd6789675ebf (kmemleak: Save the stack trace for early
> allocations). Perhaps there was a reason to skip the first few frames,
> but I've certainly found it difficult to find leaks when the stack trace
> doesn't point at the proper location.
> ---
> mm/kmemleak.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index 3cda50c1e394..55d9ad0f40d4 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -503,7 +503,7 @@ static int __save_stack_trace(unsigned long *trace)
> stack_trace.max_entries = MAX_TRACE;
> stack_trace.nr_entries = 0;
> stack_trace.entries = trace;
> - stack_trace.skip = 2;
> + stack_trace.skip = 0;
The reason for this was to avoid listing some of the kmemleak internals
(kmemleak_alloc -> create_object -> __save_stack_trace). I can see how
inlining of __save_stack_trace() would cause some of the last frames to
be missed. I would still prefer to keep it at 1 rather than 0?
Which architecture are you testing on? What's the additional trace you
get with this patch?
--
Catalin
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-21 15:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-21 12:19 [PATCH] mm/kmemleak: Do not skip stack frames Thierry Reding
2014-10-21 15:58 ` Catalin Marinas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).