Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'ftrace/ftrace/core' into HEAD
Conflicts: include/trace/trace_events.h Conflicts with: sched/tracing: Don't re-read p->state when emitting sched_switch event tracing: Introduce helpers to safely handle dynamic-sized sockaddrs
- Loading branch information
Showing
25 changed files
with
1,179 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* | ||
* Trace files that want to automate creation of all tracepoints defined | ||
* in their file should include this file. The following are macros that the | ||
* trace file may define: | ||
* | ||
* TRACE_SYSTEM defines the system the tracepoint is for | ||
* | ||
* TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h | ||
* This macro may be defined to tell define_trace.h what file to include. | ||
* Note, leave off the ".h". | ||
* | ||
* TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace | ||
* then this macro can define the path to use. Note, the path is relative to | ||
* define_trace.h, not the file including it. Full path names for out of tree | ||
* modules must be used. | ||
*/ | ||
|
||
#ifdef CREATE_CUSTOM_TRACE_EVENTS | ||
|
||
/* Prevent recursion */ | ||
#undef CREATE_CUSTOM_TRACE_EVENTS | ||
|
||
#include <linux/stringify.h> | ||
|
||
#undef TRACE_CUSTOM_EVENT | ||
#define TRACE_CUSTOM_EVENT(name, proto, args, tstruct, assign, print) | ||
|
||
#undef DEFINE_CUSTOM_EVENT | ||
#define DEFINE_CUSTOM_EVENT(template, name, proto, args) | ||
|
||
#undef TRACE_INCLUDE | ||
#undef __TRACE_INCLUDE | ||
|
||
#ifndef TRACE_INCLUDE_FILE | ||
# define TRACE_INCLUDE_FILE TRACE_SYSTEM | ||
# define UNDEF_TRACE_INCLUDE_FILE | ||
#endif | ||
|
||
#ifndef TRACE_INCLUDE_PATH | ||
# define __TRACE_INCLUDE(system) <trace/events/system.h> | ||
# define UNDEF_TRACE_INCLUDE_PATH | ||
#else | ||
# define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h) | ||
#endif | ||
|
||
# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system) | ||
|
||
/* Let the trace headers be reread */ | ||
#define TRACE_CUSTOM_MULTI_READ | ||
|
||
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
|
||
#ifdef TRACEPOINTS_ENABLED | ||
#include <trace/trace_custom_events.h> | ||
#endif | ||
|
||
#undef TRACE_CUSTOM_EVENT | ||
#undef DECLARE_CUSTOM_EVENT_CLASS | ||
#undef DEFINE_CUSTOM_EVENT | ||
#undef TRACE_CUSTOM_MULTI_READ | ||
|
||
/* Only undef what we defined in this file */ | ||
#ifdef UNDEF_TRACE_INCLUDE_FILE | ||
# undef TRACE_INCLUDE_FILE | ||
# undef UNDEF_TRACE_INCLUDE_FILE | ||
#endif | ||
|
||
#ifdef UNDEF_TRACE_INCLUDE_PATH | ||
# undef TRACE_INCLUDE_PATH | ||
# undef UNDEF_TRACE_INCLUDE_PATH | ||
#endif | ||
|
||
/* We may be processing more files */ | ||
#define CREATE_CUSTOM_TRACE_POINTS | ||
|
||
#endif /* CREATE_CUSTOM_TRACE_POINTS */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
#define __app__(x, y) str__##x##y | ||
#define __app(x, y) __app__(x, y) | ||
|
||
#define TRACE_SYSTEM_STRING __app(TRACE_SYSTEM_VAR,__trace_system_name) | ||
|
||
#define TRACE_MAKE_SYSTEM_STR() \ | ||
static const char TRACE_SYSTEM_STRING[] = \ | ||
__stringify(TRACE_SYSTEM) | ||
|
||
TRACE_MAKE_SYSTEM_STR(); | ||
|
||
#undef TRACE_DEFINE_ENUM | ||
#define TRACE_DEFINE_ENUM(a) \ | ||
static struct trace_eval_map __used __initdata \ | ||
__##TRACE_SYSTEM##_##a = \ | ||
{ \ | ||
.system = TRACE_SYSTEM_STRING, \ | ||
.eval_string = #a, \ | ||
.eval_value = a \ | ||
}; \ | ||
static struct trace_eval_map __used \ | ||
__section("_ftrace_eval_map") \ | ||
*TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a | ||
|
||
#undef TRACE_DEFINE_SIZEOF | ||
#define TRACE_DEFINE_SIZEOF(a) \ | ||
static struct trace_eval_map __used __initdata \ | ||
__##TRACE_SYSTEM##_##a = \ | ||
{ \ | ||
.system = TRACE_SYSTEM_STRING, \ | ||
.eval_string = "sizeof(" #a ")", \ | ||
.eval_value = sizeof(a) \ | ||
}; \ | ||
static struct trace_eval_map __used \ | ||
__section("_ftrace_eval_map") \ | ||
*TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
|
||
/* Stage 1 definitions for creating trace events */ | ||
|
||
#undef __field | ||
#define __field(type, item) type item; | ||
|
||
#undef __field_ext | ||
#define __field_ext(type, item, filter_type) type item; | ||
|
||
#undef __field_struct | ||
#define __field_struct(type, item) type item; | ||
|
||
#undef __field_struct_ext | ||
#define __field_struct_ext(type, item, filter_type) type item; | ||
|
||
#undef __array | ||
#define __array(type, item, len) type item[len]; | ||
|
||
#undef __dynamic_array | ||
#define __dynamic_array(type, item, len) u32 __data_loc_##item; | ||
|
||
#undef __string | ||
#define __string(item, src) __dynamic_array(char, item, -1) | ||
|
||
#undef __string_len | ||
#define __string_len(item, src, len) __dynamic_array(char, item, -1) | ||
|
||
#undef __bitmask | ||
#define __bitmask(item, nr_bits) __dynamic_array(char, item, -1) | ||
|
||
#undef __sockaddr | ||
#define __sockaddr(field, len) __dynamic_array(u8, field, len) | ||
|
||
#undef __rel_dynamic_array | ||
#define __rel_dynamic_array(type, item, len) u32 __rel_loc_##item; | ||
|
||
#undef __rel_string | ||
#define __rel_string(item, src) __rel_dynamic_array(char, item, -1) | ||
|
||
#undef __rel_string_len | ||
#define __rel_string_len(item, src, len) __rel_dynamic_array(char, item, -1) | ||
|
||
#undef __rel_bitmask | ||
#define __rel_bitmask(item, nr_bits) __rel_dynamic_array(char, item, -1) | ||
|
||
#undef __rel_sockaddr | ||
#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len) | ||
|
||
#undef TP_STRUCT__entry | ||
#define TP_STRUCT__entry(args...) args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
|
||
/* Stage 2 definitions for creating trace events */ | ||
|
||
#undef TRACE_DEFINE_ENUM | ||
#define TRACE_DEFINE_ENUM(a) | ||
|
||
#undef TRACE_DEFINE_SIZEOF | ||
#define TRACE_DEFINE_SIZEOF(a) | ||
|
||
#undef __field | ||
#define __field(type, item) | ||
|
||
#undef __field_ext | ||
#define __field_ext(type, item, filter_type) | ||
|
||
#undef __field_struct | ||
#define __field_struct(type, item) | ||
|
||
#undef __field_struct_ext | ||
#define __field_struct_ext(type, item, filter_type) | ||
|
||
#undef __array | ||
#define __array(type, item, len) | ||
|
||
#undef __dynamic_array | ||
#define __dynamic_array(type, item, len) u32 item; | ||
|
||
#undef __string | ||
#define __string(item, src) __dynamic_array(char, item, -1) | ||
|
||
#undef __string_len | ||
#define __string_len(item, src, len) __dynamic_array(char, item, -1) | ||
|
||
#undef __bitmask | ||
#define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1) | ||
|
||
#undef __sockaddr | ||
#define __sockaddr(field, len) __dynamic_array(u8, field, len) | ||
|
||
#undef __rel_dynamic_array | ||
#define __rel_dynamic_array(type, item, len) u32 item; | ||
|
||
#undef __rel_string | ||
#define __rel_string(item, src) __rel_dynamic_array(char, item, -1) | ||
|
||
#undef __rel_string_len | ||
#define __rel_string_len(item, src, len) __rel_dynamic_array(char, item, -1) | ||
|
||
#undef __rel_bitmask | ||
#define __rel_bitmask(item, nr_bits) __rel_dynamic_array(unsigned long, item, -1) |
Oops, something went wrong.