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 17:07:57 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2010-08-07 00:35:02 +04:00
|
|
|
#ifndef _PERF_UI_BROWSER_H_
|
|
|
|
#define _PERF_UI_BROWSER_H_ 1
|
|
|
|
|
2014-04-25 23:31:02 +04:00
|
|
|
#include <linux/types.h>
|
2018-03-15 23:52:53 +03:00
|
|
|
#include <stdarg.h>
|
2019-07-04 17:21:24 +03:00
|
|
|
#include <sys/types.h>
|
2010-08-07 00:35:02 +04:00
|
|
|
|
|
|
|
#define HE_COLORSET_TOP 50
|
|
|
|
#define HE_COLORSET_MEDIUM 51
|
|
|
|
#define HE_COLORSET_NORMAL 52
|
|
|
|
#define HE_COLORSET_SELECTED 53
|
2016-01-08 11:16:11 +03:00
|
|
|
#define HE_COLORSET_JUMP_ARROWS 54
|
2012-04-02 19:59:01 +04:00
|
|
|
#define HE_COLORSET_ADDR 55
|
2013-03-28 18:34:10 +04:00
|
|
|
#define HE_COLORSET_ROOT 56
|
2010-08-07 00:35:02 +04:00
|
|
|
|
|
|
|
struct ui_browser {
|
2010-08-07 20:56:04 +04:00
|
|
|
u64 index, top_idx;
|
|
|
|
void *top, *entries;
|
2015-08-11 23:14:40 +03:00
|
|
|
u16 y, x, width, height, rows, columns, horiz_scroll;
|
2018-04-02 21:48:18 +03:00
|
|
|
u8 extra_title_lines;
|
2012-04-02 19:48:56 +04:00
|
|
|
int current_color;
|
2010-08-07 00:35:02 +04:00
|
|
|
void *priv;
|
2011-10-13 15:52:46 +04:00
|
|
|
const char *title;
|
|
|
|
char *helpline;
|
2019-08-19 22:43:58 +03:00
|
|
|
const char *no_samples_msg;
|
2014-07-01 23:34:42 +04:00
|
|
|
void (*refresh_dimensions)(struct ui_browser *browser);
|
2013-11-05 22:32:36 +04:00
|
|
|
unsigned int (*refresh)(struct ui_browser *browser);
|
|
|
|
void (*write)(struct ui_browser *browser, void *entry, int row);
|
|
|
|
void (*seek)(struct ui_browser *browser, off_t offset, int whence);
|
|
|
|
bool (*filter)(struct ui_browser *browser, void *entry);
|
2010-08-07 00:35:02 +04:00
|
|
|
u32 nr_entries;
|
2011-10-18 20:31:35 +04:00
|
|
|
bool navkeypressed;
|
|
|
|
bool use_navkeypressed;
|
2010-08-07 00:35:02 +04:00
|
|
|
};
|
|
|
|
|
2012-04-02 19:48:56 +04:00
|
|
|
int ui_browser__set_color(struct ui_browser *browser, int color);
|
2013-11-05 22:32:36 +04:00
|
|
|
void ui_browser__set_percent_color(struct ui_browser *browser,
|
2010-08-11 21:51:47 +04:00
|
|
|
double percent, bool current);
|
2013-11-05 22:32:36 +04:00
|
|
|
bool ui_browser__is_current_entry(struct ui_browser *browser, unsigned row);
|
|
|
|
void ui_browser__refresh_dimensions(struct ui_browser *browser);
|
|
|
|
void ui_browser__reset_index(struct ui_browser *browser);
|
2010-08-07 00:35:02 +04:00
|
|
|
|
2018-04-02 21:48:18 +03:00
|
|
|
void ui_browser__gotorc_title(struct ui_browser *browser, int y, int x);
|
2013-11-05 22:32:36 +04:00
|
|
|
void ui_browser__gotorc(struct ui_browser *browser, int y, int x);
|
2015-08-11 18:24:27 +03:00
|
|
|
void ui_browser__write_nstring(struct ui_browser *browser, const char *msg,
|
|
|
|
unsigned int width);
|
2018-03-15 23:52:53 +03:00
|
|
|
void ui_browser__vprintf(struct ui_browser *browser, const char *fmt, va_list args);
|
2015-08-11 18:50:55 +03:00
|
|
|
void ui_browser__printf(struct ui_browser *browser, const char *fmt, ...);
|
2012-04-20 23:26:14 +04:00
|
|
|
void ui_browser__write_graph(struct ui_browser *browser, int graph);
|
2012-04-27 23:27:52 +04:00
|
|
|
void __ui_browser__line_arrow(struct ui_browser *browser, unsigned int column,
|
2012-05-03 20:12:49 +04:00
|
|
|
u64 start, u64 end);
|
2017-07-07 08:06:35 +03:00
|
|
|
void ui_browser__mark_fused(struct ui_browser *browser, unsigned int column,
|
perf annotate: Fix fused instr logic for assembly functions
Some x86 microarchitectures fuse a subset of cmp/test/ALU instructions
with branch instructions, and thus perf annotate highlight such valid
pairs as fused.
When annotated with source, perf uses struct disasm_line to contain
either source or instruction line from objdump output. Usually, a C
statement generates multiple instructions which include such
cmp/test/ALU + branch instruction pairs. But in case of assembly
function, each individual assembly source line generate one
instruction.
The 'perf annotate' instruction fusion logic assumes the previous
disasm_line as the previous instruction line, which is wrong because,
for assembly function, previous disasm_line contains source line. And
thus perf fails to highlight valid fused instruction pairs for assembly
functions.
Fix it by searching backward until we find an instruction line and
consider that disasm_line as fused with current branch instruction.
Before:
│ cmpq %rcx, RIP+8(%rsp)
0.00 │ cmp %rcx,0x88(%rsp)
│ je .Lerror_bad_iret <--- Source line
0.14 │ ┌──je b4 <--- Instruction line
│ │movl %ecx, %eax
After:
│ cmpq %rcx, RIP+8(%rsp)
0.00 │ ┌──cmp %rcx,0x88(%rsp)
│ │je .Lerror_bad_iret
0.14 │ ├──je b4
│ │movl %ecx, %eax
Reviewed-by: Jin Yao <yao.jin@linux.intel.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kim Phillips <kim.phillips@amd.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https //lore.kernel.org/r/20210911043854.8373-1-ravi.bangoria@amd.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-09-11 07:38:53 +03:00
|
|
|
unsigned int row, int diff, bool arrow_down);
|
2011-02-25 17:33:31 +03:00
|
|
|
void __ui_browser__show_title(struct ui_browser *browser, const char *title);
|
|
|
|
void ui_browser__show_title(struct ui_browser *browser, const char *title);
|
2013-11-05 22:32:36 +04:00
|
|
|
int ui_browser__show(struct ui_browser *browser, const char *title,
|
2010-08-10 22:44:20 +04:00
|
|
|
const char *helpline, ...);
|
2013-11-05 22:32:36 +04:00
|
|
|
void ui_browser__hide(struct ui_browser *browser);
|
|
|
|
int ui_browser__refresh(struct ui_browser *browser);
|
2011-10-13 15:52:46 +04:00
|
|
|
int ui_browser__run(struct ui_browser *browser, int delay_secs);
|
2011-10-11 23:15:39 +04:00
|
|
|
void ui_browser__update_nr_entries(struct ui_browser *browser, u32 nr_entries);
|
2011-10-26 18:04:37 +04:00
|
|
|
void ui_browser__handle_resize(struct ui_browser *browser);
|
2012-05-03 20:07:05 +04:00
|
|
|
void __ui_browser__vline(struct ui_browser *browser, unsigned int column,
|
|
|
|
u16 start, u16 end);
|
2011-10-26 18:04:37 +04:00
|
|
|
|
2011-10-29 18:15:04 +04:00
|
|
|
int ui_browser__warning(struct ui_browser *browser, int timeout,
|
|
|
|
const char *format, ...);
|
2011-10-26 18:04:37 +04:00
|
|
|
int ui_browser__help_window(struct ui_browser *browser, const char *text);
|
|
|
|
bool ui_browser__dialog_yesno(struct ui_browser *browser, const char *text);
|
2012-03-16 12:50:52 +04:00
|
|
|
int ui_browser__input_window(const char *title, const char *text, char *input,
|
|
|
|
const char *exit_msg, int delay_sec);
|
2015-08-28 12:48:04 +03:00
|
|
|
struct perf_env;
|
|
|
|
int tui__header_window(struct perf_env *env);
|
2010-08-07 00:35:02 +04:00
|
|
|
|
2011-10-26 13:11:03 +04:00
|
|
|
void ui_browser__argv_seek(struct ui_browser *browser, off_t offset, int whence);
|
|
|
|
unsigned int ui_browser__argv_refresh(struct ui_browser *browser);
|
|
|
|
|
2013-11-05 22:32:36 +04:00
|
|
|
void ui_browser__rb_tree_seek(struct ui_browser *browser, off_t offset, int whence);
|
|
|
|
unsigned int ui_browser__rb_tree_refresh(struct ui_browser *browser);
|
2010-08-07 00:35:02 +04:00
|
|
|
|
2013-11-05 22:32:36 +04:00
|
|
|
void ui_browser__list_head_seek(struct ui_browser *browser, off_t offset, int whence);
|
|
|
|
unsigned int ui_browser__list_head_refresh(struct ui_browser *browser);
|
2010-08-07 00:35:02 +04:00
|
|
|
|
|
|
|
void ui_browser__init(void);
|
|
|
|
#endif /* _PERF_UI_BROWSER_H_ */
|