License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2009-03-06 02:35:29 +00:00
|
|
|
/*
|
|
|
|
* trace_export.c - export basic ftrace utilities to user space
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com>
|
|
|
|
*/
|
|
|
|
#include <linux/stringify.h>
|
|
|
|
#include <linux/kallsyms.h>
|
|
|
|
#include <linux/seq_file.h>
|
|
|
|
#include <linux/uaccess.h>
|
|
|
|
#include <linux/ftrace.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
|
|
|
|
#include "trace_output.h"
|
|
|
|
|
2018-05-09 18:17:48 +00:00
|
|
|
/* Stub function for events with triggers */
|
|
|
|
static int ftrace_event_register(struct trace_event_call *call,
|
|
|
|
enum trace_reg type, void *data)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-09-12 23:26:21 +00:00
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM ftrace
|
tracing: new format for specialized trace points
Impact: clean up and enhancement
The TRACE_EVENT_FORMAT macro looks quite ugly and is limited in its
ability to save data as well as to print the record out. Working with
Ingo Molnar, we came up with a new format that is much more pleasing to
the eye of C developers. This new macro is more C style than the old
macro, and is more obvious to what it does.
Here's the example. The only updated macro in this patch is the
sched_switch trace point.
The old method looked like this:
TRACE_EVENT_FORMAT(sched_switch,
TP_PROTO(struct rq *rq, struct task_struct *prev,
struct task_struct *next),
TP_ARGS(rq, prev, next),
TP_FMT("task %s:%d ==> %s:%d",
prev->comm, prev->pid, next->comm, next->pid),
TRACE_STRUCT(
TRACE_FIELD(pid_t, prev_pid, prev->pid)
TRACE_FIELD(int, prev_prio, prev->prio)
TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],
next_comm,
TP_CMD(memcpy(TRACE_ENTRY->next_comm,
next->comm,
TASK_COMM_LEN)))
TRACE_FIELD(pid_t, next_pid, next->pid)
TRACE_FIELD(int, next_prio, next->prio)
),
TP_RAW_FMT("prev %d:%d ==> next %s:%d:%d")
);
The above method is hard to read and requires two format fields.
The new method:
/*
* Tracepoint for task switches, performed by the scheduler:
*
* (NOTE: the 'rq' argument is not used by generic trace events,
* but used by the latency tracer plugin. )
*/
TRACE_EVENT(sched_switch,
TP_PROTO(struct rq *rq, struct task_struct *prev,
struct task_struct *next),
TP_ARGS(rq, prev, next),
TP_STRUCT__entry(
__array( char, prev_comm, TASK_COMM_LEN )
__field( pid_t, prev_pid )
__field( int, prev_prio )
__array( char, next_comm, TASK_COMM_LEN )
__field( pid_t, next_pid )
__field( int, next_prio )
),
TP_printk("task %s:%d [%d] ==> %s:%d [%d]",
__entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
__entry->next_comm, __entry->next_pid, __entry->next_prio),
TP_fast_assign(
memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
__entry->prev_pid = prev->pid;
__entry->prev_prio = prev->prio;
memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
__entry->next_pid = next->pid;
__entry->next_prio = next->prio;
)
);
This macro is called TRACE_EVENT, it is broken up into 5 parts:
TP_PROTO: the proto type of the trace point
TP_ARGS: the arguments of the trace point
TP_STRUCT_entry: the structure layout of the entry in the ring buffer
TP_printk: the printk format
TP_fast_assign: the method used to write the entry into the ring buffer
The structure is the definition of how the event will be saved in the
ring buffer. The printk is used by the internal tracing in case of
an oops, and the kernel needs to print out the format of the record
to the console. This the TP_printk gives a means to show the records
in a human readable format. It is also used to print out the data
from the trace file.
The TP_fast_assign is executed directly. It is basically like a C function,
where the __entry is the handle to the record.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2009-03-09 21:14:30 +00:00
|
|
|
|
2012-02-15 14:51:51 +00:00
|
|
|
/*
|
|
|
|
* The FTRACE_ENTRY_REG macro allows ftrace entry to define register
|
|
|
|
* function and thus become accesible via perf.
|
|
|
|
*/
|
|
|
|
#undef FTRACE_ENTRY_REG
|
2012-02-15 14:51:53 +00:00
|
|
|
#define FTRACE_ENTRY_REG(name, struct_name, id, tstruct, print, \
|
|
|
|
filter, regfn) \
|
|
|
|
FTRACE_ENTRY(name, struct_name, id, PARAMS(tstruct), PARAMS(print), \
|
|
|
|
filter)
|
2012-02-15 14:51:51 +00:00
|
|
|
|
2009-09-12 23:26:21 +00:00
|
|
|
/* not needed for this file */
|
|
|
|
#undef __field_struct
|
|
|
|
#define __field_struct(type, item)
|
tracing: new format for specialized trace points
Impact: clean up and enhancement
The TRACE_EVENT_FORMAT macro looks quite ugly and is limited in its
ability to save data as well as to print the record out. Working with
Ingo Molnar, we came up with a new format that is much more pleasing to
the eye of C developers. This new macro is more C style than the old
macro, and is more obvious to what it does.
Here's the example. The only updated macro in this patch is the
sched_switch trace point.
The old method looked like this:
TRACE_EVENT_FORMAT(sched_switch,
TP_PROTO(struct rq *rq, struct task_struct *prev,
struct task_struct *next),
TP_ARGS(rq, prev, next),
TP_FMT("task %s:%d ==> %s:%d",
prev->comm, prev->pid, next->comm, next->pid),
TRACE_STRUCT(
TRACE_FIELD(pid_t, prev_pid, prev->pid)
TRACE_FIELD(int, prev_prio, prev->prio)
TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],
next_comm,
TP_CMD(memcpy(TRACE_ENTRY->next_comm,
next->comm,
TASK_COMM_LEN)))
TRACE_FIELD(pid_t, next_pid, next->pid)
TRACE_FIELD(int, next_prio, next->prio)
),
TP_RAW_FMT("prev %d:%d ==> next %s:%d:%d")
);
The above method is hard to read and requires two format fields.
The new method:
/*
* Tracepoint for task switches, performed by the scheduler:
*
* (NOTE: the 'rq' argument is not used by generic trace events,
* but used by the latency tracer plugin. )
*/
TRACE_EVENT(sched_switch,
TP_PROTO(struct rq *rq, struct task_struct *prev,
struct task_struct *next),
TP_ARGS(rq, prev, next),
TP_STRUCT__entry(
__array( char, prev_comm, TASK_COMM_LEN )
__field( pid_t, prev_pid )
__field( int, prev_prio )
__array( char, next_comm, TASK_COMM_LEN )
__field( pid_t, next_pid )
__field( int, next_prio )
),
TP_printk("task %s:%d [%d] ==> %s:%d [%d]",
__entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
__entry->next_comm, __entry->next_pid, __entry->next_prio),
TP_fast_assign(
memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
__entry->prev_pid = prev->pid;
__entry->prev_prio = prev->prio;
memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
__entry->next_pid = next->pid;
__entry->next_prio = next->prio;
)
);
This macro is called TRACE_EVENT, it is broken up into 5 parts:
TP_PROTO: the proto type of the trace point
TP_ARGS: the arguments of the trace point
TP_STRUCT_entry: the structure layout of the entry in the ring buffer
TP_printk: the printk format
TP_fast_assign: the method used to write the entry into the ring buffer
The structure is the definition of how the event will be saved in the
ring buffer. The printk is used by the internal tracing in case of
an oops, and the kernel needs to print out the format of the record
to the console. This the TP_printk gives a means to show the records
in a human readable format. It is also used to print out the data
from the trace file.
The TP_fast_assign is executed directly. It is basically like a C function,
where the __entry is the handle to the record.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2009-03-09 21:14:30 +00:00
|
|
|
|
2009-09-14 07:54:52 +00:00
|
|
|
#undef __field
|
|
|
|
#define __field(type, item) type item;
|
|
|
|
|
|
|
|
#undef __field_desc
|
|
|
|
#define __field_desc(type, container, item) type item;
|
|
|
|
|
|
|
|
#undef __array
|
|
|
|
#define __array(type, item, size) type item[size];
|
|
|
|
|
|
|
|
#undef __array_desc
|
|
|
|
#define __array_desc(type, container, item, size) type item[size];
|
|
|
|
|
|
|
|
#undef __dynamic_array
|
|
|
|
#define __dynamic_array(type, item) type item[];
|
|
|
|
|
|
|
|
#undef F_STRUCT
|
|
|
|
#define F_STRUCT(args...) args
|
|
|
|
|
|
|
|
#undef F_printk
|
|
|
|
#define F_printk(fmt, args...) fmt, args
|
|
|
|
|
|
|
|
#undef FTRACE_ENTRY
|
2012-02-15 14:51:53 +00:00
|
|
|
#define FTRACE_ENTRY(name, struct_name, id, tstruct, print, filter) \
|
|
|
|
struct ____ftrace_##name { \
|
|
|
|
tstruct \
|
|
|
|
}; \
|
|
|
|
static void __always_unused ____ftrace_check_##name(void) \
|
|
|
|
{ \
|
|
|
|
struct ____ftrace_##name *__entry = NULL; \
|
|
|
|
\
|
|
|
|
/* force compile-time check on F_printk() */ \
|
|
|
|
printk(print); \
|
2009-09-14 07:54:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#undef FTRACE_ENTRY_DUP
|
2012-02-15 14:51:53 +00:00
|
|
|
#define FTRACE_ENTRY_DUP(name, struct_name, id, tstruct, print, filter) \
|
|
|
|
FTRACE_ENTRY(name, struct_name, id, PARAMS(tstruct), PARAMS(print), \
|
|
|
|
filter)
|
2009-09-14 07:54:52 +00:00
|
|
|
|
|
|
|
#include "trace_entries.h"
|
|
|
|
|
2009-09-12 23:26:21 +00:00
|
|
|
#undef __field
|
|
|
|
#define __field(type, item) \
|
|
|
|
ret = trace_define_field(event_call, #type, #item, \
|
|
|
|
offsetof(typeof(field), item), \
|
|
|
|
sizeof(field.item), \
|
2012-02-15 14:51:53 +00:00
|
|
|
is_signed_type(type), filter_type); \
|
2009-09-12 23:26:21 +00:00
|
|
|
if (ret) \
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
#undef __field_desc
|
|
|
|
#define __field_desc(type, container, item) \
|
|
|
|
ret = trace_define_field(event_call, #type, #item, \
|
|
|
|
offsetof(typeof(field), \
|
|
|
|
container.item), \
|
|
|
|
sizeof(field.container.item), \
|
2012-02-15 14:51:53 +00:00
|
|
|
is_signed_type(type), filter_type); \
|
2009-09-12 23:26:21 +00:00
|
|
|
if (ret) \
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
#undef __array
|
|
|
|
#define __array(type, item, len) \
|
2010-11-13 03:32:11 +00:00
|
|
|
do { \
|
2014-02-14 03:51:48 +00:00
|
|
|
char *type_str = #type"["__stringify(len)"]"; \
|
2010-11-13 03:32:11 +00:00
|
|
|
BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
|
2014-02-14 03:51:48 +00:00
|
|
|
ret = trace_define_field(event_call, type_str, #item, \
|
2009-09-12 23:26:21 +00:00
|
|
|
offsetof(typeof(field), item), \
|
2009-12-15 07:39:38 +00:00
|
|
|
sizeof(field.item), \
|
2012-02-15 14:51:53 +00:00
|
|
|
is_signed_type(type), filter_type); \
|
2010-11-13 03:32:11 +00:00
|
|
|
if (ret) \
|
|
|
|
return ret; \
|
|
|
|
} while (0);
|
2009-09-12 23:26:21 +00:00
|
|
|
|
|
|
|
#undef __array_desc
|
|
|
|
#define __array_desc(type, container, item, len) \
|
|
|
|
BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
|
|
|
|
ret = trace_define_field(event_call, #type "[" #len "]", #item, \
|
|
|
|
offsetof(typeof(field), \
|
|
|
|
container.item), \
|
2009-12-15 07:39:38 +00:00
|
|
|
sizeof(field.container.item), \
|
2012-02-15 14:51:53 +00:00
|
|
|
is_signed_type(type), filter_type); \
|
2009-09-12 23:26:21 +00:00
|
|
|
if (ret) \
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
#undef __dynamic_array
|
2009-12-15 07:39:34 +00:00
|
|
|
#define __dynamic_array(type, item) \
|
2018-05-09 13:24:00 +00:00
|
|
|
ret = trace_define_field(event_call, #type "[]", #item, \
|
2009-12-15 07:39:34 +00:00
|
|
|
offsetof(typeof(field), item), \
|
2012-02-15 14:51:53 +00:00
|
|
|
0, is_signed_type(type), filter_type);\
|
2009-12-15 07:39:34 +00:00
|
|
|
if (ret) \
|
|
|
|
return ret;
|
2009-09-12 23:26:21 +00:00
|
|
|
|
|
|
|
#undef FTRACE_ENTRY
|
2012-02-15 14:51:53 +00:00
|
|
|
#define FTRACE_ENTRY(name, struct_name, id, tstruct, print, filter) \
|
2013-02-21 02:33:33 +00:00
|
|
|
static int __init \
|
2015-05-05 15:45:27 +00:00
|
|
|
ftrace_define_fields_##name(struct trace_event_call *event_call) \
|
2009-03-31 05:49:16 +00:00
|
|
|
{ \
|
2009-09-12 23:26:21 +00:00
|
|
|
struct struct_name field; \
|
2009-03-31 05:49:16 +00:00
|
|
|
int ret; \
|
2012-02-15 14:51:53 +00:00
|
|
|
int filter_type = filter; \
|
2009-03-31 05:49:16 +00:00
|
|
|
\
|
2009-09-12 23:26:21 +00:00
|
|
|
tstruct; \
|
2009-03-31 05:49:16 +00:00
|
|
|
\
|
|
|
|
return ret; \
|
|
|
|
}
|
|
|
|
|
2009-09-12 23:26:21 +00:00
|
|
|
#include "trace_entries.h"
|
|
|
|
|
2009-12-15 07:39:42 +00:00
|
|
|
#undef __entry
|
|
|
|
#define __entry REC
|
|
|
|
|
2009-09-12 23:26:21 +00:00
|
|
|
#undef __field
|
|
|
|
#define __field(type, item)
|
|
|
|
|
|
|
|
#undef __field_desc
|
|
|
|
#define __field_desc(type, container, item)
|
|
|
|
|
|
|
|
#undef __array
|
|
|
|
#define __array(type, item, len)
|
|
|
|
|
|
|
|
#undef __array_desc
|
|
|
|
#define __array_desc(type, container, item, len)
|
|
|
|
|
|
|
|
#undef __dynamic_array
|
|
|
|
#define __dynamic_array(type, item)
|
|
|
|
|
2009-12-15 07:39:42 +00:00
|
|
|
#undef F_printk
|
2012-03-22 10:18:20 +00:00
|
|
|
#define F_printk(fmt, args...) __stringify(fmt) ", " __stringify(args)
|
2009-12-15 07:39:42 +00:00
|
|
|
|
2012-02-15 14:51:51 +00:00
|
|
|
#undef FTRACE_ENTRY_REG
|
2012-02-15 14:51:53 +00:00
|
|
|
#define FTRACE_ENTRY_REG(call, struct_name, etype, tstruct, print, filter,\
|
|
|
|
regfn) \
|
2009-03-06 02:35:29 +00:00
|
|
|
\
|
2015-05-05 15:45:27 +00:00
|
|
|
struct trace_event_class __refdata event_class_ftrace_##call = { \
|
2010-04-22 14:35:55 +00:00
|
|
|
.system = __stringify(TRACE_SYSTEM), \
|
|
|
|
.define_fields = ftrace_define_fields_##call, \
|
2010-05-24 08:24:52 +00:00
|
|
|
.fields = LIST_HEAD_INIT(event_class_ftrace_##call.fields),\
|
2012-02-15 14:51:51 +00:00
|
|
|
.reg = regfn, \
|
2010-04-22 14:35:55 +00:00
|
|
|
}; \
|
|
|
|
\
|
2015-05-05 15:45:27 +00:00
|
|
|
struct trace_event_call __used event_##call = { \
|
2010-04-22 14:35:55 +00:00
|
|
|
.class = &event_class_ftrace_##call, \
|
2014-04-09 21:06:08 +00:00
|
|
|
{ \
|
|
|
|
.name = #call, \
|
|
|
|
}, \
|
|
|
|
.event.type = etype, \
|
2009-12-15 07:39:42 +00:00
|
|
|
.print_fmt = print, \
|
2015-03-03 07:21:33 +00:00
|
|
|
.flags = TRACE_EVENT_FL_IGNORE_ENABLE, \
|
2009-03-31 05:48:49 +00:00
|
|
|
}; \
|
2015-05-05 15:45:27 +00:00
|
|
|
struct trace_event_call __used \
|
tracing: Replace trace_event struct array with pointer array
Currently the trace_event structures are placed in the _ftrace_events
section, and at link time, the linker makes one large array of all
the trace_event structures. On boot up, this array is read (much like
the initcall sections) and the events are processed.
The problem is that there is no guarantee that gcc will place complex
structures nicely together in an array format. Two structures in the
same file may be placed awkwardly, because gcc has no clue that they
are suppose to be in an array.
A hack was used previous to force the alignment to 4, to pack the
structures together. But this caused alignment issues with other
architectures (sparc).
Instead of packing the structures into an array, the structures' addresses
are now put into the _ftrace_event section. As pointers are always the
natural alignment, gcc should always pack them tightly together
(otherwise initcall, extable, etc would also fail).
By having the pointers to the structures in the section, we can still
iterate the trace_events without causing unnecessary alignment problems
with other architectures, or depending on the current behaviour of
gcc that will likely change in the future just to tick us kernel developers
off a little more.
The _ftrace_event section is also moved into the .init.data section
as it is now only needed at boot up.
Suggested-by: David Miller <davem@davemloft.net>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2011-01-27 14:15:30 +00:00
|
|
|
__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call;
|
2009-03-31 05:48:49 +00:00
|
|
|
|
2012-02-15 14:51:51 +00:00
|
|
|
#undef FTRACE_ENTRY
|
2012-02-15 14:51:53 +00:00
|
|
|
#define FTRACE_ENTRY(call, struct_name, etype, tstruct, print, filter) \
|
2012-02-15 14:51:51 +00:00
|
|
|
FTRACE_ENTRY_REG(call, struct_name, etype, \
|
2012-02-15 14:51:53 +00:00
|
|
|
PARAMS(tstruct), PARAMS(print), filter, NULL)
|
2012-02-15 14:51:51 +00:00
|
|
|
|
2015-09-29 14:43:36 +00:00
|
|
|
bool ftrace_event_is_function(struct trace_event_call *call)
|
2012-02-15 14:51:52 +00:00
|
|
|
{
|
|
|
|
return call == &event_function;
|
|
|
|
}
|
|
|
|
|
2009-09-12 23:26:21 +00:00
|
|
|
#include "trace_entries.h"
|