From f825628840e581f92f1c2e79dfa943f29c054e67 Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Tue, 3 Dec 2013 14:09:28 +0100 Subject: tools lib traceevent: Add kmem plugin Backporting kmem plugin. Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb): git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git This plugin adds call_site field resolving for following tracepoint events: kmem:kfree kmem:kmalloc kmem:kmalloc_node kmem:kmem_cache_alloc kmem:kmem_cache_alloc_node kmem:kmem_cache_free The diff of 'perf script' output generated by old and new code: (data was generated by 'perf record -e 'kmem:*' -a') --- script.kmem.old +++ script.kmem.new - perf 27846 [001] 29643.403319: kmem:kfree: call_site=ffffffff810e64f6 ptr=(nil) + perf 27846 [001] 29643.403238: kmem:kfree: (__audit_syscall_exit+0x1f6) call_site=ffffffff810e64f6 ptr=(nil) - perf 27846 [001] 29643.403337: kmem:kmem_cache_alloc: call_site=ffffffff812ff0c5 ptr=0xffff88020e155630 bytes_req=560 bytes_alloc=568 gfp_flags=GFP_KERNEL + perf 27846 [001] 29643.403337: kmem:kmem_cache_alloc: (radix_tree_preload+0x35) call_site=ffffffff812ff0c5 ptr=0xffff88020e155630 bytes_req=560 bytes_alloc=568 gfp_flags=GFP_KERNEL - perf 27846 [001] 29643.403342: kmem:kmem_cache_free: call_site=ffffffff8126ec61 ptr=0xffff88020dffe750 + perf 27846 [001] 29643.403342: kmem:kmem_cache_free: (jbd2_journal_stop+0x221) call_site=ffffffff8126ec61 ptr=0xffff88020dffe750 - firefox 954 [000] 29643.445477: kmem:kmem_cache_alloc_node: call_site=ffffffff8153c64e ptr=0xffff8801cecb4000 bytes_req=256 bytes_alloc=256 gfp_flags=GFP_KERNEL|GFP_REPEAT node=-1 + firefox 954 [000] 29643.445477: kmem:kmem_cache_alloc_node: (__alloc_skb+0x4e) call_site=ffffffff8153c64e ptr=0xffff8801cecb4000 bytes_req=256 bytes_alloc=256 gfp_flags=GFP_KERNEL|GFP_REPEAT node=-1 - perf 27846 [001] 29643.445510: kmem:kmalloc: call_site=ffffffff81250642 ptr=0xffff88020fd6c300 bytes_req=96 bytes_alloc=96 gfp_flags=GFP_NOFS|GFP_ZERO + perf 27846 [001] 29643.445510: kmem:kmalloc: (ext4_ext_find_extent+0x362) call_site=ffffffff81250642 ptr=0xffff88020fd6c300 bytes_req=96 bytes_alloc=96 gfp_flags=GFP_NOFS|GFP_ZERO - X 888 [002] 29643.445546: kmem:kmalloc_node: call_site=ffffffff8153c67e ptr=0xffff880103828e00 bytes_req=384 bytes_alloc=512 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_REPEAT|GFP_NOMEMALLOC node=-1 + X 888 [002] 29643.445546: kmem:kmalloc_node: (__alloc_skb+0x7e) call_site=ffffffff8153c67e ptr=0xffff880103828e00 bytes_req=384 bytes_alloc=512 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_REPEAT|GFP_NOMEMALLOC node=-1 Signed-off-by: Jiri Olsa Cc: Corey Ashford Cc: David Ahern Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Steven Rostedt Link: http://lkml.kernel.org/r/1386076182-14484-15-git-send-email-jolsa@redhat.com Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/lib/traceevent/Makefile') diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile index 9ff2e2596614..245d6b4f0aed 100644 --- a/tools/lib/traceevent/Makefile +++ b/tools/lib/traceevent/Makefile @@ -214,6 +214,7 @@ PEVENT_LIB_OBJS += kbuffer-parse.o PLUGIN_OBJS = plugin_jbd2.o PLUGIN_OBJS += plugin_hrtimer.o +PLUGIN_OBJS += plugin_kmem.o PLUGINS := $(PLUGIN_OBJS:.o=.so) -- cgit