linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is it possible to trace events and its call stack?
@ 2017-01-12  7:49 Qu Wenruo
  2017-01-12 10:16 ` Naveen N. Rao
  2017-01-16  2:55 ` Masami Hiramatsu
  0 siblings, 2 replies; 8+ messages in thread
From: Qu Wenruo @ 2017-01-12  7:49 UTC (permalink / raw)
  To: linux-perf-users

Hi,

Is it possible to use perf/ftrace to trace events and its call stack?

[Background]
It's one structure in btrfs, btrfs_bio, I'm tracing for.
That structure is allocated and free somewhat frequently, and its size 
is not fixed, so no SLAB/SLUB cache is used.

I added trace events(or trace points, anyway, just in 
include/trace/events/btrfs.h) to trace the allocation and freeing.
Which will output the pointer address of that structure, so I can pair 
them, alone with other info.

Things went well until, I found some structures are allocated but not 
freed. (no corresponding trace point is triggered for given address).

It's possible that btrfs just forget to free it, or btrfs is just 
holding it for some purpose.
So kernel memleak detector won't catch the later one.

That's to say along with the tracepoint data, I still need the call 
stack of each calling, to determine the code who leak or hold the pointer.

Is it possible to do it using perf or ftrace?

Thanks,
Qu

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-01-16 19:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12  7:49 Is it possible to trace events and its call stack? Qu Wenruo
2017-01-12 10:16 ` Naveen N. Rao
2017-01-12 20:41   ` Arnaldo Carvalho de Melo
2017-01-16  8:54     ` Qu Wenruo
2017-01-16  2:55 ` Masami Hiramatsu
2017-01-16  8:48   ` Qu Wenruo
2017-01-16 12:26     ` Masami Hiramatsu
2017-01-16 19:32       ` Arnaldo Carvalho de Melo

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).