mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
tracing: create automated trace defines
This patch lowers the number of places a developer must modify to add new tracepoints. The current method to add a new tracepoint into an existing system is to write the trace point macro in the trace header with one of the macros TRACE_EVENT, TRACE_FORMAT or DECLARE_TRACE, then they must add the same named item into the C file with the macro DEFINE_TRACE(name) and then add the trace point. This change cuts out the needing to add the DEFINE_TRACE(name). Every file that uses the tracepoint must still include the trace/<type>.h file, but the one C file must also add a define before the including of that file. #define CREATE_TRACE_POINTS #include <trace/mytrace.h> This will cause the trace/mytrace.h file to also produce the C code necessary to implement the trace point. Note, if more than one trace/<type>.h is used to create the C code it is best to list them all together. #define CREATE_TRACE_POINTS #include <trace/foo.h> #include <trace/bar.h> #include <trace/fido.h> Thanks to Mathieu Desnoyers and Christoph Hellwig for coming up with the cleaner solution of the define above the includes over my first design to have the C code include a "special" header. This patch converts sched, irq and lockdep and skb to use this new method. Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Neil Horman <[email protected]> Cc: Zhao Lei <[email protected]> Cc: Eduard - Gabriel Munteanu <[email protected]> Cc: Pekka Enberg <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
This commit is contained in:
parent
ea20d9293c
commit
a8d154b009
16 changed files with 105 additions and 46 deletions
11
mm/util.c
11
mm/util.c
|
|
@ -4,9 +4,11 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/tracepoint.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/kmem.h>
|
||||
|
||||
/**
|
||||
* kstrdup - allocate space for and copy an existing string
|
||||
* @s: the string to duplicate
|
||||
|
|
@ -239,13 +241,6 @@ int __attribute__((weak)) get_user_pages_fast(unsigned long start,
|
|||
EXPORT_SYMBOL_GPL(get_user_pages_fast);
|
||||
|
||||
/* Tracepoints definitions. */
|
||||
DEFINE_TRACE(kmalloc);
|
||||
DEFINE_TRACE(kmem_cache_alloc);
|
||||
DEFINE_TRACE(kmalloc_node);
|
||||
DEFINE_TRACE(kmem_cache_alloc_node);
|
||||
DEFINE_TRACE(kfree);
|
||||
DEFINE_TRACE(kmem_cache_free);
|
||||
|
||||
EXPORT_TRACEPOINT_SYMBOL(kmalloc);
|
||||
EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc);
|
||||
EXPORT_TRACEPOINT_SYMBOL(kmalloc_node);
|
||||
|
|
|
|||
Loading…
Reference in a new issue