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 15:07:57 +01:00
|
|
|
|
2009-11-30 19:19:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-16 11:57:54 -03:00
|
|
|
|
2009-12-15 10:31:14 -05:00
|
|
|
|
2019-01-22 11:24:34 -02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-30 19:19:58 -05:00
|
|
|
|
2015-05-08 10:03:31 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
perf probe: Add --range option to show a variable's location range
It is not easy for users to get the accurate byte offset or the line
number where a local variable can be probed.
With '--range' option, local variables in the scope of the probe point
are showed with a byte offset range, and can be added according to this
range information.
For example, there are some variables in the function
generic_perform_write():
<generic_perform_write@mm/filemap.c:0>
0 ssize_t generic_perform_write(struct file *file,
1 struct iov_iter *i, loff_t pos)
2 {
3 struct address_space *mapping = file->f_mapping;
4 const struct address_space_operations *a_ops = mapping->a_ops;
...
42 status = a_ops->write_begin(file, mapping, pos, bytes, flags,
&page, &fsdata);
44 if (unlikely(status < 0))
But we fail when we try to probe the variable 'a_ops' at line 42 or 44.
$ perf probe --add 'generic_perform_write:42 a_ops'
Failed to find the location of a_ops at this address.
Perhaps, it has been optimized out.
This is because the source code do not match the assembly, so a variable
may not be available in the source code line where it appears.
After this patch, we can lookup the accurate byte offset range of a
variable, 'INV' indicates that this variable is not valid at the given
point, but available in the scope:
$ perf probe --vars 'generic_perform_write:42' --range
Available variables at generic_perform_write:42
@<generic_perform_write+141>
[INV] ssize_t written @<generic_perform_write+[324-331]>
[INV] struct address_space_operations* a_ops @<generic_perform_write+[55-61,170-176,223-246]>
[VAL] (unknown_type) fsdata @<generic_perform_write+[70-307,346-411]>
[VAL] loff_t pos @<generic_perform_write+[0-286,286-336,346-411]>
[VAL] long int status @<generic_perform_write+[83-342,346-411]>
[VAL] long unsigned int bytes @<generic_perform_write+[122-311,320-338,346-403,403-411]>
[VAL] struct address_space* mapping @<generic_perform_write+[35-344,346-411]>
[VAL] struct iov_iter* i @<generic_perform_write+[0-340,346-411]>
[VAL] struct page* page @<generic_perform_write+[70-307,346-411]>
Then it is more clear for us to add a probe with this variable:
$ perf probe --add 'generic_perform_write+170 a_ops'
Added new event:
probe:generic_perform_write (on generic_perform_write+170 with a_ops)
Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1431336304-16863-2-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-05-11 09:25:03 +00:00
|
|
|
|
2015-05-08 10:03:31 +09:00
|
|
|
|
2015-05-08 10:03:33 +09:00
|
|
|
|
2016-06-15 12:28:40 +09:00
|
|
|
|
2021-06-05 01:28:43 +09:00
|
|
|
|
2015-05-08 10:03:31 +09:00
|
|
|
|
2019-11-18 17:12:49 +09:00
|
|
|
|
2015-05-08 10:03:31 +09:00
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:05 -04:00
|
|
|
|
|
|
|
|
|
2019-11-18 17:12:49 +09:00
|
|
|
|
|
|
|
|
|
2016-11-15 04:05:46 +00:00
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2010-07-29 19:43:51 +05:30
|
|
|
|
2015-05-08 10:03:35 +09:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2011-06-27 16:27:45 +09:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2018-08-20 10:12:50 +05:30
|
|
|
|
2021-07-15 14:37:23 +08:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-29 19:43:51 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2019-05-15 14:39:05 +09:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2010-07-29 19:43:51 +05:30
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2010-04-12 13:17:15 -04:00
|
|
|
|
2010-07-29 19:43:51 +05:30
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2010-07-29 19:43:51 +05:30
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2010-07-29 19:43:51 +05:30
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2024-11-13 09:21:21 +09:00
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2010-07-29 19:43:51 +05:30
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
perf tools: Reorganize some structs to save space
Using 'pahole --packable' I found some structs that could be reorganized
to eliminate alignment holes, in some cases getting them to be cacheline
multiples.
[acme@doppio linux-2.6-tip]$ codiff perf.old ~/bin/perf
builtin-annotate.c:
struct perf_session | -8
struct perf_header | -8
2 structs changed
builtin-diff.c:
struct sample_data | -8
1 struct changed
diff__process_sample_event | -8
1 function changed, 8 bytes removed, diff: -8
builtin-sched.c:
struct sched_atom | -8
1 struct changed
builtin-timechart.c:
struct per_pid | -8
1 struct changed
cmd_timechart | -16
1 function changed, 16 bytes removed, diff: -16
builtin-probe.c:
struct perf_probe_point | -8
struct perf_probe_event | -8
2 structs changed
opt_add_probe_event | -3
1 function changed, 3 bytes removed, diff: -3
util/probe-finder.c:
struct probe_finder | -8
1 struct changed
find_kprobe_trace_events | -16
1 function changed, 16 bytes removed, diff: -16
/home/acme/bin/perf:
4 functions changed, 43 bytes removed, diff: -43
[acme@doppio linux-2.6-tip]$
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-04-05 12:53:45 -03:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2021-07-15 14:37:23 +08:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 15:57:42 -04:00
|
|
|
|
2010-03-16 18:06:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:26 -04:00
|
|
|
|
2010-04-12 13:16:53 -04:00
|
|
|
|
2010-04-12 13:17:22 -04:00
|
|
|
|
2010-03-16 18:06:26 -04:00
|
|
|
|
2019-05-15 14:39:05 +09:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-12 19:04:43 +09:00
|
|
|
|
2015-04-01 19:25:39 +09:00
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2015-09-04 21:16:00 +09:00
|
|
|
|
|
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-14 18:39:42 -04:00
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2010-07-09 18:29:11 +09:00
|
|
|
|
2014-02-06 05:32:09 +00:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2017-04-18 10:57:25 -03:00
|
|
|
|
|
|
|
|
|
2010-10-21 19:13:23 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-19 08:42:48 +00:00
|
|
|
|
2015-09-10 11:27:05 +09:00
|
|
|
|
|
|
|
|
|
2015-06-19 08:42:48 +00:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
|
|
|
|
|
2016-04-28 03:37:14 +09:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2016-06-08 18:29:40 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-03 14:28:44 +05:30
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
|
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
|
|
|
|
|
2016-08-26 01:24:27 +09:00
|
|
|
|
2021-06-05 01:28:43 +09:00
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
2017-04-18 10:57:25 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
|
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
|
|
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
|
|
|
|
|
2015-04-28 17:35:40 +05:30
|
|
|
|
2016-04-12 14:40:50 +05:30
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2015-07-15 18:14:07 +09:00
|
|
|
|
2017-06-16 11:57:54 -03:00
|
|
|
|
2015-07-15 18:14:07 +09:00
|
|
|
|
2009-11-30 19:20:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-26 10:57:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
perf probe ppc64le: Fix probe location when using DWARF
Powerpc has Global Entry Point and Local Entry Point for functions. LEP
catches call from both the GEP and the LEP. Symbol table of ELF contains
GEP and Offset from which we can calculate LEP, but debuginfo does not
have LEP info.
Currently, perf prioritize symbol table over dwarf to probe on LEP for
ppc64le. But when user tries to probe with function parameter, we fall
back to using dwarf(i.e. GEP) and when function called via LEP, probe
will never hit.
For example:
$ objdump -d vmlinux
...
do_sys_open():
c0000000002eb4a0: e8 00 4c 3c addis r2,r12,232
c0000000002eb4a4: 60 00 42 38 addi r2,r2,96
c0000000002eb4a8: a6 02 08 7c mflr r0
c0000000002eb4ac: d0 ff 41 fb std r26,-48(r1)
$ sudo ./perf probe do_sys_open
$ sudo cat /sys/kernel/debug/tracing/kprobe_events
p:probe/do_sys_open _text+3060904
$ sudo ./perf probe 'do_sys_open filename:string'
$ sudo cat /sys/kernel/debug/tracing/kprobe_events
p:probe/do_sys_open _text+3060896 filename_string=+0(%gpr4):string
For second case, perf probed on GEP. So when function will be called via
LEP, probe won't hit.
$ sudo ./perf record -a -e probe:do_sys_open ls
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.195 MB perf.data ]
To resolve this issue, let's not prioritize symbol table, let perf
decide what it wants to use. Perf is already converting GEP to LEP when
it uses symbol table. When perf uses debuginfo, let it find LEP offset
form symbol table. This way we fall back to probe on LEP for all cases.
After patch:
$ sudo ./perf probe 'do_sys_open filename:string'
$ sudo cat /sys/kernel/debug/tracing/kprobe_events
p:probe/do_sys_open _text+3060904 filename_string=+0(%gpr4):string
$ sudo ./perf record -a -e probe:do_sys_open ls
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.197 MB perf.data (11 samples) ]
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1470723805-5081-2-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-08-09 01:23:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-30 19:19:58 -05:00
|
|
|
|