Commit 02af61bb authored by Zhaolei's avatar Zhaolei Committed by Ingo Molnar

tracing, kmemtrace: Separate include/trace/kmemtrace.h to kmemtrace part and tracepoint part

Impact: refactor code for future changes

Current kmemtrace.h is used both as header file of kmemtrace and kmem's
tracepoints definition.

Tracepoints' definition file may be used by other code, and should only have
definition of tracepoint.

We can separate include/trace/kmemtrace.h into 2 files:

  include/linux/kmemtrace.h: header file for kmemtrace
  include/trace/kmem.h:      definition of kmem tracepoints
Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
Acked-by: default avatarEduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Acked-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <49DEE68A.5040902@cn.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent abd41443
/*
* Copyright (C) 2008 Eduard - Gabriel Munteanu
*
* This file is released under GPL version 2.
*/
#ifndef _LINUX_KMEMTRACE_H
#define _LINUX_KMEMTRACE_H
#ifdef __KERNEL__
#include <trace/kmem.h>
#ifdef CONFIG_KMEMTRACE
extern void kmemtrace_init(void);
#else
static inline void kmemtrace_init(void)
{
}
#endif
#endif /* __KERNEL__ */
#endif /* _LINUX_KMEMTRACE_H */
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ #include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */
#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */
#include <linux/compiler.h> #include <linux/compiler.h>
#include <trace/kmemtrace.h> #include <linux/kmemtrace.h>
/* Size description struct for general caches. */ /* Size description struct for general caches. */
struct cache_sizes { struct cache_sizes {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/kobject.h> #include <linux/kobject.h>
#include <trace/kmemtrace.h> #include <linux/kmemtrace.h>
enum stat_item { enum stat_item {
ALLOC_FASTPATH, /* Allocation from cpu slab */ ALLOC_FASTPATH, /* Allocation from cpu slab */
......
/* #ifndef _TRACE_KMEM_H
* Copyright (C) 2008 Eduard - Gabriel Munteanu #define _TRACE_KMEM_H
*
* This file is released under GPL version 2.
*/
#ifndef _LINUX_KMEMTRACE_H
#define _LINUX_KMEMTRACE_H
#ifdef __KERNEL__
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
#include <linux/types.h> #include <linux/types.h>
#ifdef CONFIG_KMEMTRACE
extern void kmemtrace_init(void);
#else
static inline void kmemtrace_init(void)
{
}
#endif
DECLARE_TRACE(kmalloc, DECLARE_TRACE(kmalloc,
TP_PROTO(unsigned long call_site, TP_PROTO(unsigned long call_site,
const void *ptr, const void *ptr,
...@@ -57,7 +41,4 @@ DECLARE_TRACE(kmem_cache_free, ...@@ -57,7 +41,4 @@ DECLARE_TRACE(kmem_cache_free,
TP_PROTO(unsigned long call_site, const void *ptr), TP_PROTO(unsigned long call_site, const void *ptr),
TP_ARGS(call_site, ptr)); TP_ARGS(call_site, ptr));
#endif /* __KERNEL__ */ #endif /* _TRACE_KMEM_H */
#endif /* _LINUX_KMEMTRACE_H */
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include <linux/idr.h> #include <linux/idr.h>
#include <linux/ftrace.h> #include <linux/ftrace.h>
#include <linux/async.h> #include <linux/async.h>
#include <linux/kmemtrace.h>
#include <trace/boot.h> #include <trace/boot.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -71,7 +72,6 @@ ...@@ -71,7 +72,6 @@
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <trace/kmemtrace.h>
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
#include <asm/smp.h> #include <asm/smp.h>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/dcache.h> #include <linux/dcache.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <trace/kmemtrace.h> #include <linux/kmemtrace.h>
#include "trace_output.h" #include "trace_output.h"
#include "trace.h" #include "trace.h"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <linux/mmiotrace.h> #include <linux/mmiotrace.h>
#include <linux/ftrace.h> #include <linux/ftrace.h>
#include <trace/boot.h> #include <trace/boot.h>
#include <trace/kmemtrace.h> #include <linux/kmemtrace.h>
#include <trace/power.h> #include <trace/power.h>
enum trace_type { enum trace_type {
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <linux/module.h> #include <linux/module.h>
#include <trace/kmemtrace.h> #include <linux/kmemtrace.h>
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include <linux/list.h> #include <linux/list.h>
#include <trace/kmemtrace.h> #include <linux/kmemtrace.h>
#include <asm/atomic.h> #include <asm/atomic.h>
/* /*
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <trace/kmemtrace.h> #include <linux/kmemtrace.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/cpuset.h> #include <linux/cpuset.h>
#include <linux/mempolicy.h> #include <linux/mempolicy.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment