aboutsummaryrefslogtreecommitdiffstats
path: root/tools (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-12-09Revert "radix tree test suite: fix compilation"Linus Torvalds2-1/+29
This reverts commit 53855d10f4567a0577360b6448d52a863929775b. It shouldn't have come in yet - it depends on the changes in linux-next that will come in during the next merge window. As Matthew Wilcox says, the test suite is broken with the current state without the revert. Requested-by: Matthew Wilcox <mawilcox@microsoft.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-12-08kselftests: Exercise hw-independent mock tests for i915.koChris Wilson1-0/+14
Although being a GPU driver most functionality of i915.ko depends upon real hardware, many of its internal interfaces can be "mocked" and so tested independently of any hardware. Expanding the test coverage is not only useful for i915.ko, but should provide some integration tests for core infrastructure as well. Loading i915.ko with mock_selftests=-1 will cause it to execute its mock tests then fail with -ENOTTY. If the driver is already loaded and bound to hardware, it requires a few more steps to unbind, and so the simple preliminary modprobe -r will fail. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Shuah Khan <shuah@kernel.org> Cc: linux-kselftest@vger.kernel.org Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-12-08selftests: add missing gitignore files/dirsShuah Khan3-0/+4
Add missing files and directories to gitignore. Create .gitignore files as needed. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-12-08selftests: add missing set-tz to timers .gitignoreShuah Khan1-0/+1
set-tz is missing from timers/.gitignore. Add it. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-12-07radix tree test suite: fix compilationMatthew Wilcox2-29/+1
Patch "lib/radix-tree: Convert to hotplug state machine" breaks the test suite as it adds a call to cpuhp_setup_state_nocalls() which is not currently emulated in the test suite. Add it, and delete the emulation of the old CPU hotplug mechanism. Link: http://lkml.kernel.org/r/1480369871-5271-36-git-send-email-mawilcox@linuxonhyperv.com Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com> Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Matthew Wilcox <mawilcox@microsoft.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-12-07perf tools: Explicitly document that --children is enabled by defaultYannick Brosseau2-1/+3
The fact that the --children option is enabled by default is buried deep at the end of the help page, in the overhead calculation section. This make it explicit right where the option is listed, following the same way other default options are described Signed-off-by: Yannick Brosseau <scientist@fb.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: kernel-team@fb.com Link: http://lkml.kernel.org/r/20161202160732.29058-1-scientist@fb.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-07perf sched timehist: Cleanup idle_max_cpu handlingNamhyung Kim1-5/+4
It treats the idle_max_cpu little bit confusingly IMHO. Let's make it more straight forward. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: David Ahern <dsahern@gmail.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20161206034010.6499-6-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-07perf sched timehist: Handle zero sample->tid properlyNamhyung Kim1-1/+3
Sometimes samples have tid of 0 but non-0 pid. It ends up having a new thread of 0 tid/pid (instead of referring idle task) since tid is used to search matching task. But I guess it's wrong to use 0 as a tid when pid is set. This patch uses tid only if it has a non-zero value or same as pid (of 0). Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20161206034010.6499-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-07perf callchain: Introduce callchain_cursor__copy()Namhyung Kim2-0/+30
The callchain_cursor__copy() function is to save current callchain captured by a cursor. It'll be used to keep callchains when switching to idle task for each cpu. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20161206034010.6499-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-07perf sched: Cleanup option processingNamhyung Kim1-5/+2
The -D/--dump-raw-trace option is in the parent option so no need to repeat it. Also move -f/--force option to parent as it's common to handle data file. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: David Ahern <dsahern@gmail.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20161206034010.6499-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-07perf sched timehist: Improve error message when analyzing wrong fileDavid Ahern1-1/+5
Arnaldo reported an unhelpful error message when running perf sched timehist on a file that did not contain sched tracepoints: [root@jouet ~]# perf sched timehist No trace sample to read. Did you call 'perf record -R'? [root@jouet ~]# perf evlist -v cycles:ppp: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CALLCHAIN|CPU|PERIOD, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1 Change the has_traces check to look for the sched_switch event. Analysis for perf sched timehist requires at least this event. Now when analyzing a file without sched tracepoints you get: root@f21-vbox:/tmp$ perf sched timehist No sched_switch events found. Have you run 'perf sched record'? Signed-off-by: David Ahern <dsahern@gmail.com> Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1480451988-43673-1-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-06tools/testing/nvdimm: unit test acpi_nfit_ctl()Dan Williams4-6/+262
A recent flurry of bug discoveries in the nfit driver's DSM marshalling routine has highlighted the fact that we do not have unit test coverage for this routine. Add a self-test of acpi_nfit_ctl() routine before probing the "nfit_test.0" device. This mocks stimulus to acpi_nfit_ctl() and if any of the tests fail "nfit_test.0" will be unavailable causing the rest of the tests to not run / fail. This unit test will also be a place to land reproductions of quirky BIOS behavior discovered in the field and ensure the kernel does not regress against implementations it has seen in practice. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2016-12-06perf tools: Move perf build related variables under non fixdep legJiri Olsa1-5/+5
Because there's no need for them in fixdep build. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1481030331-31944-4-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-06perf tools: Force fixdep compilation at the start of the buildJiri Olsa1-12/+38
The fixdep tool needs to be built before everything else, because it fixes every object dependency file. We handle this currently by making all objects to depend on fixdep, which is error prone and is easily forgotten when new object is added. Instead of this, this patch force fixdep tool to be built as the first target in the separate make session. This way we don't need to handle extra fixdep dependencies and we are certain there's no fixdep race with any parallel make job. Committer notes: Testing it: Before: $ rm -rf /tmp/build/perf/ ; mkdir -p /tmp/build/perf ; make -k O=/tmp/build/perf -C tools/perf install-bin make: Entering directory '/home/acme/git/linux/tools/perf' BUILD: Doing 'make -j4' parallel build Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] GEN /tmp/build/perf/common-cmds.h HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep MKDIR /tmp/build/perf/pmu-events/ HOSTCC /tmp/build/perf/pmu-events/json.o MKDIR /tmp/build/perf/pmu-events/ HOSTCC /tmp/build/perf/pmu-events/jsmn.o HOSTCC /tmp/build/perf/pmu-events/jevents.o HOSTLD /tmp/build/perf/pmu-events/jevents-in.o PERF_VERSION = 4.9.rc8.g868cd5 CC /tmp/build/perf/perf-read-vdso32 <SNIP> After: $ rm -rf /tmp/build/perf/ ; mkdir -p /tmp/build/perf ; make -k O=/tmp/build/perf -C tools/perf install-bin make: Entering directory '/home/acme/git/linux/tools/perf' BUILD: Doing 'make -j4' parallel build HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] GEN /tmp/build/perf/common-cmds.h MKDIR /tmp/build/perf/fd/ CC /tmp/build/perf/fd/array.o LD /tmp/build/perf/fd/libapi-in.o MKDIR /tmp/build/perf/fs/ CC /tmp/build/perf/event-parse.o CC /tmp/build/perf/fs/fs.o PERF_VERSION = 4.9.rc8.g57a92f CC /tmp/build/perf/event-plugin.o MKDIR /tmp/build/perf/fs/ CC /tmp/build/perf/fs/tracing_path.o <SNIP> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1481030331-31944-3-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-06perf tools: Move PERF-VERSION-FILE target into rules areaJiri Olsa1-4/+4
An upcoming fixdep fix needs all targets at the same area, so they'll fit under a signal condition block. Moving PERF-VERSION-FILE target into rules section. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1481030331-31944-2-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-06perf build: Check LLVM version in feature checkWang Nan4-4/+28
Cancel builtin llvm and clang support when LLVM version is less than 3.9.0: following commits uses newer API. Since Clang/LLVM's API is not guaranteed to be stable, add a test-llvm-version.cpp feature checker, issue warning if LLVM found in compiling environment is not tested yet. Committer Notes: Testing it: Environment: $ cat /etc/fedora-release Fedora release 25 (Twenty Five) $ rpm -q llvm-devel clang-devel llvm-devel-3.8.0-1.fc25.x86_64 clang-devel-3.8.0-2.fc25.x86_64 $ Before: $ make -k LIBCLANGLLVM=1 O=/tmp/build/perf -C tools/perf install-bin make: Entering directory '/home/acme/git/linux/tools/perf' BUILD: Doing 'make -j4' parallel build Warning: tools/include/uapi/linux/bpf.h differs from kernel Warning: tools/arch/arm/include/uapi/asm/kvm.h differs from kernel INSTALL GTK UI LINK /tmp/build/perf/perf /tmp/build/perf/libperf.a(libperf-in.o): In function `perf::createCompilerInvocation(llvm::SmallVector<char const*, 16u>, llvm::StringRef&, clang::DiagnosticsEngine&)': /home/acme/git/linux/tools/perf/util/c++/clang.cpp:56: undefined reference to `clang::tooling::newInvocation(clang::DiagnosticsEngine*, llvm::SmallVector<char const*, 16u> const&)' /tmp/build/perf/libperf.a(libperf-in.o): In function `perf::getModuleFromSource(llvm::SmallVector<char const*, 16u>, llvm::StringRef, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>)': /home/acme/git/linux/tools/perf/util/c++/clang.cpp:68: undefined reference to `clang::CompilerInstance::CompilerInstance(std::shared_ptr<clang::PCHContainerOperations>, bool)' /home/acme/git/linux/tools/perf/util/c++/clang.cpp:69: undefined reference to `clang::CompilerInstance::createDiagnostics(clang::DiagnosticConsumer*, bool)' <SNIP> After: Makefile.config:807: No suitable libLLVM found, disabling builtin clang and llvm support. Please install llvm-dev(el) (>= 3.9.0) Updating the environment to a locally built LLVM 4.0 + clang 3.9 (forgot to git pull, duh) combo, all works as expected, it is properly detected and built into the resulting perf binary. Signed-off-by: Wang Nan <wangnan0@huawei.com> Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161206072230.7651-1-wangnan0@huawei.com [ Change the warning message a bit (add 'suitable' and 'builtin'), clarifying it, see committer notes above ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-06bpf: add additional verifier tests for BPF_PROG_TYPE_LWT_*Thomas Graf1-0/+134
- direct packet read is allowed for LWT_* - direct packet write for LWT_IN/LWT_OUT is prohibited - direct packet write for LWT_XMIT is allowed - access to skb->tc_classid is prohibited for LWT_* Signed-off-by: Thomas Graf <tgraf@suug.ch> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-06tools: hv: Enable network manager for bonding scripts on RHELHaiyang Zhang1-2/+2
We found network manager is necessary on RHEL to make the synthetic NIC, VF NIC bonding operations handled automatically. So, enabling network manager here. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-06Tools: hv: kvp: configurable external scripts pathAlex Fluter1-3/+8
error when running hypervkvpd: $ sudo ./hv_kvp_daemon -n sh: hv_get_dns_info: command not found sh: hv_get_dhcp_info: command not found sh: hv_get_dns_info: command not found sh: hv_get_dhcp_info: command not found The external scripts are not installed in system path, adding a configurable macro. Signed-off-by: Alex Fluter <afluter@yandex.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-06objtool: Fix bytes check of lea's rex_prefixJiri Slaby1-1/+1
For the "lea %(rsp), %rbp" case, we check if there is a rex_prefix. But we check 'bytes' which is insn_byte_t[4] in rex_prefix (insn_field structure). Therefore, the check is always true. Instead, check 'nbytes' which is the right one. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20161205105551.25917-1-jslaby@suse.cz Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-12-06usbip: add missing compile time generated files to .gitignoreShuah Khan1-0/+4
Add the following files to .gitignore compile libsrc/libusbip_la-sysfs_utils.lo libsrc/libusbip_la-usbip_device_driver.lo libsrc/libusbip_la-usbip_host_common.lo Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-05perf annotate: Show raw form for jump instruction with indirect targetRavi Bangoria1-0/+3
For jump instructions that does not include target address as direct operand, show the original disassembled line for them. This is needed for certain powerpc jump instructions that use target address in a register (such as bctr, btar, ...). Before: ld r12,32088(r12) mtctr r12 v bctr ffffffffffffca2c std r2,24(r1) addis r12,r2,-1 After: ld r12,32088(r12) mtctr r12 v bctr std r2,24(r1) addis r12,r2,-1 Committer notes: Testing it using a perf.data file and vmlinux for powerpc64, cross-annotating it on a x86_64 workstation: Before: .__bpf_prog_run vmlinux.powerpc │ std r10,512(r9) ▒ │ lbz r9,0(r31) ▒ │ rldicr r9,r9,3,60 ▒ │ ldx r9,r30,r9 ▒ │ mtctr r9 ▒ 100.00 │ ↓ bctr 3fffffffffe01510 ▒ │ lwa r10,4(r31) ▒ │ lwz r9,0(r31) ▒ <SNIP> Invalid jump offset: 3fffffffffe01510 After: .__bpf_prog_run vmlinux.powerpc │ std r10,512(r9) ▒ │ lbz r9,0(r31) ▒ │ rldicr r9,r9,3,60 ▒ │ ldx r9,r30,r9 ▒ │ mtctr r9 ▒ 100.00 │ ↓ bctr ▒ │ lwa r10,4(r31) ▒ │ lwz r9,0(r31) ▒ <SNIP> Invalid jump offset: 3fffffffffe01510 This, in turn, uncovers another problem with jumps without operands, the ENTER/-> operation, to jump to the target, still continues using the bogus target :-) BTW, this was the file used for the above tests: [acme@jouet ravi_bangoria]$ perf report --header-only -i perf.data.f22vm.powerdev # ======== # captured on: Thu Nov 24 12:40:38 2016 # hostname : pdev-f22-qemu # os release : 4.4.10-200.fc22.ppc64 # perf version : 4.9.rc1.g6298ce # arch : ppc64 # nrcpus online : 48 # nrcpus avail : 48 # cpudesc : POWER7 (architected), altivec supported # cpuid : 74,513 # total memory : 4158976 kB # cmdline : /home/ravi/Workspace/linux/tools/perf/perf record -a # event : name = cycles:ppp, , size = 112, { sample_period, sample_freq } = 4000, sample_type = IP|TID|TIME|CPU|PERIOD, disabled = 1, inherit = 1, mmap = 1, c # HEADER_CPU_TOPOLOGY info available, use -I to display # HEADER_NUMA_TOPOLOGY info available, use -I to display # pmu mappings: cpu = 4, software = 1, tracepoint = 2, breakpoint = 5 # missing features: HEADER_TRACING_DATA HEADER_BRANCH_STACK HEADER_GROUP_DESC HEADER_AUXTRACE HEADER_STAT HEADER_CACHE # ======== # [acme@jouet ravi_bangoria]$ Suggested-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Chris Riyder <chris.ryder@arm.com> Cc: Kim Phillips <kim.phillips@arm.com> Cc: Markus Trippelsdorf <markus@trippelsdorf.de> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Taeung Song <treeze.taeung@gmail.com> Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/1480953407-7605-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf tools: Add non config targetsJiri Olsa1-1/+1
Adding some missing non config targets that were for some reason omitted. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1480884178-8072-7-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf tools: Cleanup build directory before each testJiri Olsa1-1/+1
Cleanup the fixdep tool before every test. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1480884178-8072-8-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf tools: Move python/perf.so target into rules areaJiri Olsa1-11/+8
Following fixdep fix needs all targets at the same area, so they'll fit under signal condition block. Moving python/perf.so target into rules section and intentionally removing the perl script related comment. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1480884178-8072-5-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf tools: Move install-gtk target into rules areaJiri Olsa1-5/+7
The upcoming fixdep fix needs all targets at the same area, so they'll fit under a signal condition block. Move install-gtk target into the rules section. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1480884178-8072-4-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05tools build: Move tabs to spaces where suitableJiri Olsa3-126/+126
We've been hit several times by a Makefile bug where line indented by tab was falsely considered as target command. We prevent this by always using space indentation for everything except for the target commands. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1480884178-8072-3-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05tools build: Make the .cmd file more readableJiri Olsa1-1/+1
Putting extra line between dependencies and cmd_* definition to make it more readable. Before: $ cat .builtin-top.o.cmd ... /home/jolsa/kernel/linux-perf/tools/include/linux/stringify.h \ /home/jolsa/kernel/linux-perf/tools/include/linux/time64.h cmd_builtin-top.o := gcc -Wp,-MD,./.builtin-top.o.d -Wp,-MT,builtin-... ... After: $ cat .builtin-top.o.cmd ... /home/jolsa/kernel/linux-perf/tools/include/linux/stringify.h \ /home/jolsa/kernel/linux-perf/tools/include/linux/time64.h cmd_builtin-top.o := gcc -Wp,-MD,./.builtin-top.o.d -Wp,-MT,builtin-... ... Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1480884178-8072-2-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf clang: Compile BPF script using builtin clang supportWang Nan3-4/+66
After this patch, perf utilizes builtin clang support to build BPF script, no longer depend on external clang, but fallbacking to it if for some reason the builtin compiling framework fails. Test: $ type clang -bash: type: clang: not found $ cat ~/.perfconfig $ echo '#define LINUX_VERSION_CODE 0x040700' > ./test.c $ cat ./tools/perf/tests/bpf-script-example.c >> ./test.c $ ./perf record -v --dry-run -e ./test.c 2>&1 | grep builtin bpf: successfull builtin compilation $ Can't pass cflags so unable to include kernel headers now. Will be fixed by following commits. Committer notes: Make sure '-v' comes before the '-e ./test.c' in the command line otherwise the 'verbose' variable will not be set when the bpf event is parsed and thus the pr_debug indicating a 'successfull builtin compilation' will not be output, as the debug level (1) will be less than what 'verbose' has at that point (0). Signed-off-by: Wang Nan <wangnan0@huawei.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-16-wangnan0@huawei.com [ Spell check/reflow successfull pr_debug string ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf clang: Support compile IR to BPF object and add testcaseWang Nan5-7/+79
getBPFObjectFromModule() is introduced to compile LLVM IR(Module) to BPF object. Add new testcase for it. Test result: $ ./buildperf/perf test -v clang 51: builtin clang support : 51.1: builtin clang compile C source to IR : --- start --- test child forked, pid 21822 test child finished with 0 ---- end ---- builtin clang support subtest 0: Ok 51.2: builtin clang compile C source to ELF object : --- start --- test child forked, pid 21823 test child finished with 0 ---- end ---- builtin clang support subtest 1: Ok Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-15-wangnan0@huawei.com [ Remove redundant "Test" from entry descriptions ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf clang: Update test case to use real BPF scriptWang Nan4-15/+62
Allow C++ code to use util.h and tests/llvm.h. Let 'perf test' compile a real BPF script. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-14-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf clang: Allow passing CFLAGS to builtin clangWang Nan3-12/+22
Improve getModuleFromSource() API to accept a cflags list. This feature will be used to pass LINUX_VERSION_CODE and -I flags. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-13-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf clang: Use real file system for #includeWang Nan2-12/+35
Utilize clang's OverlayFileSystem facility, allow CompilerInstance to access real file system. With this patch the '#include' directive can be used. Add a new getModuleFromSource for real file. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-12-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf clang: Add builtin clang support ant test caseWang Nan10-0/+218
Add basic clang support in clang.cpp and test__clang() testcase. The first testcase checks if builtin clang is able to generate LLVM IR. tests/clang.c is a proxy. Real testcase resides in utils/c++/clang-test.cpp in c++ and exports C interface to perf test subsystem. Test result: $ perf test -v clang 51: builtin clang support : 51.1: Test builtin clang compile C source to IR : --- start --- test child forked, pid 13215 test child finished with 0 ---- end ---- Test builtin clang support subtest 0: Ok Committer note: Make sure you've enabled CLANG and LLVM builtin support by setting the LIBCLANGLLVM variable on the make command line, e.g.: make LIBCLANGLLVM=1 O=/tmp/build/perf -C tools/perf install-bin Otherwise you'll get this when trying to do the 'perf test' call above: # perf test clang 51: builtin clang support : Skip (not compiled in) # Signed-off-by: Wang Nan <wangnan0@huawei.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-11-wangnan0@huawei.com [ Removed "Test" from descriptions, redundant and already removed from all the other entries ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf build: Add clang and llvm compile and linking supportWang Nan3-1/+59
Add necessary c++ flags and link libraries to support builtin clang and LLVM. Add all llvm and clang libraries, so don't need to worry about clang changes its libraries setting. However, linking perf would take much longer than usual. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-10-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05tools build: Add feature detection for clangWang Nan2-0/+31
Check if basic clang compiling environment is ready. Doesn't like 'llvm-config --libs' which can returns llvm libraries in right order and duplicates some libraries if necessary, there's no correspondence for clang libraries (-lclangxxx). to avoid extra complexity and to avoid new clang breaking libraries ordering, use --start-group and --end-group. In this test case, manually identify required clang libs and hope it to be stable. Putting all clang libraries here is possible (use make's wildcard), but then feature checking becomes very slow. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-9-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05tools build: Add feature detection for LLVMWang Nan2-0/+16
Check if basic LLVM compiling environment is ready. Use llvm-config to detect include and library directories. Avoid using 'llvm-config --cxxflags' because its result contain some unwanted flags like --sysroot (if LLVM is built by yocto). Use '?=' to set LLVM_CONFIG, so explicitly passing LLVM_CONFIG to make would override it. Use 'llvm-config --libs BPF' to check if BPF backend is compiled in. Since now BPF bytecode is the only required backend, no need to waste time linking llvm and clang if BPF backend is missing. This also introduce an implicit requirement that LLVM should be new enough. Old LLVM doesn't support BPF backend. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-8-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf llvm: Extract helpers in llvm-utils.cWang Nan3-18/+68
The following commits will use builtin clang to compile BPF scripts. llvm__get_kbuild_opts() and llvm__get_nr_cpus() are extracted to help building '-DKERNEL_VERSION_CODE' and '-D__NR_CPUS__' macros. Doing object dumping in bpf loader, so further builtin clang compiling needn't consider it. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-7-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05perf tools: Pass context to perf hook functionsWang Nan3-10/+20
Pass a pointer to perf hook functions so they receive context information during setup. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@fb.com> Cc: He Kuang <hekuang@huawei.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Joe Stringer <joe@ovn.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/20161126070354.141764-6-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05tools build: Fix objtool build with clangPeter Foley1-3/+3
Clang doesn't support multiple arguments being passed to -Wp, so split them. Fixes this error: HOSTCC tools/objtool/fixdep.o cat: tools/objtool/.fixdep.o.d: No such file or directory Signed-off-by: Peter Foley <pefoley2@pefoley.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/20161128024346.17371-1-pefoley2@pefoley.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05tools build: Make fixdep parsing wait for last targetJiri Olsa1-2/+3
The fixdep tool, among other things, replaces the target of the object in the gcc generated dependency output file. The parsing code assumes there's only single target in the rule but this is not always the case as described in here: https://gcc.gnu.org/ml/gcc-help/2016-11/msg00099.html Make the fixdep code smart enough to skip all the possible targets. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Peter Foley <pefoley2@pefoley.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/20161201130025.GA16430@krava Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-05bpf: Preserve const register type on const OR alu opsGianluca Borello2-0/+61
Occasionally, clang (e.g. version 3.8.1) translates a sum between two constant operands using a BPF_OR instead of a BPF_ADD. The verifier is currently not handling this scenario, and the destination register type becomes UNKNOWN_VALUE even if it's still storing a constant. As a result, the destination register cannot be used as argument to a helper function expecting a ARG_CONST_STACK_*, limiting some use cases. Modify the verifier to handle this case, and add a few tests to make sure all combinations are supported, and stack boundaries are still verified even with BPF_OR. Signed-off-by: Gianluca Borello <g.borello@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-01tools/power turbostat: Denverton uses a 25 MHz crystal, not 19.2 MHzLen Brown1-1/+1
This changes only the TSC frequency decoding line seen with --debug old: TSC: 1382 MHz (19200000 Hz * 216 / 3 / 1000000) new: TSC: 1800 MHz (25000000 Hz * 216 / 3 / 1000000) Signed-off-by: Len Brown <len.brown@intel.com>
2016-12-01tools/power turbostat: line up headers when -M is usedLen Brown1-1/+1
The -M option adds an 18-column item, and the header needs to be wide enough to keep the header aligned with the columns. Signed-off-by: Len Brown <len.brown@intel.com>
2016-12-01tools/power turbostat: fix SKX PKG_CSTATE_LIMIT decodingLen Brown1-1/+4
SKX has fewer package C-states than previous generations, and so the decoding of PKG_CSTATE_LIMIT has changed. This changes the line ending with pkg-cstate-limit=XXX: pcYYY Signed-off-by: Len Brown <len.brown@intel.com>
2016-12-01selftest: sync: stress test for mergesEmilio López4-0/+120
This test is based on the libsync test suite from Android. This commit includes a test to stress merge operations. Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-12-01selftest: sync: stress consumer/producer testEmilio López4-0/+190
This test is based on the libsync test suite from Android. This commit includes a stress test that replicates a consumer/producer pattern. Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-12-01selftest: sync: stress test for parallelismEmilio López4-0/+116
This test is based on the libsync test suite from Android. This commit includes a stress test that invokes operations in parallel. Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-12-01selftest: sync: wait tests for sw_sync frameworkEmilio López4-0/+96
These tests are based on the libsync test suite from Android. This commit includes tests for waiting on fences. Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-12-01selftest: sync: merge tests for sw_sync frameworkEmilio López4-0/+65
These tests are based on the libsync test suite from Android. This commit includes tests for basic merge operations. Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>