Skip to content

Commit

Permalink
tracing/mm: Move include of trace/events/kmem.h out of header into sl…
Browse files Browse the repository at this point in the history
…ab.c

Including trace/events/*.h TRACE_EVENT() macro headers in other headers
can cause strange side effects if another trace/event/*.h header
includes that header.  Having trace/events/kmem.h inside slab_def.h
caused a compile error in sparc64 when changes were done to some header
files.  Moving the kmem.h trace header out of slab.h and into slab.c
fixes the problem.

Note, both slub.c and slob.c already include the trace/events/kmem.h
file. Only slab.c had it missing.

Link: http://lkml.kernel.org/r/[email protected]

Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rostedt authored and torvalds committed Jan 9, 2012
1 parent 6b3da11 commit 4dee6b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions include/linux/slab_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */
#include <linux/compiler.h>

#include <trace/events/kmem.h>

/*
* struct kmem_cache
*
Expand Down
2 changes: 2 additions & 0 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
#include <asm/tlbflush.h>
#include <asm/page.h>

#include <trace/events/kmem.h>

/*
* DEBUG - 1 for kmem_cache_create() to honour; SLAB_RED_ZONE & SLAB_POISON.
* 0 for faster, smaller code (especially in the critical paths).
Expand Down

0 comments on commit 4dee6b6

Please sign in to comment.