1. 14 8月, 2018 9 次提交
  2. 11 8月, 2018 1 次提交
  3. 17 1月, 2018 10 次提交
  4. 18 11月, 2017 1 次提交
  5. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      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: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  6. 10 3月, 2017 1 次提交
  7. 17 2月, 2017 1 次提交
  8. 14 2月, 2017 2 次提交
    • A
      tools lib traceevent plugin function: Initialize 'index' variable · e8c6f437
      Arnaldo Carvalho de Melo 提交于
      Detected with clang:
      
          CC       /tmp/build/perf/plugin_function.o
        plugin_function.c:145:6: warning: variable 'index' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                if (parent && ftrace_indent->set)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
        plugin_function.c:148:29: note: uninitialized use occurs here
                trace_seq_printf(s, "%*s", index*3, "");
                                           ^~~~~
        plugin_function.c:145:2: note: remove the 'if' if its condition is always true
                if (parent && ftrace_indent->set)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        plugin_function.c:145:6: warning: variable 'index' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
                if (parent && ftrace_indent->set)
                    ^~~~~~
        plugin_function.c:148:29: note: uninitialized use occurs here
                trace_seq_printf(s, "%*s", index*3, "");
                                           ^~~~~
        plugin_function.c:145:6: note: remove the '&&' if its condition is always true
                if (parent && ftrace_indent->set)
                    ^~~~~~~~~
        plugin_function.c:133:11: note: initialize the variable 'index' to silence this warning
                int index;
                         ^
                          = 0
        2 warnings generated.
      Reviewed-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-b5wyjocel55gorl2jq2cbxrr@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e8c6f437
    • S
      tools lib traceevent: Initialize lenght on OLD_RING_BUFFER_TYPE_TIME_STAMP · 14e4d7e0
      Steven Rostedt (VMware) 提交于
      A undefined value was being used for the OLD_RING_BUFFER_TYPE_TIME_STAMP
      case entry, as the 'length' variable was not being initialized, fix it.
      
      Caught by the reporter when building tools/perf/ using clang, which emmitted
      this warning:
      
        kbuffer-parse.c:312:7: warning: variable 'length' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
                case OLD_RINGBUF_TYPE_TIME_EXTEND:
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
        kbuffer-parse.c:339:29: note: uninitialized use occurs here
                kbuf->next = kbuf->index + length;
                                         ^~~~~~
        kbuffer-parse.c:297:21: note: initialize the variable 'length' to silence this warning
                unsigned int length;
                                   ^
                                    = 0
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170213121418.47f279e8@gandalf.local.homeSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      14e4d7e0
  9. 08 2月, 2017 1 次提交
    • D
      tools lib traceevent: Robustify do_generate_dynamic_list_file · 6467753d
      David Carrillo-Cisneros 提交于
      The dynamic-list-file used to export dynamic symbols introduced in
      
      commit e3d09ec8 ("tools lib traceevent: Export dynamic symbols
      used by traceevent plugins")
      
      is generated without any sort of error checking.
      
      I experienced problems due to an old version of nm (v 0.158) that outputs
      in a format distinct from the assumed by the script.
      
      Robustify the built of dynamic symbol list  by enforcing that the second
      column of $(NM) -u <files> is either "U" (Undefined), "W" or "w" (undefined
      weak), which are the possible outputs from non-ancient $(NM) versions.
      Print an error if format is unexpected.
      
      v2: Accept "W" and "w" symbol options.
      Signed-off-by: NDavid Carrillo-Cisneros <davidcc@google.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michal Marek <mmarek@suse.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170208052840.112182-1-davidcc@google.com
      [ Use STRING1 = STRING1 instead of == to make this work on Ubuntu systems ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6467753d
  10. 26 1月, 2017 1 次提交
  11. 04 1月, 2017 1 次提交
    • D
      tools lib traceevent: Fix prev/next_prio for deadline tasks · 07485918
      Daniel Bristot de Oliveira 提交于
      Currently, the sched:sched_switch tracepoint reports deadline tasks with
      priority -1. But when reading the trace via perf script I've got the
      following output:
      
        # ./d & # (d is a deadline task, see [1])
        # perf record -e sched:sched_switch -a sleep 1
        # perf script
            ...
               swapper     0 [000]  2146.962441: sched:sched_switch: swapper/0:0 [120] R ==> d:2593 [4294967295]
                     d  2593 [000]  2146.972472: sched:sched_switch: d:2593 [4294967295] R ==> g:2590 [4294967295]
      
      The task d reports the wrong priority [4294967295]. This happens because
      the "int prio" is stored in an unsigned long long val. Although it is
      set as a %lld, as int is shorter than unsigned long long,
      trace_seq_printf prints it as a positive number.
      
      The fix is just to cast the val as an int, and print it as a %d,
      as in the sched:sched_switch tracepoint's "format".
      
      The output with the fix is:
      
        # ./d &
        # perf record -e sched:sched_switch -a sleep 1
        # perf script
            ...
               swapper     0 [000]  4306.374037: sched:sched_switch: swapper/0:0 [120] R ==> d:10941 [-1]
                     d 10941 [000]  4306.383823: sched:sched_switch: d:10941 [-1] R ==> swapper/0:0 [120]
      
      [1] d.c
      
       ---
        #include <stdio.h>
        #include <unistd.h>
        #include <sys/syscall.h>
        #include <linux/types.h>
        #include <linux/sched.h>
      
        struct sched_attr {
      	__u32 size, sched_policy;
      	__u64 sched_flags;
      	__s32 sched_nice;
      	__u32 sched_priority;
      	__u64 sched_runtime, sched_deadline, sched_period;
        };
      
        int sched_setattr(pid_t pid, const struct sched_attr *attr, unsigned int flags)
        {
      	return syscall(__NR_sched_setattr, pid, attr, flags);
        }
      
        int main(void)
        {
      	struct sched_attr attr = {
      		.size		= sizeof(attr),
      		.sched_policy	= SCHED_DEADLINE, /* This creates a 10ms/30ms reservation */
      		.sched_runtime	= 10 * 1000 * 1000,
      		.sched_period	= attr.sched_deadline = 30 * 1000 * 1000,
      	};
      
      	if (sched_setattr(0, &attr, 0) < 0) {
      		perror("sched_setattr");
      		return -1;
      	}
      
      	for(;;);
        }
       ---
      
      Committer notes:
      
      Got the program from the provided URL, http://bristot.me/lkml/d.c,
      trimmed it and included in the cset log above, so that we have
      everything needed to test it in one place.
      Signed-off-by: NDaniel Bristot de Oliveira <bristot@redhat.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/866ef75bcebf670ae91c6a96daa63597ba981f0d.1483443552.git.bristot@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      07485918
  12. 11 12月, 2016 1 次提交
  13. 23 11月, 2016 2 次提交
  14. 24 10月, 2016 4 次提交
  15. 05 10月, 2016 1 次提交
  16. 02 8月, 2016 1 次提交
  17. 14 7月, 2016 1 次提交
    • A
      tools lib traceevent: Add correct header for ipv6 definitions · ca575ad2
      Arnaldo Carvalho de Melo 提交于
      We need to include netinet/in.h to get the in6_addr struct definition, needed to
      build it on the Android NDK:
      
        In file included from event-parse.c:36:0:
        /home/acme/android/android-ndk-r12/platforms/android-24/arch-arm/usr/include/netinet/ip6.h:82:18: error: field 'ip6_src' has incomplete type
          struct in6_addr ip6_src; /* source address */
      
      And it is the canonical way of getting IPv6 definitions, as described,
      for instance, in Linux's 'man ipv6'
      
      Doing that uncovers another problem: this source file uses PRIu64 but
      doesn't include it, depending on it being included by chance via the now
      replaced header (netinet/ip6.h), fix it.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Chris Phlipot <cphlipot0@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-tilr31n3yaba1whsd47qlwa3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ca575ad2
  18. 13 7月, 2016 1 次提交