1. 15 11月, 2017 2 次提交
  2. 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
  3. 19 9月, 2017 1 次提交
  4. 09 7月, 2017 3 次提交
  5. 01 7月, 2017 1 次提交
  6. 08 6月, 2017 6 次提交
  7. 27 5月, 2017 1 次提交
  8. 18 5月, 2017 2 次提交
  9. 26 4月, 2017 4 次提交
  10. 19 4月, 2017 6 次提交
    • S
      selftests: ftrace: Add test to test reading of set_ftrace_file · a9064f67
      Steven Rostedt (VMware) 提交于
      The set_ftrace_file lists both functions that are filtered, as well as
      function probes (triggers) that are attached to a function, like traceon or
      stacktrace, etc. The reading of this file is not as trivial as most pseudo
      files are, and there's been various bugs that have appeared in the past
      when there's a mix of probes and functions listed. There's also a difference
      when reading the file using dd with a block size of 1.
      
      This test performs the following:
      
       o Resets set_ftrace_filter
      
       o Makes sure only "#### all functions enabled ####" is listed
      
          (All checks uses cat, and dd with bs=1 and bs=100)
      
       o Adds a traceon trigger to schedule
      
       o Checks if only "#### all function enabled ####" and the trigger is there.
      
       o Adds tracing of schedule
      
       o Checks if only schedule and the trigger is there
      
       o Adds tracing of do_IRQ as well
      
       o Checks if only schedule, do_IRQ and the trigger is there
      
       o Adds a traceon trigger to do_IRQ
      
       o Checks if only schedule, do_IRQ and both triggers are there
      
       o Removes tracing of do_IRQ
      
       o Checks if only schedule and both triggers are there
      
       o Removes tracing of schedule
      
       o Checks if only  "#### all functions enabled ####" and both triggers are there
      
       o Removes the triggers
      
       o Checks if only "#### all functions enabled ####" is there
      
       o Adds tracing of schedule
      
       o Checks if only schedule is there
      
       o Adds tracing of do_IRQ
      
       o Checks if only schedule and do_IRQ are there
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      a9064f67
    • S
      selftests: ftrace: Add a test to test function triggers to start and stop tracing · d8b39e1d
      Steven Rostedt (VMware) 提交于
      This adds a test to test the function tiggers traceon and traceoff to make
      sure that it starts and stops tracing when a function is hit.
      
      The test performs the following:
      
       o Enables all events
      
       o Writes schedule:traceoff into set_ftrace_filter
      
       o Makes sure the tigger exists in the file
      
       o Makes sure the trace file no longer grows
      
       o Makes sure that tracing_on is now zero
      
       o Clears the trace file
      
       o Makes sure it's still empty
      
       o Removes the trigger
      
       o Makes sure tracing is still off (tracing_on is zero)
      
       o Writes schedule:traceon into set_ftrace_filter
      
       o Makes sure the trace file is no longer empty
      
       o Makes sure that tracing_on file is set to one
      
       o Removes the trigger
      
       o Makes sure the trigger is no longer there
      
       o Writes schedule:traceoff:3 into set_ftrace_filter
      
       o Makes sure that tracing_on turns off
      
         . Writes 1 into tracing_on
      
         . Makes sure that it turns off 2 more times
      
       o Writes 1 into tracing_on
      
       o Makes sure that tracing_on is still a one
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      d8b39e1d
    • S
      selftests: ftrace: Add a selftest to test event enable/disable func trigger · 43bb45da
      Steven Rostedt (VMware) 提交于
      This adds a test to enable and disable trace events via the function
      triggers. It tests enabling and disabling the sched:sched_switch event via
      the the event_enable and event_disable function triggers attached to the
      schedule() kernel function.
      
      The test does the following:
      
       o disable all events
      
       o disables or enables the sched_switch event
      
       o writes schedule:event_enable/disable:sched:sched_switch into set_ftrace_filter
      
       o 5 times it checks to make sure:
      
          . Writes 0/1 into the sched_switch/enable
      
          . Checks that the sched_switch/enable goes back to 1/0
      
       o Resets the events
      
       o writes schedule:event_enable/disable:sched:sched_switch:3 into set_ftrace_filter
      
       o Does a loop of 3 to see that sched_switch/enable file gets updated
      
       o Makes sure the sched_switch/enable stops getting updated
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      43bb45da
    • S
      selftests: ftrace: Add a way to reset triggers in the set_ftrace_filter file · 8e5e19c1
      Steven Rostedt (VMware) 提交于
      Just writing into the set_ftrace_filter file does not reset triggers, even
      though it can reset the function list. Triggers require writing the trigger
      name with a "!" prepended. It's worse that it requires the number if the
      trigger has a count associated to it.
      
      Add a reset_ftrace_filter function to the ftrace self tests to allow for the
      tests to have a generic way to clear them. It also resets any functions that
      are listed in that file as well.
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      8e5e19c1
    • S
      selftests: ftrace: Add check for function-fork before running pid filter test · 9ed19c76
      Steven Rostedt (VMware) 提交于
      Have the func-filter-pid test check for the function-fork option before
      testing it. It can still test the pid filtering, but will stop before
      testing the function-fork option for children inheriting the pids.
      This allows the test to be added before the function-fork feature, but after
      a bug fix that triggers one of the bugs the test can cause.
      
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      9ed19c76
    • N
      selftests: ftrace: Add a testcase for function PID filter · 093be89a
      Namhyung Kim 提交于
      Like event pid filtering test, add function pid filtering test with the
      new "function-fork" option.  It also tests it on an instance directory
      so that it can verify the bug related pid filtering on instances.
      
      Link: http://lkml.kernel.org/r/20170417024430.21194-5-namhyung@kernel.org
      
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      093be89a
  11. 11 4月, 2017 1 次提交
  12. 04 4月, 2017 1 次提交
    • A
      tracing/kprobes: expose maxactive for kretprobe in kprobe_events · 696ced4f
      Alban Crequy 提交于
      When a kretprobe is installed on a kernel function, there is a maximum
      limit of how many calls in parallel it can catch (aka "maxactive"). A
      kernel module could call register_kretprobe() and initialize maxactive
      (see example in samples/kprobes/kretprobe_example.c).
      
      But that is not exposed to userspace and it is currently not possible to
      choose maxactive when writing to /sys/kernel/debug/tracing/kprobe_events
      
      The default maxactive can be as low as 1 on single-core with a
      non-preemptive kernel. This is too low and we need to increase it not
      only for recursive functions, but for functions that sleep or resched.
      
      This patch updates the format of the command that can be written to
      kprobe_events so that maxactive can be optionally specified.
      
      I need this for a bpf program attached to the kretprobe of
      inet_csk_accept, which can sleep for a long time.
      
      This patch includes a basic selftest:
      
      > # ./ftracetest -v  test.d/kprobe/
      > === Ftrace unit tests ===
      > [1] Kprobe dynamic event - adding and removing	[PASS]
      > [2] Kprobe dynamic event - busy event check	[PASS]
      > [3] Kprobe dynamic event with arguments	[PASS]
      > [4] Kprobes event arguments with types	[PASS]
      > [5] Kprobe dynamic event with function tracer	[PASS]
      > [6] Kretprobe dynamic event with arguments	[PASS]
      > [7] Kretprobe dynamic event with maxactive	[PASS]
      >
      > # of passed:  7
      > # of failed:  0
      > # of unresolved:  0
      > # of untested:  0
      > # of unsupported:  0
      > # of xfailed:  0
      > # of undefined(test bug):  0
      
      BugLink: https://github.com/iovisor/bcc/issues/1072
      Link: http://lkml.kernel.org/r/1491215782-15490-1-git-send-email-alban@kinvolk.ioAcked-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: NAlban Crequy <alban@kinvolk.io>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      696ced4f
  13. 23 11月, 2016 5 次提交
  14. 20 6月, 2016 1 次提交
  15. 23 5月, 2016 1 次提交
  16. 16 5月, 2016 1 次提交
  17. 10 5月, 2016 1 次提交
  18. 20 4月, 2016 2 次提交