1. 19 May, 2022 3 commits
  2. 21 Apr, 2022 1 commit
  3. 12 Nov, 2021 1 commit
    • Sasha Levin's avatar
      tools/lib/lockdep: drop liblockdep · 7246f4dc
      Sasha Levin authored
      
      TL;DR: While a tool like liblockdep is useful, it probably doesn't
      belong within the kernel tree.
      
      liblockdep attempts to reuse kernel code both directly (by directly
      building the kernel's lockdep code) as well as indirectly (by using
      sanitized headers). This makes liblockdep an integral part of the
      kernel.
      
      It also makes liblockdep quite unique: while other userspace code might
      use sanitized headers, it generally doesn't attempt to use kernel code
      directly which means that changes on the kernel side of things don't
      affect (and break) it directly.
      
      All our workflows and tooling around liblockdep don't support this
      uniqueness. Changes that go into the kernel code aren't validated to not
      break in-tree userspace code.
      
      liblockdep ended up being very fragile, breaking over and over, to the
      point that living in the same tree as the lockdep code lost most of it's
      value.
      
      liblockdep should continue living in an external tree, syncing with
      the kernel often, in a controllable way.
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7246f4dc
  4. 17 Oct, 2021 1 commit
  5. 12 Feb, 2021 1 commit
    • Viktor Rosendahl's avatar
      tracing/tools: Add the latency-collector to tools directory · e23db805
      Viktor Rosendahl authored
      This is a tool that is intended to work around the fact that the
      preemptoff, irqsoff, and preemptirqsoff tracers only work in
      overwrite mode. The idea is to act randomly in such a way that we
      do not systematically lose any latencies, so that if enough testing
      is done, all latencies will be captured. If the same burst of
      latencies is repeated, then sooner or later we will have captured all
      the latencies.
      
      It also works with the wakeup_dl, wakeup_rt, and wakeup tracers.
      However, in that case it is probably not useful to use the random
      sleep functionality.
      
      The reason why it may be desirable to catch all latencies with a long
      test campaign is that for some organizations, it's necessary to test
      the kernel in the field and not practical for developers to work
      iteratively with field testers. Because of cost and project schedules
      it is not possible to start a new test campaign every time a latency
      problem has been fixed.
      
      It uses inotify to detect changes to /sys/kernel/tracing/trace.
      When a latency is detected, it will either sleep or print
      immediately, depending on a function that act as an unfair coin
      toss.
      
      If immediate print is chosen, it means that we open
      /sys/kernel/tracing/trace and thereby cause a blackout period
      that will hide any subsequent latencies.
      
      If sleep is chosen, it means that we wait before opening
      /sys/kernel/tracing/trace, by default for 1000 ms, to see if
      there is another latency during this period. If there is, then we will
      lose the previous latency. The coin will be tossed again with a
      different probability, and we will either print the new latency, or
      possibly a subsequent one.
      
      The probability for the unfair coin toss is chosen so that there
      is equal probability to obtain any of the latencies in a burst.
      However, this assumes that we make an assumption of how many
      latencies there can be. By default  the program assumes that there
      are no more than 2 latencies in a burst, the probability of immediate
      printout will be:
      
      1/2 and 1
      
      Thus, the probability of getting each of the two latencies will be 1/2.
      
      If we ever find that there is more than one latency in a series,
      meaning that we reach the probability of 1, then the table will be
      expanded to:
      
      1/3, 1/2, and 1
      
      Thus, we assume that there are no more than three latencies and each
      with a probability of 1/3 of being captured. If the probability of 1
      is reached in the new table, that is we see more than two closely
      occurring latencies, then the table will again be extended, and so
      on.
      
      On my systems, it seems like this scheme works fairly well, as
      long as the latencies we trace are long enough, 300 us seems to be
      enough. This userspace program receive the inotify event at the end
      of a latency, and it has time until the end of the next latency
      to react, that is to open /sys/kernel/tracing/trace. Thus,
      if we trace latencies that are >300 us, then we have at least 300 us
      to react.
      
      The minimum latency will of course not be 300 us on all systems, it
      will depend on the hardware, kernel version, workload and
      configuration.
      
      Example usage:
      
      In one shell, give the following command:
      sudo latency-collector -rvv -t preemptirqsoff -s 2000 -a 3
      
      This will trace latencies > 2000us with the preemptirqsoff tracer,
      using random sleep with maximum verbosity, with a probability
      table initialized to a size of 3.
      
      In another shell, generate a few bursts of latencies:
      
      root@host:~# modprobe preemptirq_delay_test delay=3000 test_mode=alternate
      burst_size=3
      root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
      root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
      root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
      root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
      
      If all goes well, you should be getting stack traces that shows
      all the different latencies, i.e. you should see all the three
      functions preemptirqtest_0, preemptirqtest_1, preemptirqtest_2 in the
      stack traces.
      
      Link: https://lkml.kernel.org/r/20210212134421.172750-2-Viktor.Rosendahl@bmw.de
      
      Signed-off-by: default avatarViktor Rosendahl <Viktor.Rosendahl@bmw.de>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      e23db805
  6. 13 Jul, 2020 1 commit
  7. 13 Jan, 2020 1 commit
  8. 14 Aug, 2019 1 commit
  9. 03 Jul, 2019 1 commit
    • Srinivas Pandruvada's avatar
      tools/power/x86: A tool to validate Intel Speed Select commands · 3fb4f7cd
      Srinivas Pandruvada authored
      
      The Intel(R) Speed select technologies contains four features.
      
      Performance profile:An non architectural mechanism that allows multiple
      optimized performance profiles per system via static and/or dynamic
      adjustment of core count, workload, Tjmax, and TDP, etc. aka ISS
      in the documentation.
      
      Base Frequency: Enables users to increase guaranteed base frequency on
      certain cores (high priority cores) in exchange for lower base frequency
      on remaining cores (low priority cores). aka PBF in the documenation.
      
      Turbo frequency: Enables the ability to set different turbo ratio limits
      to cores based on priority. aka FACT in the documentation.
      
      Core power: An Interface that allows user to define per core/tile
      priority.
      
      There is a multi level help for commands and options. This can be used
      to check required arguments for each feature and commands for the
      feature.
      
      To start navigating the features start with
      
      $sudo intel-speed-select --help
      
      For help on a specific feature for example
      $sudo intel-speed-select perf-profile --help
      
      To get help for a command for a feature for example
      $sudo intel-speed-select perf-profile get-lock-status --help
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Acked-by: default avatarLen Brown <len.brown@intel.com>
      Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      3fb4f7cd
  10. 08 Jan, 2019 1 commit
  11. 11 Nov, 2018 1 commit
  12. 03 Oct, 2018 1 commit
  13. 03 Nov, 2017 1 commit
  14. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      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...
      b2441318
  15. 05 Oct, 2017 1 commit
  16. 24 Aug, 2017 1 commit
  17. 09 Aug, 2017 1 commit
  18. 26 Jul, 2017 1 commit
  19. 05 Jun, 2017 1 commit
  20. 03 May, 2017 1 commit
  21. 22 Nov, 2016 1 commit
  22. 23 Jun, 2016 1 commit
  23. 25 May, 2016 1 commit
  24. 25 Apr, 2016 1 commit
  25. 29 Feb, 2016 1 commit
    • Josh Poimboeuf's avatar
      objtool: Add tool to perform compile-time stack metadata validation · 442f04c3
      Josh Poimboeuf authored
      This adds a host tool named objtool which has a "check" subcommand which
      analyzes .o files to ensure the validity of stack metadata.  It enforces
      a set of rules on asm code and C inline assembly code so that stack
      traces can be reliable.
      
      For each function, it recursively follows all possible code paths and
      validates the correct frame pointer state at each instruction.
      
      It also follows code paths involving kernel special sections, like
      .altinstructions, __jump_table, and __ex_table, which can add
      alternative execution paths to a given instruction (or set of
      instructions).  Similarly, it knows how to follow switch statements, for
      which gcc sometimes uses jump tables.
      
      Here are some of the benefits of validating stack metadata:
      
      a) More reliable stack traces for frame pointer enabled kernels
      
         Frame pointers are used for debugging purposes.  They allow runtime
         code and debug tools to be able to walk the stack to determine the
         chain ...
      442f04c3
  26. 09 Feb, 2016 1 commit
    • Linus Walleij's avatar
      tools/gpio: create GPIO tools · 6d591c46
      Linus Walleij authored
      
      This creates GPIO tools under tools/gpio/* and adds a single
      example program to list the GPIOs on a system. When proper
      devices are created it provides this minimal output:
      
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Michael Welling <mwelling@ieee.org>
      Cc: Markus Pargmann <mpa@pengutronix.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      6d591c46
  27. 12 Jan, 2016 1 commit
  28. 11 Jan, 2016 1 commit
  29. 23 Nov, 2015 1 commit
  30. 18 Nov, 2015 1 commit
  31. 12 Nov, 2015 2 commits
  32. 08 Jun, 2015 1 commit
  33. 29 Apr, 2015 2 commits
  34. 09 Apr, 2015 1 commit
  35. 08 May, 2014 1 commit
  36. 15 Feb, 2014 1 commit