aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2017-06-08perf tools: Fix a memory leak in __open_dso()Namhyung Kim1-1/+3
The 'name' variable should be freed on the error path. Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Wang Nan <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2017-06-08perf annotate: Fix symbolic link of build-id cacheNamhyung Kim1-1/+9
The commit 6ebd2547dd24 ("perf annotate: Fix a bug following symbolic link of a build-id file") changed to use dirname to follow the symlink. But it only considers new-style build-id cache names so old names fail on readlink() and force to use system path which might not available. Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Taeung Song <[email protected]> Cc: Wang Nan <[email protected]> Cc: [email protected] Fixes: 6ebd2547dd24 ("perf annotate: Fix a bug following symbolic link of a build-id file") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2017-06-08tools/kvm_stat: display guest list in pid/guest selection screensStefan Raspl1-12/+37
Display a (possibly inaccurate) list of all running guests. Note that we leave a bit of extra room above the list for potential error messages. Furthermore, we deliberately do not reject pids or guest names that are not in our list, as we cannot rule out that our fuzzy approach might be in error somehow. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: add new interactive command 'o'Stefan Raspl2-1/+18
Add new interactive command 'o' to toggle sorting by 'CurAvg/s' (default) and 'Total' columns. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: add new interactive command 's'Stefan Raspl2-8/+49
Add new command 's' to modify the update interval. Limited to a maximum of 25.5 sec and a minimum of 0.1 sec, since curses cannot handle longer and shorter delays respectively. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: add new interactive command 'h'Stefan Raspl2-5/+34
Display interactive commands reference on 'h'. While at it, sort interactive commands alphabetically in various places. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: rename 'Current' column to 'CurAvg/s'Stefan Raspl1-3/+3
'Current' can be misleading as it doesn't tell whether this is the amount of events in the last interval or the current average per second. Note that this necessitates widening the respective column by one more character. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: make heading look a bit more like 'top'Stefan Raspl1-1/+2
Print header in standout font just like the 'top' command does. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: display message indicating lack of eventsStefan Raspl1-0/+2
Give users some indication on the reason why no data is displayed on the screen yet. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: show cursor in selection screensStefan Raspl1-0/+6
Show the cursor in the interactive screens to specify pid, filter or guest name as an orientation for the user. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: move functions to corresponding classesStefan Raspl1-162/+165
Quite a few of the functions are used only in a single class. Moving functions accordingly to improve the overall structure. Furthermore, introduce a base class for the providers, which might also come handy for future extensions. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: simplify initializersStefan Raspl1-38/+36
Simplify a couple of initialization routines: * TracepointProvider and DebugfsProvider: Pass pid into __init__() instead of switching to the requested value in an extra call after initializing to the default first. * Pass a single options object into Stats.__init__(), delaying options evaluation accordingly, instead of evaluating options first and passing several parts of the options object to Stats.__init__() individually. * Eliminate Stats.update_provider_pid(), since this 2-line function is now used in a single place only. * Remove extra call to update_drilldown() in Tui.__init__() by getting the value of options.fields right initially when parsing options. * Simplify get_providers() logic. * Avoid duplicate fields initialization by handling it once in the providers' __init__() methods. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: remove extra statementStefan Raspl1-1/+0
Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: removed unused functionStefan Raspl1-3/+0
Function available_fields() is not used in any place. Signed-off-by: Stefan Raspl <[email protected]> Reviewed-by: Janosch Frank <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: simplify line print logicStefan Raspl1-19/+7
Simplify line print logic for header and data lines in interactive mode as previously suggested by Radim. While at it, add a space between the first two columns to avoid the total bleeding into the event name. Furthermore, for column 'Current', differentiate between no events being reported (empty 'Current' column) vs the case where events were reported but the average was rounded down to zero ('0' in 'Current column), for the folks who appreciate the difference. Finally: Only skip events which were not reported at all yet, instead of events that don't have a value in the current interval. Considered using constants for the field widths in the format strings. However, that would make things a bit more complicated, and considering that there are only two places where output happens, I figured it isn't worth the trouble. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: remove unnecessary header redrawsStefan Raspl1-2/+0
Certain interactive commands will not modify any information displayed in the header, hence we can skip them. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: fix undue use of initial sleeptimeStefan Raspl1-3/+0
We should not use the initial sleeptime for any key press that does not switch to a different screen, as that introduces an unaesthetic flicker due to two updates in quick succession. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: fix event counts display for interrupted intervalsStefan Raspl1-2/+5
When an update interval is interrupted via key press (e.g. space), the 'Current' column value is calculated using the full interval length instead of the elapsed time, which leads to lower than actual numbers. Furthermore, the value should be rounded, not truncated. This is fixed by using the actual elapsed time for the calculation. Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08tools/kvm_stat: fix typoStefan Raspl1-1/+1
Signed-off-by: Stefan Raspl <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2017-06-08rcutorture: Add "git diff" output to testid.txt filePaul E. McKenney1-4/+1
Currently, when running from a git archive, the testid.txt file contains only the branch name, the output of "git status", and the SHA-1 of the current HEAD. This is useful, but does not uniquely identify the source code that was built. This commit therefore adds the output of "git diff HEAD", which means that if two testid.txt files compare equal, they correspond to exactly the same source code. Give or take the possibility of SHA-1 collisions, that is. ;-) Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08srcu-cbmc: Use /usr/bin/awk instead of /bin/awkPriyalee Kushwaha1-1/+1
Most OS distribution have awk in /usr/bin not in /bin Without this patch, kernel-devsrc fails to build as runtime dependency for srcu-cbmc script /bin/awk is not found. Signed-off-by: Kushwaha, Priyalee <[email protected]> Acked-by: Lance Roy <[email protected]> Reviewed-by: Josh Triplett <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcutorture: Reduce CPUs dedicated to testing Classic SRCUPaul E. McKenney1-1/+1
Given that the plan is to retire Classic SRCU in the near future, this commit reduces the number of CPUs dedicated to testing Classic SRCU. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcuperf: Add the ability to test tiny RCU flavorsPaul E. McKenney1-0/+16
This commit adds a TINY rcuperf test scenario, which allows performance testing of Tiny RCU and Tiny SRCU. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcuperf: Add a Kconfig-fragment file for Classic SRCUPaul E. McKenney1-0/+16
This commit adds a Kconfig-fragment file for Classic SRCU to ease performance comparisons with Tree SRCU. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcuperf: Remove conflicting Kconfig optionsPaul E. McKenney2-2/+0
The TREE and TREE54 rcuperf scenarios' Kconfig fragment files specified conflicting values for CONFIG_RCU_TRACE. This commit therefore removes the =n line in favor of the =y line. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcutorture: Update test scenarios based on new Kconfig dependenciesPaul E. McKenney6-5/+5
A number of the rcutorture test scenarios were not using the desired Kconfig options because dependencies were preventing the selections in the Kconfig-fragment files from being honored. This commit therefore updates the Kconfig-fragment files to account for these changes in dependencies. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcutorture: Correctly handle CONFIG_RCU_TORTURE_TEST_* optionsPaul E. McKenney1-1/+1
The rcutorture scripting handles the CONFIG_*_TORTURE_TEST Kconfig options specially, and therefore greps them out of the Kconfig-fragment files. Unfortunately, a poor choice of grep pattern means that the CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP, CONFIG_RCU_TORTURE_TEST_SLOW_INIT, and CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT Kconfig options are also grepped out, preventing rcutorture from using them. This commit therefore fixes the offending grep pattern to focus only on the CONFIG_*_TORTURE_TEST Kconfig options. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcutorture: Add a scenario for Classic SRCUPaul E. McKenney3-0/+13
A robust combination of paranoia and cowardice has resulted in retaining Classic SRCU (CONFIG_CLASSIC_SRCU) as a backup for the shiny new Tiny and Tree SRCU implementations. If it is to be a viable backup, it of course needs to be tested. This commit therefore adds an rcutorture scenario named SRCU-C for Classic SRCU. This commit also adds this scenario to the set that are run by default. Once sufficient good experience has accumulated for Tiny and Tree SRCU, this test will be removed, along with the Classic SRCU implementation itself. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcutorture: Add a scenario for Tiny SRCUPaul E. McKenney5-0/+23
This commit adds an SRCU-t rcutorture scenario for the new Tiny SRCU implementation, removing the need to pass the --bootargs parameter to kvm.sh to run Tiny SRCU tests. This commit also adds SRCU-t to the set of scenarios that are run by default. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcutorture: Fix bug in reporting Kconfig mis-settingsPaul E. McKenney1-1/+1
Kconfig "select" clauses can defeat Kconfig-fragment file attempts to clear a given Kconfig variable, and dependencies can defeat attempts to set a given Kconfig variable. Because "select" clauses and dependencies can be added at any time, there needs to be a way to verify that the Kconfig-fragment file's requests were honored. And there is, except that it is buggy. This commit therefore provides the needed fix. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcutorture: Add three-level tree test for Tree SRCUPaul E. McKenney2-2/+4
This commit adds a test for a three-level srcu_node tree for Tree SRCU in the existing SRCU-P scenario. This requires enabling CONFIG_RCU_EXPERT, so the CONFIG_RCU_EXPERT=n scenario is now SRCU-N. The reason for using SRCU-P for the tall tree is that preemption raises the possibility of locating more bugs than does the non-preemptive SRCU-N. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-08rcutorture: Add lockdep to one of the SRCU scenariosPaul E. McKenney1-0/+2
Back when SRCU was simpler, there wasn't much need for lockdep. However, with Tree SRCU, it is needed. This commit therefore adds CONFIG_PROVE_LOCKING to the SRCU-P scenario. Signed-off-by: Paul E. McKenney <[email protected]>
2017-06-07perf script python: Remove dups in documentation examplesSeongJae Park1-4/+2
Few shell command examples in perf-script-python.txt has few nitpicks include: - tools/perf/scripts/python directory listing command is unnecessarily repeated. - few examples contain additional information in command prompt unnecessarily and inconsistently. This commit fixes them to enhance readability of the document. Signed-off-by: SeongJae Park <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Tom Zanussi <[email protected]> Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2017-06-07perf script python: Updated trace_unhandled() signatureSeongJae Park1-6/+3
Default function signature of trace_unhandled() got changed to include a field dict, but its documentation, perf-script-python.txt has not been updated. Fix it. Signed-off-by: SeongJae Park <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Pierre Tardy <[email protected]> Fixes: c02514850d67 ("perf scripts python: Give field dict to unhandled callback") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2017-06-07perf script python: Fix wrong code snippets in documentationSeongJae Park1-2/+2
This commit fixes wrong code snippets for trace_begin() and trace_end() function example definition. Signed-off-by: SeongJae Park <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Tom Zanussi <[email protected]> Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2017-06-07perf script: Fix documentation errorsSeongJae Park2-3/+3
This commit fixes two errors in documents for perf-script-python and perf-script-perl as below: - /sys/kernel/debug/tracing events -> /sys/kernel/debug/tracing/events/ - trace_handled -> trace_unhandled Signed-off-by: SeongJae Park <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Tom Zanussi <[email protected]> Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2017-06-07perf script: Fix outdated comment for perf-trace-pythonSeongJae Park1-1/+1
Script generated by the '--gen-script' option contains an outdated comment. It mentions a 'perf-trace-python' document while it has been renamed to 'perf-script-python'. Fix it. Signed-off-by: SeongJae Park <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Fixes: 133dc4c39c57 ("perf: Rename 'perf trace' to 'perf script'") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2017-06-07perf probe: Fix examples section of documentationSeongJae Park1-2/+6
An example in perf-probe documentation for pattern of function name based probe addition is not providing example command for that case. This commit fixes the example to give appropriate example command. Signed-off-by: SeongJae Park <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Taeung Song <[email protected]> Fixes: ee391de876ae ("perf probe: Update perf probe document") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2017-06-07selftests/ftrace: Return unsupported if it detects older kernelMasami Hiramatsu2-0/+18
Return unsupported if the kernel is too old to support instance independent ftrace filter for some testcases. Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07selftests/ftrace: Use top-level available_filter_functionMasami Hiramatsu1-0/+4
Use top-level available_filter_function if the test case is running under an instance. Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07selftests/ftrace: Add instance indication in test logMasami Hiramatsu1-1/+1
Add instance test indication in test log too. Current ftracetest shows instance test indication on the list of test, but not in the log for each test. This adds instance test indication on the top of each log, like below; execute (instance) : /ftrace/test.d/ftrace/func_set_ftrace_file.tc Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07selftests/ftrace: Reset ftrace filter on older kernelMasami Hiramatsu1-1/+4
Since older kernel didn't support separated instance of set_ftrace_filter, if the test case set the filter in an instance, it will propagate to top-level instance. This means that the filter setting remains even if we remove the instance, and will cause other tests failure. To avoid this issue, reset the ftrace filter if we detect the propagation. Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07ftrace/kprobes: selftests: Check kretprobe maxactive is supportedMasami Hiramatsu1-0/+1
Check the kretprobe maxactive is supported by kprobe_events interface. To ensure the kernel feature, this changes ftrace README to describe it. Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07selftests/ftrace: Reduce trace buffer checking overheadMasami Hiramatsu1-2/+6
Current event/toplevel-enable.tc checking the trace buffer by dumping all events while recording events. However, this makes system very busy. To reduce this overhead comes from reading trace buffer and recording trace buffer, use head instead of cat and stop tracing while reading. Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07selftests/ftrace: Skip full-glob-matching filter test on older kernelMasami Hiramatsu1-11/+17
Skip a part of ftrace filter test related to full-glob matching if we are sure that the testing kernel is so old that it does not support full-glob-matching yet. Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07selftests/seccomp: Force rebuild according to dependenciesMickaël Salaün1-0/+2
Rebuild the seccomp tests when kselftest_harness.h is updated. Signed-off-by: Mickaël Salaün <[email protected]> Acked-by: Kees Cook <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Will Drewry <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07Documentation/dev-tools: Add kselftest_harness documentationMickaël Salaün1-85/+330
Add ReST metadata to kselftest_harness.h to be able to include the comments in the Sphinx documentation. Signed-off-by: Mickaël Salaün <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Kees Cook <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Will Drewry <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07selftests: Remove the TEST_API() wrapper from kselftest_harness.hMickaël Salaün1-205/+150
Remove the TEST_API() wrapper to expose the underlying macro arguments to the documentation tools. Signed-off-by: Mickaël Salaün <[email protected]> Acked-by: Kees Cook <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Kees Cook <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Will Drewry <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07selftests: Cosmetic renames in kselftest_harness.hMickaël Salaün1-5/+6
Keep the content consistent with the new name. Signed-off-by: Mickaël Salaün <[email protected]> Acked-by: Kees Cook <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Will Drewry <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2017-06-07selftests: Make test_harness.h more generally availableMickaël Salaün2-1/+1
The seccomp/test_harness.h file contains useful helpers to build tests. Moving it to the selftest directory should benefit to other test components. Keep seccomp maintainers for this file. Signed-off-by: Mickaël Salaün <[email protected]> Acked-by: Kees Cook <[email protected]> Acked-by: Will Drewry <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Shuah Khan <[email protected]> Link: https://lkml.kernel.org/r/CAGXu5j+8CVz8vL51DRYXqOY=xc3zuKFf=PTENe88XYHzFYidUQ@mail.gmail.com Signed-off-by: Shuah Khan <[email protected]>