Commit graph

8690 commits

Author SHA1 Message Date
Rashmica Gupta 16aab32187 selftests/powerpc: Add test to check if TM SPRs are corrupted
Testing that the TM SPRs are behaving the way they should. Uses more
threads than cpus to see if the following register values persist with
context switching:
- the FS (failure summary) flag in TEXASR
- TFIAR and TFHAR

Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:14 +10:00
Rashmica Gupta dbccb4940c selftests/powerpc: Add TM test to check if TAR is corrupted
If the transaction is aborted, the TAR should be rolled back to the
checkpointed value before the transaction began. The value written to the
TAR when the transaction is suspended should only remain there if the
transaction completes successfully.

Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:13 +10:00
Rashmica Gupta d95be4ca3e selftests/powerpc: Add test for forking inside transaction
This test does a fork syscall inside a transaction. Basic sniff test to see
if we can enter the kernel during a transaction.

Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:13 +10:00
Rashmica Gupta da3ddc3b5f selftests/powerpc: Standardise TM calls
Currently tbegin, tend etc are written as opcodes or asm instructions. So
standardise these to asm instructions.

Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:12 +10:00
Rashmica Gupta 2d59b3b256 selftests/powerpc: Make reg.h common to all powerpc selftests
Currently there is a reg.h in pmu/ebb that has defines that are useful
in other powerpc selftests so move this up into selftests/powerpc
folder. Also include in utils.h - as this is often used in self tests.
Add in some other useful register defines.

Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:12 +10:00
Naveen N. Rao f47822078d perf tools: Fix perf regs mask generation
On some architectures (powerpc in particular), the number of registers
exceeds what can be represented in an integer bitmask. Ensure we
generate the proper bitmask on such platforms.

Fixes: 71ad0f5e4 ("perf tools: Support for DWARF CFI unwinding on post processing")
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:06 +10:00
Chandan Kumar c4522469e6 perf/powerpc: Add support for unwinding perf-stackdump
Adds support for unwinding user stack dump by linking with libunwind.

Signed-off-by: Chandan Kumar <chandan.kumar@linux.vnet.ibm.com>
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:06 +10:00
Michael Ellerman 2f67798c1f selftests/powerpc: Fix subpage_prot test to return !0 on failure
It's helpful for automated testing if the test returns error codes back
to the calling program.

While we're here fix all the usages of %p to remove the double 0x, ie.
%p already includes 0x.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2016-05-11 21:54:02 +10:00
Chris Smart 438517ec78 selftests/powerpc: Test cp_abort during context switch
Test that performing a copy paste sequence in userspace on P9 does not
result in a leak of the copy into the paste of another process.

This is based on Anton Blanchard's context_switch benchmarking code. It
sets up two processes tied to the same CPU, one which copies and one
which pastes.

The paste should never succeed and the test fails if it does.

This is a test for commit, "8a64904 powerpc: Add support for userspace
P9 copy paste."

Patch created with much assistance from Michael Neuling
<mikey@neuling.org>

Signed-off-by: Chris Smart <chris@distroguy.com>
Reviewed-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:01 +10:00
Madhavan Srinivasan bb62bad623 tool/perf: Add sample_reg_mask to include all perf_regs
Add sample_reg_mask array with pt_regs registers.
This is needed for printing supported regs ( -I? option).

Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-04-21 23:33:00 +10:00
Anju T dc642e8388 tools/perf: Map the ID values with register names
Map ID values with corresponding register names. These names are then
displayed when user issues perf record with the -I option
followed by perf report/script with -D option.

To test this patchset, Eg:

  $ perf record -I ls   # record machine state at interrupt
  $ perf script -D      # read the perf.data file

Sample output obtained for this patch / output looks like as follows:

  496768515470 0x1988 [0x188]: PERF_RECORD_SAMPLE(IP, 0x1): 4522/4522:
  0xc0000000001e538c period: 1 addr: 0
  ... intr regs: mask 0x7ffffffffff ABI 64-bit
  .... r0    0xc0000000001e5e34
  .... r1    0xc000000fe733f9a0
  .... r2    0xc000000001523100
  .... r3    0xc000000ffaadeb60
  .... r4    0xc000000003456800
  .... r5    0x73a9b5e000
  .... r6    0x1e000000
  .... r7    0x0
  .... r8    0x0
  .... r9    0x0
  .... r10   0x1
  .... r11   0x0
  .... r12   0x24022822
  .... r13   0xc00000000feec180
  .... r14   0x0
  .... r15   0xc000001e4be18800
  .... r16   0x0
  .... r17   0xc000000ffaac5000
  .... r18   0xc000000fe733f8a0
  .... r19   0xc000000001523100
  .... r20   0xc00000000009fd1c
  .... r21   0xc000000fcaa69000
  .... r22   0xc0000000001e4968
  .... r23   0xc000000001523100
  .... r24   0xc000000fe733f850
  .... r25   0xc000000fcaa69000
  .... r26   0xc000000003b8fcf0
  .... r27   0xfffffffffffffead
  .... r28   0x0
  .... r29   0xc000000fcaa69000
  .... r30   0x1
  .... r31   0x0
  .... nip   0xc0000000001dd320
  .... msr   0x9000000000009032
  .... orig_r3 0xc0000000001e538c
  .... ctr   0xc00000000009d550
  .... link  0xc0000000001e5e34
  .... xer   0x0
  .... ccr   0x84022882
  .... softe 0x0
  .... trap  0xf01
  .... dar   0x0
  .... dsisr 0xf00040060000004
   ... thread: :4522:4522
   ...... dso: /root/.debug/.build-id/b0/ef11b1a1629e62ac9de75199117ee5ef9469e9
             :4522 4522 496.768515: 1 cycles: c0000000001e538c
             .perf_event_context_sched_in (/boot/vmlinux)

Signed-off-by: Anju T <anju@linux.vnet.ibm.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-04-21 23:33:00 +10:00
Linus Torvalds 40bca9dbab Power management and ACPI material for v4.6-rc3
- intel_pstate fixes for two issues exposed by the recent switch
    over from using timers and for one issue introduced during the
    4.4 cycle plus new comments describing data structures used by
    the driver (Rafael Wysocki, Srinivas Pandruvada).
 
  - intel_idle fixes related to CPU offline/online (Richard Cochran).
 
  - intel_idle support (new CPU IDs and state definitions mostly) for
    Skylake-X and Kabylake processors (Len Brown).
 
  - PCC mailbox driver fix for an out-of-bounds memory access that
    may cause the kernel to panic() (Shanker Donthineni).
 
  - New (missing) CPU ID for one apparently overlooked Haswell model
    in the Intel RAPL power capping driver (Srinivas Pandruvada).
 
  - Fix for the PM core's wakeup IRQs framework to make it work after
    wakeup settings reconfiguration from sysfs (Grygorii Strashko).
 
  - Runtime PM documentation update to make it describe what needs
    to be done during device removal more precisely (Krzysztof
    Kozlowski).
 
  - Stale comment removal cleanup in the cpufreq-dt driver (Viresh
    Kumar).
 
  - turbostat utility fixes and support for Broxton, Skylake-X
    and Kabylake processors (Len Brown).
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJXCBaNAAoJEILEb/54YlRxDrkP/jdCfB3wOcRGp6LN6GHksC3u
 k2yUQl+XJZhggLda+yUK2ovV5tCJwGmP1N1B/MacRr/5MeicGXBvt6ZrHGqOfTKo
 9xAGKOt2xsoAbHkleB733GIRD9TYZpqCTx9n0dka7kRArQA/uhY+TlXYY2Kn+E0B
 1c4lEN3d9j4G2qW55YxnfRUOhwUc03syokOsS2z9ChEAVPSrn7Zv8V+8rPwxIz5w
 uUWphlnEQgaRwzwxACHwE0bht8sl1cJ1UUSVbzf30mzRlGHiteYyI/vuE2hF9SiV
 DEv9mhSB+4U6WuBHr4Cwu+nf9YTlaY1ZaS3r5EDzJaNJb8tMqPZcGitfn+fTGtUz
 9GlCQZIBcP1vWBDybuuPOzAH++QUFrikozuNfUu1d+WFEypRyadMIvUhtmZPG9mh
 9+Vem+ta32eXos07dx4Dvth+yNvmG5bxPnteDp3GPsnCCDlXutcKaaJaaj+1NzHi
 oqHyEynMhJuN/D2h+oIVIUppKBVO55M+lJMJrX891zICs/98K2LwOtFDuNRWQml0
 3yR7Ieoj5gxVfbT6zNeH5z7CxP/MymNAMjbxfiwqtGHhkNoAv92ymMxnptPiLCHn
 Zyycelsve3sneV+iyk1fAOZFvDXbzTUyigxGP7Kc87iia/Yd2TjLlvwJkMNK6x/K
 2OSkjJFqqrqAqcXNIz3G
 =f4MM
 -----END PGP SIGNATURE-----

Merge tag 'pm+acpi-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael Wysocki:
 "Fixes for some issues discovered after recent changes and for some
  that have just been found lately regardless of those changes
  (intel_pstate, intel_idle, PM core, mailbox/pcc, turbostat) plus
  support for some new CPU models (intel_idle, Intel RAPL driver,
  turbostat) and documentation updates (intel_pstate, PM core).

  Specifics:

   - intel_pstate fixes for two issues exposed by the recent switch over
     from using timers and for one issue introduced during the 4.4 cycle
     plus new comments describing data structures used by the driver
     (Rafael Wysocki, Srinivas Pandruvada).

   - intel_idle fixes related to CPU offline/online (Richard Cochran).

   - intel_idle support (new CPU IDs and state definitions mostly) for
     Skylake-X and Kabylake processors (Len Brown).

   - PCC mailbox driver fix for an out-of-bounds memory access that may
     cause the kernel to panic() (Shanker Donthineni).

   - New (missing) CPU ID for one apparently overlooked Haswell model in
     the Intel RAPL power capping driver (Srinivas Pandruvada).

   - Fix for the PM core's wakeup IRQs framework to make it work after
     wakeup settings reconfiguration from sysfs (Grygorii Strashko).

   - Runtime PM documentation update to make it describe what needs to
     be done during device removal more precisely (Krzysztof Kozlowski).

   - Stale comment removal cleanup in the cpufreq-dt driver (Viresh
     Kumar).

   - turbostat utility fixes and support for Broxton, Skylake-X and
     Kabylake processors (Len Brown)"

* tag 'pm+acpi-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (28 commits)
  PM / wakeirq: fix wakeirq setting after wakup re-configuration from sysfs
  tools/power turbostat: work around RC6 counter wrap
  tools/power turbostat: initial KBL support
  tools/power turbostat: initial SKX support
  tools/power turbostat: decode BXT TSC frequency via CPUID
  tools/power turbostat: initial BXT support
  tools/power turbostat: print IRTL MSRs
  tools/power turbostat: SGX state should print only if --debug
  intel_idle: Add KBL support
  intel_idle: Add SKX support
  intel_idle: Clean up all registered devices on exit.
  intel_idle: Propagate hot plug errors.
  intel_idle: Don't overreact to a cpuidle registration failure.
  intel_idle: Setup the timer broadcast only on successful driver load.
  intel_idle: Avoid a double free of the per-CPU data.
  intel_idle: Fix dangling registration on error path.
  intel_idle: Fix deallocation order on the driver exit path.
  intel_idle: Remove redundant initialization calls.
  intel_idle: Fix a helper function's return value.
  intel_idle: remove useless return from void function.
  ...
2016-04-09 11:03:48 -07:00
Rafael J. Wysocki 73659be769 Merge branches 'pm-core', 'powercap' and 'pm-tools'
* pm-core:
  PM / wakeirq: fix wakeirq setting after wakup re-configuration from sysfs
  PM / runtime: Document steps for device removal

* powercap:
  powercap: intel_rapl: Add missing Haswell model

* pm-tools:
  tools/power turbostat: work around RC6 counter wrap
  tools/power turbostat: initial KBL support
  tools/power turbostat: initial SKX support
  tools/power turbostat: decode BXT TSC frequency via CPUID
  tools/power turbostat: initial BXT support
  tools/power turbostat: print IRTL MSRs
  tools/power turbostat: SGX state should print only if --debug
2016-04-08 21:46:56 +02:00
Len Brown 9185e988e9 tools/power turbostat: work around RC6 counter wrap
Sometimes the rc6 sysfs counter spontaneously resets,
causing turbostat prints a very large number
as it tries to calcuate % = 100 * (old - new) / interval

When we see (old > new), print ***.**% instead
of a bogus huge number.

Note that this detection is not fool-proof, as the counter
could reset several times and still result in new > old.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-07 22:18:40 +02:00
Len Brown cdc57272ea tools/power turbostat: initial KBL support
KBL is similar to SKL

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-07 22:18:38 +02:00
Len Brown ec53e594c6 tools/power turbostat: initial SKX support
SKX has a lot in common with HSX

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-07 22:18:36 +02:00
Len Brown e8efbc80db tools/power turbostat: decode BXT TSC frequency via CPUID
Hard-code BXT ART to 19200MHz, so turbostat --debug
can fully enumerate TSC:

CPUID(0x15): eax_crystal: 3 ebx_tsc: 186 ecx_crystal_hz: 0
TSC: 1190 MHz (19200000 Hz * 186 / 3 / 1000000)

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-07 22:18:35 +02:00
Len Brown e4085d543e tools/power turbostat: initial BXT support
Broxton has a lot in common with SKL

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-07 22:18:33 +02:00
Len Brown 5a63426e2a tools/power turbostat: print IRTL MSRs
Some processors use the Interrupt Response Time Limit (IRTL) MSR value
to describe the maximum IRQ response time latency for deep
package C-states.  (Though others have the register, but do not use it)
Lets print it out to give insight into the cases where it is used.

IRTL begain in SNB, with PC3/PC6/PC7, and HSW added PC8/PC9/PC10.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-07 22:18:32 +02:00
Len Brown 8ae7225591 tools/power turbostat: SGX state should print only if --debug
The CPUID.SGX bit was printed, even if --debug was used

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-07 22:18:30 +02:00
Linus Torvalds 1e1e5ce78f linux-kselftest-4.6-rc3
This update for Kselftest contains seccomp fixes
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXArY0AAoJEAsCRMQNDUMc194P/2X5oQlSzj9MsdASX2ccuTWI
 HbV50a4BA7BSxVoGuyj25Q84LLRAFosURsk73FNUGsTvRuJykJs7SKjTThp+JXlk
 O7zttWXTftRhBBxz7MHFK9Jdh/rmwd0Q7kyvH9ciIXdW4TWlJGaomg7VkJCzMHSR
 sg1U5UAE5St57aYxNEsQ7gfOVklgC70KHl3Gj9PteZ9oiRlhQV8ejf7EVLEew+0u
 oplKFQxmSZgspY+gab1qtMIMVwNJhHlW7L2q3XiwLBqhjfJo7JvyMC79l41jZ9k7
 7ddf3+GtvmKubLpvGI+k2HGZuAre31IS8gSmwS1ipUjkC4sXWsTerdVxS/N2eHjw
 DB+RTvAOTUa/Q6JjgiS6pSLl9/XYLMjoEs8y4U+79OBqiDZp/raQbAMxXxkPS70U
 Rzu8x8ryBHci/S5wtPapxxn3Jjmqjya8EczRmZO7fjFmvXO4O9V7hH3UD4djKoDa
 NF+egjPGYgdoNmnprbipe6awWFdzYKd+culGCHHZ17XS9INGLPpDKw1ktCE9Ucny
 hohCEeLWQ13io+qSy4ekfZmDRweRqeFNm5L0s7SgHjRAhNEPY6BZuUWLros1QKdJ
 7Yv/HnHb6ySWqR12KQ9wYQFpBTzHotSQbX9oFRCLEXx+xLn3VTuOVtgG1sNu72BE
 q8x+SpBNNPpsrZgNk7S/
 =9CyV
 -----END PGP SIGNATURE-----

Merge tag 'linux-kselftest-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:
 "This update for Kselftest contains seccomp fixes"

* tag 'linux-kselftest-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftest/seccomp: Fix the seccomp(2) signature
  selftest/seccomp: Fix the flag name SECCOMP_FILTER_FLAG_TSYNC
2016-04-04 16:56:49 -07:00
Linus Torvalds 4c3b73c6a2 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
 "Misc kernel side fixes:

   - fix event leak
   - fix AMD PMU driver bug
   - fix core event handling bug
   - fix build bug on certain randconfigs

  Plus misc tooling fixes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/x86/amd/ibs: Fix pmu::stop() nesting
  perf/core: Don't leak event in the syscall error path
  perf/core: Fix time tracking bug with multiplexing
  perf jit: genelf makes assumptions about endian
  perf hists: Fix determination of a callchain node's childlessness
  perf tools: Add missing initialization of perf_sample.cpumode in synthesized samples
  perf tools: Fix build break on powerpc
  perf/x86: Move events_sysfs_show() outside CPU_SUP_INTEL
  perf bench: Fix detached tarball building due to missing 'perf bench memcpy' headers
  perf tests: Fix tarpkg build test error output redirection
2016-04-03 07:22:12 -05:00
Anton Blanchard 9f56c092b9 perf jit: genelf makes assumptions about endian
Commit 9b07e27f88 ("perf inject: Add jitdump mmap injection support")
incorrectly assumed that PowerPC is big endian only.

Simplify things by consolidating the define of GEN_ELF_ENDIAN and checking
for __BYTE_ORDER == __BIG_ENDIAN.

The PowerPC checks were also incorrect, they do not match what gcc
emits. We should first look for __powerpc64__, then __powerpc__.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Carl Love <cel@us.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Fixes: 9b07e27f88 ("perf inject: Add jitdump mmap injection support")
Link: http://lkml.kernel.org/r/20160329175944.33a211cc@kryten
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-30 18:12:06 -03:00
Andres Freund 9098903555 perf hists: Fix determination of a callchain node's childlessness
The 4b3a321223 ("perf hists browser: Support flat callchains") commit
over-aggressively tried to optimize callchain_node__init_have_children().

That lead to --tui mode not allowing to expand call chain elements if a
call chain element had only one parent. That's why --inverted callgraphs
looked halfway sane, but plain ones didn't.

Revert that individual optimization, it wasn't really related to the
rest of the commit.

Signed-off-by: Andres Freund <andres@anarazel.de>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixes: 4b3a321223 ("perf hists browser: Support flat callchains")
Link: http://lkml.kernel.org/r/20160330190245.GB13305@awork2.anarazel.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-30 18:08:39 -03:00
Sedat Dilek a189c017de tools/lib/lockdep: Fix unsupported 'basename -s' in run_tests.sh
Here on Ubuntu/precise I have GNU/coreutils v8.13 installed
where 'basename -s' is not supported.

The result is that run_tests.sh is not done properly.

How to reproduce:

  $ cd $BUILD_DIR
  $ LC_ALL=C make -C tools/ liblockdep
  $ cd tools/lib/lockdep/

    $ LC_ALL=C ./run_tests.sh
  basename: invalid option -- 's'
  Try `basename --help' for more information.
  ... timeout: failed to run command `./tests/': Permission denied
  FAILED!
  rm: cannot remove `tests/': Is a directory

Due to unsupported basename the tests programs are not generated
and cannot be removed.

Fix this by doing a compatible basename invocation and check for
the existence of generated tests programs.

For more details see this LKML thread:

  http://marc.info/?t=145906667300001&r=1&w=2

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sasha.levin@oracle.com> (maintainer:LIBLOCKDEP)
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Link: http://lkml.kernel.org/r/1459326169-7009-1-git-send-email-sedat.dilek@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-03-30 12:45:56 +02:00
Arnaldo Carvalho de Melo 3ea223adcb perf tools: Add missing initialization of perf_sample.cpumode in synthesized samples
In 473398a21d ("perf tools: Add cpumode to struct perf_sample"), I
missed some places where perf_sample fields are directly initialized in
addition to what is done in perf_evsel__parse_sample(), namely when
synthesizing PERF_RECORD_{MMAP*,COMM,FORK,EXIT} for pre-existing threads
and also in intel_pt and intel_bts when synthesizing events from
processor trace, the jitdump code also was affected, fix it.

The problem was noticed with running:

  # perf record -e intel_pt//u true
  # perf script

Where the samples wouldn't get resolved because perf_sample.cpumode
would be left as zero, i.e. PERF_RECORD_MISC_CPUMODE_UNKNOWN, not
resolving as kernel, hypervisor or user cpu modes.

Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 473398a21d ("perf tools: Add cpumode to struct perf_sample")
Link: http://lkml.kernel.org/n/tip-n5sdauxgk24d5nun8kuuu2mh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-29 20:03:56 -03:00
Mickaël Salaün 505ce68c6d selftest/seccomp: Fix the seccomp(2) signature
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Kees Cook <keescook@chromium.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Will Drewry <wad@chromium.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-03-29 13:01:36 -06:00
Mickaël Salaün 6c045d07bb selftest/seccomp: Fix the flag name SECCOMP_FILTER_FLAG_TSYNC
Rename SECCOMP_FLAG_FILTER_TSYNC to SECCOMP_FILTER_FLAG_TSYNC to match
the UAPI.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Kees Cook <keescook@chromium.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Will Drewry <wad@chromium.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-03-29 13:01:28 -06:00
Sukadev Bhattiprolu 379649cfea perf tools: Fix build break on powerpc
Commit 531d241063 ("perf tools: Do not include stringify.h from the
kernel sources") seems to have accidentially removed the inclusion of
"util/header.h" from "arch/powerpc/util/header.c".

"util/header.h" provides the prototype for get_cpuid() and is needed to
build perf on Powerpc:

	arch/powerpc/util/header.c:17:1: error: no previous prototype for 'get_cpuid' [-Werror=missing-prototypes]

Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 531d241063 ("perf tools: Do not include stringify.h from the kernel sources")
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
[ Included "util.h" too, to get the scnprintf() prototype ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-28 17:46:20 -03:00
Linus Torvalds 3fa2fe2ce0 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
 "This tree contains various perf fixes on the kernel side, plus three
  hw/event-enablement late additions:

   - Intel Memory Bandwidth Monitoring events and handling
   - the AMD Accumulated Power Mechanism reporting facility
   - more IOMMU events

  ... and a final round of perf tooling updates/fixes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (44 commits)
  perf llvm: Use strerror_r instead of the thread unsafe strerror one
  perf llvm: Use realpath to canonicalize paths
  perf tools: Unexport some methods unused outside strbuf.c
  perf probe: No need to use formatting strbuf method
  perf help: Use asprintf instead of adhoc equivalents
  perf tools: Remove unused perf_pathdup, xstrdup functions
  perf tools: Do not include stringify.h from the kernel sources
  tools include: Copy linux/stringify.h from the kernel
  tools lib traceevent: Remove redundant CPU output
  perf tools: Remove needless 'extern' from function prototypes
  perf tools: Simplify die() mechanism
  perf tools: Remove unused DIE_IF macro
  perf script: Remove lots of unused arguments
  perf thread: Rename perf_event__preprocess_sample_addr to thread__resolve
  perf machine: Rename perf_event__preprocess_sample to machine__resolve
  perf tools: Add cpumode to struct perf_sample
  perf tests: Forward the perf_sample in the dwarf unwind test
  perf tools: Remove misplaced __maybe_unused
  perf list: Fix documentation of :ppp
  perf bench numa: Fix assertion for nodes bitfield
  ...
2016-03-24 10:02:14 -07:00
Linus Torvalds d88f48e128 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar:
 "Misc fixes:

   - fix hotplug bugs
   - fix irq live lock
   - fix various topology handling bugs
   - fix APIC ACK ordering
   - fix PV iopl handling
   - fix speling
   - fix/tweak memcpy_mcsafe() return value
   - fix fbcon bug
   - remove stray prototypes"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/msr: Remove unused native_read_tscp()
  x86/apic: Remove declaration of unused hw_nmi_is_cpu_stuck
  x86/oprofile/nmi: Add missing hotplug FROZEN handling
  x86/hpet: Use proper mask to modify hotplug action
  x86/apic/uv: Fix the hotplug notifier
  x86/apb/timer: Use proper mask to modify hotplug action
  x86/topology: Use total_cpus not nr_cpu_ids for logical packages
  x86/topology: Fix Intel HT disable
  x86/topology: Fix logical package mapping
  x86/irq: Cure live lock in fixup_irqs()
  x86/tsc: Prevent NULL pointer deref in calibrate_delay_is_known()
  x86/apic: Fix suspicious RCU usage in smp_trace_call_function_interrupt()
  x86/iopl: Fix iopl capability check on Xen PV
  x86/iopl/64: Properly context-switch IOPL on Xen PV
  selftests/x86: Add an iopl test
  x86/mm, x86/mce: Fix return type/value for memcpy_mcsafe()
  x86/video: Don't assume all FB devices are PCI devices
  arch/x86/irq: Purge useless handler declarations from hw_irq.h
  x86: Fix misspellings in comments
2016-03-24 09:47:32 -07:00
Arnaldo Carvalho de Melo 6a1a77baa7 perf bench: Fix detached tarball building due to missing 'perf bench memcpy' headers
A change on kernel files included by the 'perf bench memcpy' code grew some new
include deps, breaking the detached tarball build:

  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
  tests/make:302: recipe for target 'tarpkg' failed
  make[1]: *** [tarpkg] Error 2
  Makefile:102: recipe for target 'build-test' failed
  make: *** [build-test] Error 2
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $ cat tools/perf/tarpkg
  ./tests/perf-targz-src-pkg .
    PERF_VERSION = 4.5.g05f5ec
    PERF_VERSION = 4.5.g05f5ec
  In file included from bench/mem-memcpy-x86-64-asm.S:9:0:
  bench/../../../arch/x86/lib/memcpy_64.S:5:29: fatal error: asm/cpufeatures.h: No such file or directory
  compilation terminated.
  mv: cannot stat ‘bench/.mem-memcpy-x86-64-asm.o.tmp’: No such file or directory
  make[5]: *** [bench/mem-memcpy-x86-64-asm.o] Error 1
  make[5]: *** Waiting for unfinished jobs....
  make[4]: *** [bench] Error 2
  make[4]: *** Waiting for unfinished jobs....
  make[3]: *** [perf-in.o] Error 2
  make[3]: *** Waiting for unfinished jobs....
  make[2]: *** [all] Error 2
  $

Add arch/*/include/asm/*features.h to tools/perf/MANIFEST so that we can
continue to use detached tarballs to build perf.

Now it builds ok, doing it manually:

  $ make help | grep perf
    perf-tar-src-pkg    - Build perf-4.5.0.tar source tarball
    perf-targz-src-pkg  - Build perf-4.5.0.tar.gz source tarball
    perf-tarbz2-src-pkg - Build perf-4.5.0.tar.bz2 source tarball
    perf-tarxz-src-pkg  - Build perf-4.5.0.tar.xz source tarball
  $ ls -la perf-4.5.0.tar
  ls: cannot access perf-4.5.0.tar: No such file or directory
  $ make perf-tar-src-pkg
    TAR
    PERF_VERSION = 4.5.g32c25b
  $ ls -la perf-4.5.0.tar
  -rw-rw-r--. 1 acme acme 6318080 Mar 24 11:52 perf-4.5.0.tar
  $ mv perf-4.5.0.tar /tmp
  $ cd /tmp
  $ tar xf perf-4.5.0.tar
  $ cd perf-4.5.0/tools/perf
  $ make > /dev/null
  PERF_VERSION = 4.5.g32c25b
  $ ls -la perf
  -rwxrwxr-x. 1 acme acme 14046416 Mar 24 11:53 perf
  $ ./perf --version
  perf version 4.5.g32c25b
  $ perf bench
  Usage:
	perf bench [<common options>] <collection> <benchmark> [<options>]

        # List of all available benchmark collections:

         sched: Scheduler and IPC benchmarks
           mem: Memory access benchmarks
          numa: NUMA scheduling and MM benchmarks
         futex: Futex stressing benchmarks
           all: All benchmarks

  $ perf bench mem

        # List of available benchmarks for collection 'mem':

        memcpy: Benchmark for memcpy() functions
        memset: Benchmark for memset() functions
           all: Run all memory access benchmarks

  $ perf bench mem memcpy
  # Running 'mem/memcpy' benchmark:
  # function 'default' (Default memcpy() provided by glibc)
  # Copying 1MB bytes ...

        15.024038 GB/sec
  # function 'x86-64-unrolled' (unrolled memcpy() in arch/x86/lib/memcpy_64.S)
  # Copying 1MB bytes ...

        17.438616 GB/sec
  # function 'x86-64-movsq' (movsq-based memcpy() in arch/x86/lib/memcpy_64.S)
  # Copying 1MB bytes ...

        25.040064 GB/sec
  # function 'x86-64-movsb' (movsb-based memcpy() in arch/x86/lib/memcpy_64.S)
  # Copying 1MB bytes ...

        25.040064 GB/sec
  $

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
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-2c2sncwffuabw58fj1pw86gu@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-24 12:28:57 -03:00
Arnaldo Carvalho de Melo cde88355f2 perf tests: Fix tarpkg build test error output redirection
So we need to trow away just stdout, leaving stderr to be caught by
the build tests infrastructure, so that we can see what went wrong
when the tarpkg build test fails:

  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
  tests/make:302: recipe for target 'tarpkg' failed
  make[1]: *** [tarpkg] Error 2
  Makefile:102: recipe for target 'build-test' failed
  make: *** [build-test] Error 2
  make: Leaving directory '/home/acme/git/linux/tools/perf'
  $ cat tools/perf/tarpkg
  ./tests/perf-targz-src-pkg .
    PERF_VERSION = 4.5.g05f5ec
    PERF_VERSION = 4.5.g05f5ec
  In file included from bench/mem-memcpy-x86-64-asm.S:9:0:
  bench/../../../arch/x86/lib/memcpy_64.S:5:29: fatal error: asm/cpufeatures.h: No such file or directory
  compilation terminated.
  mv: cannot stat ‘bench/.mem-memcpy-x86-64-asm.o.tmp’: No such file or directory
  make[5]: *** [bench/mem-memcpy-x86-64-asm.o] Error 1
  make[5]: *** Waiting for unfinished jobs....
  make[4]: *** [bench] Error 2
  make[4]: *** Waiting for unfinished jobs....
  make[3]: *** [perf-in.o] Error 2
  make[3]: *** Waiting for unfinished jobs....
  make[2]: *** [all] Error 2
  $

So the test flow is:

1. Run: 'make -C tools/perf build-test'

2. One of its tests failed, in this case, the 'tarpkg' one

3. Look at what went wrong, by looking at the output of that test, in
   tools/perf/tarpkg

Admittedly, this should be shortcircuited to showing what went wrong directly
from the 'make build-test' step, but lets first fix this tarpkg one and the
problem it spotted, which should be fixed by adding some extra file to the
tools/perf/MANIFEST so that detached tarballs continue being self contained and
build successfully.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
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-ynld6egoxolmftcddpnd7oh6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-24 12:26:41 -03:00
Ingo Molnar 05f5ece76a perf/core improvements and fixes:
User visible:
 
 - Fix documentation of :ppp modifier in 'perf list' (Andi Kleen)
 
 - Fix silly nodes bitfield bits/bytes length assertion in 'perf bench numa' (Jakub Jelen)
 
 - Remove redundant CPU output in libtraceevent (Steven Rostedt)
 
 - Remove 'core_id' check in topology 'perf test' (Sukadev Bhattiprolu)
 
 Infrastructure:
 
 - Record text offset in dso to calculate objdump address, to use with
   modules in addition to vDSO symbol address calculations (Wang Nan)
 
 - Move utilities.mak from perf to tools/scripts/ (Arnaldo Carvalho de Melo)
 
 - Add cpumode to the perf_sample struct, this way we don't need to pass
   the union event to the machine and thread resolving routines, shortening
   function signatures and allowing the future introduction of a way
   to use tracepoint events instead of the unavailable HW cycles counter on
   powerpc guests in perf kvm by just hooking on perf_evsel__parse_sample,
   at the end (Arnaldo Carvalho de Melo)
 
 - Remove/unexport die() related infrastructure, that at some point will
   finally be removed (Arnaldo Carvalho de Melo)
 
 - Adopt linux/stringify.h from the kernel sources, not to touch this
   kernel header from tools/ (Arnaldo Carvalho de Melo)
 
 - Stop using strbuf for things we can instead trivially use libc's asprintf()
   (Arnaldo Carvalho de Melo)
 
 - Ditch tools/lib/util/abspath.c, its only exported function was used at just
   one place and can be replaced by libc's realpath() (Arnaldo Carvalho de Melo)
 
 - Use strerror_r() in the llvm infrastructure, tread safe, its what is used
   elsewhere in tools/perf/ (Arnaldo Carvalho de Melo)
 
 Cleanups:
 
 - Removed misplaced or needless __maybe_unused/export (Arnaldo Carvalho de Melo)
 
 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJW8wWeAAoJENZQFvNTUqpAF9YP/iXdYDnav5mr8yRt1Vu88F0j
 rmnO0E6zHzH5PcEoMuSPYEea1IPKZcV2KyVWFsfzkbfZrsC05AkGOrHAs7v0jCyz
 93p0/sH92Vy7ZTvE2slQJGKm2fgo3veV3ExEZDqdT5NNlzrIHVGshNYTma0wuduM
 NMdCdZe99KUuJFjqaUP9YCTr9VWF30Vu/AAOTUY7Xg6j7ZuJ47HchNxbOvCOp430
 LtirOKRBmVyY8BOoKSDDyaZOOPz18k58z8bKVO2eQNN9wf6ZGjWIN5DpjBs9pdJa
 W4zhFbHxU272IZXVv8/K2hV1qenov4Ghn5i0oApBjaRGta6dBFhGmYk0zIATcpGV
 wkuB6OrQTGYnBcNCI9z/kyxdt7Km0X2ffruvFLPviz4d7Sa2W0Gmj2+4JgXaLipp
 Q/0H/iWcT1kv+SXT9yjWe2+QxgwbJlUJ96+aGEvqDQH23Hifxjx4wezNR98kK/s7
 8IGxJEIOMmRocXeDeEZ8sKwqqan34IDrXKs2jMQSOonVVhR+dmvZicqSNwMTvMTn
 Sz36bsaKkWQtM3d97byx6EHDJn6aPEQlbY/YR6DqKgKmeFTQgs1lDvUp7SVUu1qp
 HwSDN7FgWbXAJVfxeoe0qBSZY9px+dCCh+qZmNN+TtD84IBgzrJpaSf6hzQ6FIie
 yTfVHvvkyUDep1KquQz9
 =f41L
 -----END PGP SIGNATURE-----

Merge tag 'perf-core-for-mingo-20160323' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/core improvements and fixes:

User visible fixes:

 - Fix documentation of :ppp modifier in 'perf list' (Andi Kleen)

 - Fix silly nodes bitfield bits/bytes length assertion in 'perf bench numa' (Jakub Jelen)

 - Remove redundant CPU output in libtraceevent (Steven Rostedt)

 - Remove 'core_id' check in topology 'perf test' (Sukadev Bhattiprolu)

Infrastructure changes/fixes:

 - Record text offset in dso to calculate objdump address, to use with
   modules in addition to vDSO symbol address calculations (Wang Nan)

 - Move utilities.mak from perf to tools/scripts/ (Arnaldo Carvalho de Melo)

 - Add cpumode to the perf_sample struct, this way we don't need to pass
   the union event to the machine and thread resolving routines, shortening
   function signatures and allowing the future introduction of a way
   to use tracepoint events instead of the unavailable HW cycles counter on
   powerpc guests in perf kvm by just hooking on perf_evsel__parse_sample,
   at the end (Arnaldo Carvalho de Melo)

 - Remove/unexport die() related infrastructure, that at some point will
   finally be removed (Arnaldo Carvalho de Melo)

 - Adopt linux/stringify.h from the kernel sources, not to touch this
   kernel header from tools/ (Arnaldo Carvalho de Melo)

 - Stop using strbuf for things we can instead trivially use libc's asprintf()
   (Arnaldo Carvalho de Melo)

 - Ditch tools/lib/util/abspath.c, its only exported function was used at just
   one place and can be replaced by libc's realpath() (Arnaldo Carvalho de Melo)

 - Use strerror_r() in the llvm infrastructure, tread safe, its what is used
   elsewhere in tools/perf/ (Arnaldo Carvalho de Melo)

Cleanups:

 - Removed misplaced or needless __maybe_unused/export (Arnaldo Carvalho de Melo)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-03-24 08:30:25 +01:00
Arnaldo Carvalho de Melo 76267147f2 perf llvm: Use strerror_r instead of the thread unsafe strerror one
Cc: Adrian Hunter <adrian.hunter@intel.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-5njrq9dltckgm624omw9ljgu@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 17:42:21 -03:00
Arnaldo Carvalho de Melo 78478269d2 perf llvm: Use realpath to canonicalize paths
To kill the last user of make_nonrelative_path(), that gets ditched,
one more panicking function killed.

Cc: Adrian Hunter <adrian.hunter@intel.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-3hu56rvyh4q5gxogovb6ko8a@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 17:39:19 -03:00
Arnaldo Carvalho de Melo 0741208a7c perf tools: Unexport some methods unused outside strbuf.c
Cc: Adrian Hunter <adrian.hunter@intel.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-nq1wvtky4mpu0nupjyar7sbw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 17:09:53 -03:00
Arnaldo Carvalho de Melo 88fd633cdf perf probe: No need to use formatting strbuf method
We have addch() for chars, add() for fixed size data, and addstr() for
variable length strings, use them.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-0ap02fn2xtvpduj2j6b2o1j4@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 16:53:05 -03:00
Arnaldo Carvalho de Melo a610f5cbb2 perf help: Use asprintf instead of adhoc equivalents
That doesn't chekcs malloc return and that, when using strbuf, if it
can't grow, just explodes away via die().

Cc: Adrian Hunter <adrian.hunter@intel.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-vr8qsjbwub7e892hpa9msz95@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 16:36:07 -03:00
Arnaldo Carvalho de Melo cf47a8aede perf tools: Remove unused perf_pathdup, xstrdup functions
Cc: Adrian Hunter <adrian.hunter@intel.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-s87zi5d03m6rz622y1z6rlsa@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 15:27:33 -03:00
Arnaldo Carvalho de Melo 531d241063 perf tools: Do not include stringify.h from the kernel sources
Use instead the copy just made to tools/include/linux/.

Cc: Adrian Hunter <adrian.hunter@intel.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-q736w12nwy98x5ox2hamp5ow@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 15:21:15 -03:00
Arnaldo Carvalho de Melo 737ef7d32c tools include: Copy linux/stringify.h from the kernel
There is code in tools/ that is directly including this file from the
kernel, and this is verboten for a while, copy it so that the next csets
can fix this situation.

Cc: Adrian Hunter <adrian.hunter@intel.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-e0r3nks2uai020ndghvxv5qw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 15:14:27 -03:00
Steven Rostedt 4f3c887688 tools lib traceevent: Remove redundant CPU output
Commit a674533078 ("tools lib traceevent: Split pevent_print_event()
into specific functionality functions") broke apart the function
pevent_print_event() into three functions.

The first function prints the comm, pid and CPU, the second prints the
timestamp.

But that commit added the printing of the CPU in the timestamp function,
which now causes pevent_print_event() to duplicate the CPU output.

Remove the redundant printing of the record's CPU from the timestamp
function.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Fixes: a674533078 ("tools lib traceevent: Split pevent_print_event() into specific functionality functions")
Link: http://lkml.kernel.org/r/20160323101628.459375d2@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 15:08:12 -03:00
Arnaldo Carvalho de Melo 3938bad44e perf tools: Remove needless 'extern' from function prototypes
Cc: Adrian Hunter <adrian.hunter@intel.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-w246stf7ponfamclsai6b9zo@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 15:06:35 -03:00
Arnaldo Carvalho de Melo e476343860 perf tools: Simplify die() mechanism
This should die altogether, but for now lets remove a bit of this stuff,
as it is not used at all.

Cc: Adrian Hunter <adrian.hunter@intel.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-ade3n99xscldhg5mx2vzd8p3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 12:32:31 -03:00
Arnaldo Carvalho de Melo 236f71eb94 perf tools: Remove unused DIE_IF macro
Cc: Adrian Hunter <adrian.hunter@intel.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-elxg25jd4dhwod4wqbko87qh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 12:30:42 -03:00
Arnaldo Carvalho de Melo a3dff304ca perf script: Remove lots of unused arguments
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>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 12:11:03 -03:00
Arnaldo Carvalho de Melo c2740a87ca perf thread: Rename perf_event__preprocess_sample_addr to thread__resolve
Since none of the perf_event fields are used anymore, just the
perf_sample ones, and since this resolves to (map, symbol) from data
structures within struct thread, rename it to thread__resolve and make
the argument ordering similar to the one in machine__resolve().

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-2b33hs9bp550tezzlhl4kejh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 12:03:08 -03:00
Arnaldo Carvalho de Melo bb3eb56622 perf machine: Rename perf_event__preprocess_sample to machine__resolve
Since we only deal with fields in the passed struct perf_sample move
this method to struct machine, that is where the perf_sample fields
will be resolved to a struct addr_location, i.e. thread, map, symbol,
etc.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-a1ww2lbm2vbuqsv4p7ilubu9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 12:03:08 -03:00
Arnaldo Carvalho de Melo 473398a21d perf tools: Add cpumode to struct perf_sample
To avoid parsing event->header.misc in many locations.

This will also allow setting perf.sample.{ip,cpumode} in a single place,
from tracepoint fields, as needed by 'perf kvm' with PPC guests, where
the guest hardware counters is not available at the host.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-qp3yradhyt6q3wl895b1aat0@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-03-23 12:03:07 -03:00