02 Nov, 2017
1 commit
-
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
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
14 May, 2015
2 commits
-
The name "ftrace" really refers to the function hook infrastructure. It
is not about the trace_events. The structures ftrace_event_call and
ftrace_event_class have nothing to do with the function hooks, and are
really trace_event structures. Rename ftrace_event_* to trace_event_*.Signed-off-by: Steven Rostedt
-
The term "ftrace" is really the infrastructure of the function hooks,
and not the trace events. Rename ftrace_event.h to trace_events.h to
represent the trace_event infrastructure and decouple the term ftrace
from it.Signed-off-by: Steven Rostedt
21 Jun, 2014
1 commit
-
syscall_regfunc() and syscall_unregfunc() should set/clear
TIF_SYSCALL_TRACEPOINT system-wide, but do_each_thread() can race
with copy_process() and miss the new child which was not added to
the process/thread lists yet.Change copy_process() to update the child's TIF_SYSCALL_TRACEPOINT
under tasklist.Link: http://lkml.kernel.org/p/20140413185854.GB20668@redhat.com
Cc: stable@vger.kernel.org # 2.6.33
Fixes: a871bd33a6c0 "tracing: Add syscall tracepoints"
Acked-by: Frederic Weisbecker
Acked-by: Paul E. McKenney
Signed-off-by: Oleg Nesterov
Signed-off-by: Steven Rostedt
02 Jul, 2013
1 commit
-
Add the missing syscall_metadata description for the enter_fields
struct member.Link: http://lkml.kernel.org/r/74c3407cd1e5d37f2c5aaca637aa4d35f66f1aa2.1372479499.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi
Signed-off-by: Steven Rostedt
01 Nov, 2012
2 commits
-
The functions defined in include/trace/syscalls.h are not used directly
since struct ftrace_event_class was introduced. Remove them from the
header file and rearrange the ftrace_event_class declarations in
trace_syscalls.c.Link: http://lkml.kernel.org/r/1339112785-21806-2-git-send-email-vnagarnaik@google.com
Signed-off-by: Vaibhav Nagarnaik
Signed-off-by: Steven Rostedt -
Remove ftrace_format_syscall() declaration; it is neither defined nor
used. Also update a comment and formatting.Link: http://lkml.kernel.org/r/1339112785-21806-1-git-send-email-vnagarnaik@google.com
Signed-off-by: David Sharp
Signed-off-by: Vaibhav Nagarnaik
Signed-off-by: Steven Rostedt
29 Jun, 2010
1 commit
-
All syscall exit events have the same fields.
The kernel size drops 2.5K:
text data bss dec hex filename
7018612 2034376 7251132 16304120 f8c7f8 vmlinux.o.orig
7018612 2031888 7251132 16301632 f8be40 vmlinux.oSigned-off-by: Li Zefan
LKML-Reference:
Signed-off-by: Steven Rostedt
15 May, 2010
2 commits
-
Multiple events may use the same method to print their data.
Instead of having all events have a pointer to their print funtions,
the trace_event structure now points to a trace_event_functions structure
that will hold the way to print ouf the event.The event itself is now passed to the print function to let the print
function know what kind of event it should print.This opens the door to consolidating the way several events print
their output.text data bss dec hex filename
4913961 1088356 861512 6863829 68bbd5 vmlinux.orig
4900382 1048964 861512 6810858 67ecea vmlinux.init
4900446 1049028 861512 6810986 67ed6a vmlinux.preprintThis change slightly increases the size but is needed for the next change.
v3: Fix the branch tracer events to handle this change.
v2: Fix the new function graph tracer event calls to handle this change.
Acked-by: Mathieu Desnoyers
Acked-by: Masami Hiramatsu
Acked-by: Frederic Weisbecker
Signed-off-by: Steven Rostedt -
Move the defined fields from the event to the class structure.
Since the fields of the event are defined by the class they belong
to, it makes sense to have the class hold the information instead
of the individual events. The events of the same class would just
hold duplicate information.After this change the size of the kernel dropped another 3K:
text data bss dec hex filename
4913961 1088356 861512 6863829 68bbd5 vmlinux.orig
4900252 1057412 861512 6819176 680d68 vmlinux.regs
4900375 1053380 861512 6815267 67fe23 vmlinux.fieldsAlthough the text increased, this was mainly due to the C files
having to adapt to the change. This is a constant increase, where
new tracepoints will not increase the Text. But the big drop is
in the data size (as well as needed allocations to hold the fields).
This will give even more savings as more tracepoints are created.Note, if just TRACE_EVENT()s are used and not DECLARE_EVENT_CLASS()
with several DEFINE_EVENT()s, then the savings will be lost. But
we are pushing developers to consolidate events with DEFINE_EVENT()
so this should not be an issue.The kprobes define a unique class to every new event, but are dynamic
so it should not be a issue.The syscalls however have a single class but the fields for the individual
events are different. The syscalls use a metadata to define the
fields. I moved the fields list from the event to the metadata and
added a "get_fields()" function to the class. This function is used
to find the fields. For normal events and kprobes, get_fields() just
returns a pointer to the fields list_head in the class. For syscall
events, it returns the fields list_head in the metadata for the event.v2: Fixed the syscall fields. The syscall metadata needs a list
of fields for both enter and exit.Acked-by: Frederic Weisbecker
Acked-by: Mathieu Desnoyers
Acked-by: Masami Hiramatsu
Cc: Tom Zanussi
Cc: Peter Zijlstra
Signed-off-by: Steven Rostedt
10 Mar, 2010
1 commit
-
Drop the obsolete "profile" naming used by perf for trace events.
Perf can now do more than simple events counting, so generalize
the API naming.Signed-off-by: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Steven Rostedt
Cc: Masami Hiramatsu
Cc: Jason Baron
01 Mar, 2010
1 commit
-
…git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (172 commits)
perf_event, amd: Fix spinlock initialization
perf_event: Fix preempt warning in perf_clock()
perf tools: Flush maps on COMM events
perf_events, x86: Split PMU definitions into separate files
perf annotate: Handle samples not at objdump output addr boundaries
perf_events, x86: Remove superflous MSR writes
perf_events: Simplify code by removing cpu argument to hw_perf_group_sched_in()
perf_events, x86: AMD event scheduling
perf_events: Add new start/stop PMU callbacks
perf_events: Report the MMAP pgoff value in bytes
perf annotate: Defer allocating sym_priv->hist array
perf symbols: Improve debugging information about symtab origins
perf top: Use a macro instead of a constant variable
perf symbols: Check the right return variable
perf/scripts: Tag syscall_name helper as not yet available
perf/scripts: Add perf-trace-python Documentation
perf/scripts: Remove unnecessary PyTuple resizes
perf/scripts: Add syscall tracing scripts
perf/scripts: Add Python scripting engine
perf/scripts: Remove check-perf-trace from listed scripts
...Fix trivial conflict in tools/perf/util/probe-event.c
07 Jan, 2010
1 commit
-
The previous patches added the use of print_fmt string and changes
the trace_define_field() function to also create the fields and
format output for the event format files.text data bss dec hex filename
5857201 1355780 9336808 16549789 fc879d vmlinux
5884589 1351684 9337896 16574169 fce6d9 vmlinux-origThe above shows the size of the vmlinux after this patch set
compared to the vmlinux-orig which is before the patch set.This saves us 27k on text, 1k on bss and adds just 4k of data.
The total savings of 24k in size.
Signed-off-by: Lai Jiangshan
LKML-Reference:
Acked-by: Masami Hiramatsu
Signed-off-by: Steven Rostedt
28 Dec, 2009
1 commit
-
Quoted from Ingo:
| This reminds me - i think we should eliminate CONFIG_EVENT_PROFILE -
| it's an unnecessary Kconfig complication. If both PERF_EVENTS and
| EVENT_TRACING is enabled we should expose generic tracepoints.
|
| Nor is it limited to event 'profiling', so it has become a misnomer as
| well.Signed-off-by: Li Zefan
Cc: Frederic Weisbecker
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar
02 Dec, 2009
6 commits
-
use only one prof_sysenter_enable() instead of
prof_sysenter_enable_##sname()use only one prof_sysenter_disable() instead of
prof_sysenter_disable_##sname()use only one prof_sysexit_enable() instead of
prof_sysexit_enable_##sname()use only one prof_sysexit_disable() instead of
prof_sysexit_disable_##sname()Signed-off-by: Lai Jiangshan
Acked-by: Jason Baron
Cc: Steven Rostedt
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
use only one init_syscall_trace instead of
many init_enter_##sname()/init_exit_##sname()Signed-off-by: Lai Jiangshan
Acked-by: Jason Baron
Cc: Steven Rostedt
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Add syscall_nr field to struct syscall_metadata,
it helps us to get syscall number easier.Signed-off-by: Lai Jiangshan
Acked-by: Jason Baron
Cc: Steven Rostedt
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
use ->enter_event->id instead of ->enter_id
use ->exit_event->id instead of ->exit_idSigned-off-by: Lai Jiangshan
Acked-by: Jason Baron
Cc: Steven Rostedt
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Set event_enter_##sname->data to its metadata,
it makes codes simpler.Signed-off-by: Lai Jiangshan
Acked-by: Jason Baron
Cc: Steven Rostedt
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
fix event_enter_##sname->event
fix event_exit_##sname->eventremove unused event_syscall_enter and event_syscall_exit
Signed-off-by: Lai Jiangshan
Acked-by: Jason Baron
Cc: Steven Rostedt
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar
23 Oct, 2009
1 commit
-
Conflicts:
tools/perf/MakefileMerge reason:
- fix the conflict
- pick up the pr_*() infrastructure to queue up dependent patchSigned-off-by: Ingo Molnar
14 Oct, 2009
1 commit
-
Most of the syscalls metadata processing is done from arch.
But these operations are mostly generic accross archs. Especially now
that we have a common variable name that expresses the number of
syscalls supported by an arch: NR_syscalls, the only remaining bits
that need to reside in arch is the syscall nr to addr translation.v2: Compare syscalls symbols only after the "sys" prefix so that we
avoid spurious mismatches with archs that have syscalls wrappers,
in which case syscalls symbols have "SyS" prefixed aliases.
(Reported by: Heiko Carstens)Signed-off-by: Frederic Weisbecker
Acked-by: Heiko Carstens
Cc: Ingo Molnar
Cc: Steven Rostedt
Cc: Li Zefan
Cc: Masami Hiramatsu
Cc: Jason Baron
Cc: Lai Jiangshan
Cc: Martin Schwidefsky
Cc: Paul Mundt
27 Aug, 2009
1 commit
-
Add dynamic ftrace_event_call support to ftrace. Trace engines can add
new ftrace_event_call to ftrace on the fly. Each operator function of
the call takes an ftrace_event_call data structure as an argument,
because these functions may be shared among several ftrace_event_calls.Changes from v13:
- Define remove_subsystem_dir() always (revirt a2ca5e03), because
trace_remove_event_call() uses it.
- Modify syscall tracer because of ftrace_event_call change.[fweisbec@gmail.com: Fixed conflict against latest tracing/core]
Signed-off-by: Masami Hiramatsu
Cc: Ananth N Mavinakayanahalli
Cc: Avi Kivity
Cc: Andi Kleen
Cc: Christoph Hellwig
Cc: Frank Ch. Eigler
Cc: H. Peter Anvin
Cc: Ingo Molnar
Cc: Jason Baron
Cc: Jim Keniston
Cc: K.Prasad
Cc: Lai Jiangshan
Cc: Li Zefan
Cc: Przemysław Pawełczyk
Cc: Roland McGrath
Cc: Sam Ravnborg
Cc: Srikar Dronamraju
Cc: Steven Rostedt
Cc: Tom Zanussi
Cc: Vegard Nossum
LKML-Reference:
Signed-off-by: Frederic Weisbecker
26 Aug, 2009
3 commits
-
This converts the syscall_enter/exit tracepoints into TRACE_EVENTs, so
you can have generic ftrace events that capture all system calls with
arguments and return values. These generic events are also renamed to
sys_enter/exit, so they're more closely aligned to the specific
sys_enter_foo events.Signed-off-by: Josh Stone
Cc: Jason Baron
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Li Zefan
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Mathieu Desnoyers
Cc: Jiaying Zhang
Cc: Martin Bligh
Cc: Lai Jiangshan
Cc: Paul Mundt
Cc: Martin Schwidefsky
Cc: Heiko Carstens
LKML-Reference:
Signed-off-by: Frederic Weisbecker -
It's not strictly correct for the tracepoint reg/unreg callbacks to
occur when a client is hooking up, because the actual tracepoint may not
be present yet. This happens to be fine for syscall, since that's in
the core kernel, but it would cause problems for tracepoints defined in
a module that hasn't been loaded yet. It also means the reg/unreg has
to be EXPORTed for any modules to use the tracepoint (as in SystemTap).This patch removes DECLARE_TRACE_WITH_CALLBACK, and instead introduces
DEFINE_TRACE_FN which stores the callbacks in struct tracepoint. The
callbacks are used now when the active state of the tracepoint changes
in set_tracepoint & disable_tracepoint.This also introduces TRACE_EVENT_FN, so ftrace events can also provide
registration callbacks if needed.Signed-off-by: Josh Stone
Cc: Jason Baron
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Li Zefan
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Mathieu Desnoyers
Cc: Jiaying Zhang
Cc: Martin Bligh
Cc: Lai Jiangshan
Cc: Paul Mundt
Cc: Martin Schwidefsky
Cc: Heiko Carstens
LKML-Reference:
Signed-off-by: Frederic Weisbecker -
The syscall enter/exit tracepoints are only supported on archs that
HAVE_SYSCALL_TRACEPOINTS, so the declarations should be #ifdef'ed.
Also, the definition of syscall_regfunc and syscall_unregfunc should
depend on this same config, rather than the ftrace-specific one.Signed-off-by: Josh Stone
Cc: Jason Baron
Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Li Zefan
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Mathieu Desnoyers
Cc: Jiaying Zhang
Cc: Martin Bligh
Cc: Lai Jiangshan
LKML-Reference:
Signed-off-by: Frederic Weisbecker
19 Aug, 2009
2 commits
-
Add filtering support for syscall events:
# echo 'mode == 0666' > events/syscalls/sys_enter_open
# echo 'ret == 0' > events/syscalls/sys_exit_open
# echo 1 > events/syscalls/sys_enter_open
# echo 1 > events/syscalls/sys_exit_open
# cat trace
...
modprobe-3084 [001] 117.463140: sys_open(filename: 917d3e8, flags: 0, mode: 1b6)
modprobe-3084 [001] 117.463176: sys_open -> 0x0
less-3086 [001] 117.510455: sys_open(filename: 9c6bdb8, flags: 8000, mode: 1b6)
sendmail-2574 [001] 122.145840: sys_open(filename: b807a365, flags: 0, mode: 1b6)
...Signed-off-by: Li Zefan
Cc: Jason Baron
Cc: Steven Rostedt
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar -
Add "format" file for syscall exit events:
# cat events/syscalls/sys_exit_open/format
name: sys_exit_open
ID: 344
format:
field:unsigned short common_type; offset:0; size:2;
field:unsigned char common_flags; offset:2; size:1;
field:unsigned char common_preempt_count; offset:3; size:1;
field:int common_pid; offset:4; size:4;
field:int common_tgid; offset:8; size:4;field:int nr; offset:12; size:4;
field:unsigned long ret; offset:16; size:4;Signed-off-by: Li Zefan
Cc: Jason Baron
Cc: Steven Rostedt
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar
12 Aug, 2009
6 commits
-
Define the format of the syscall trace fields to parse the binary
values from a raw trace using the syscall events "format" file.This is defined dynamically using the syscalls metadata.
It prepares the export of syscall event raw records to perf
counters.Example:
$ cat /debug/tracing/events/syscalls/sys_enter_sched_getparam/format
name: sys_enter_sched_getparam
ID: 39
format:
field:unsigned short common_type; offset:0; size:2;
field:unsigned char common_flags; offset:2; size:1;
field:unsigned char common_preempt_count; offset:3; size:1;
field:int common_pid; offset:4; size:4;
field:int common_tgid; offset:8; size:4;field:pid_t pid; offset:12; size:8;
field:struct sched_param * param; offset:20; size:8;print fmt: "pid: 0x%08lx, param: 0x%08lx", ((unsigned long)(REC->pid)), ((unsigned long)(REC->param))
Signed-off-by: Frederic Weisbecker
Cc: Lai Jiangshan
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Mathieu Desnoyers
Cc: Jiaying Zhang
Cc: Martin Bligh
Cc: Li Zefan
Cc: Masami Hiramatsu
Cc: Jason Baron -
The perf counter support is automated for usual trace events. But we
have to define specific callbacks for this to handle syscalls trace
eventsMake 'perf stat -e syscalls:sys_enter_blah' work with syscall style
tracepoints.Signed-off-by: Jason Baron
Cc: Lai Jiangshan
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Mathieu Desnoyers
Cc: Jiaying Zhang
Cc: Martin Bligh
Cc: Li Zefan
Cc: Masami Hiramatsu
Signed-off-by: Frederic Weisbecker -
The current state of syscalls tracepoints generates only one event id
for every syscall events.This patch associates an id with each syscall trace event, so that we
can identify each syscall trace event using the 'perf' tool.Signed-off-by: Jason Baron
Cc: Lai Jiangshan
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Mathieu Desnoyers
Cc: Jiaying Zhang
Cc: Martin Bligh
Cc: Li Zefan
Cc: Masami Hiramatsu
Signed-off-by: Frederic Weisbecker -
Layer Frederic's syscall tracer on tracepoints. We create trace events
via hooking into the SYSCALL_DEFINE macros. This allows us to
individually toggle syscall entry and exit points on/off.Signed-off-by: Jason Baron
Cc: Lai Jiangshan
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Mathieu Desnoyers
Cc: Jiaying Zhang
Cc: Martin Bligh
Cc: Li Zefan
Cc: Masami Hiramatsu
Signed-off-by: Frederic Weisbecker -
add two tracepoints in syscall exit and entry path, conditioned on
TIF_SYSCALL_FTRACE. Supports the syscall trace event code.Signed-off-by: Jason Baron
Cc: Lai Jiangshan
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Mathieu Desnoyers
Cc: Jiaying Zhang
Cc: Martin Bligh
Cc: Li Zefan
Cc: Masami Hiramatsu
Signed-off-by: Frederic Weisbecker -
Call arch_init_ftrace_syscalls at boot, so we can determine early the
set of syscalls for the syscall trace events.Signed-off-by: Jason Baron
Cc: Lai Jiangshan
Cc: Steven Rostedt
Cc: Peter Zijlstra
Cc: Mathieu Desnoyers
Cc: Jiaying Zhang
Cc: Martin Bligh
Cc: Li Zefan
Cc: Masami Hiramatsu
Signed-off-by: Frederic Weisbecker
09 Apr, 2009
1 commit
-
Impact: fix build warnings and possibe compat misbehavior on IA64
Building a kernel on ia64 might trigger these ugly build warnings:
CC arch/ia64/ia32/sys_ia32.o
In file included from arch/ia64/ia32/sys_ia32.c:55:
arch/ia64/ia32/ia32priv.h:290:1: warning: "elf_check_arch" redefined
In file included from include/linux/elf.h:7,
from include/linux/module.h:14,
from include/linux/ftrace.h:8,
from include/linux/syscalls.h:68,
from arch/ia64/ia32/sys_ia32.c:18:
arch/ia64/include/asm/elf.h:19:1: warning: this is the location of the previous definition
[...]sys_ia32.c includes linux/syscalls.h which in turn includes linux/ftrace.h
to import the syscalls tracing prototypes.But including ftrace.h can pull too much things for a low level file,
especially on ia64 where the ia32 private headers conflict with higher
level headers.Now we isolate the syscall tracing headers in their own lightweight file.
Reported-by: Tony Luck
Tested-by: Tony Luck
Signed-off-by: Frederic Weisbecker
Acked-by: Tony Luck
Signed-off-by: Steven Rostedt
Cc: Peter Zijlstra
Cc: Jason Baron
Cc: "Frank Ch. Eigler"
Cc: Mathieu Desnoyers
Cc: KOSAKI Motohiro
Cc: Lai Jiangshan
Cc: Jiaying Zhang
Cc: Michael Rubin
Cc: Martin Bligh
Cc: Michael Davidson
LKML-Reference:
Signed-off-by: Ingo Molnar