'perf record' fails with "Perf session creation failed"

Bug #1375441 reported by bugproxy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Tim Gardner
Utopic
Fix Released
Undecided
Tim Gardner

Bug Description

---Problem Description---
When run as normal user, 'perf record ls' fails with:

  Perf session creation failed.

The command runs successfully when run as root.

---uname output---
Linux ubuntu 3.16.0-16-generic #22-Ubuntu SMP Wed Sep 17 18:45:43 UTC 2014 ppc64le ppc64le ppc64le GNU/Linux

Machine Type = POWER8E pvr 004b 0201

> Maynard,
>
> Can you check if /proc/sys/kernel/kptr_restrict has 1 in it on your
> system ?

Yes, the value is '1'.

>
> On my system it does have 1 and I can repro. Following seems to
> fix:
> echo 0 > /proc/sys/kernel/kptr_restrict

Yes, changing it to '0' does "fix" it, although that shouldn't be necessary, as you know. So something is broken.

I am able to repro with 3.17.0-rc4 based mainline perf tool.

I suspect that the change in behavior was introduced unintentionally by
this upstream commit. machine__create_kernel_maps() now calls
 machine__get_kernel_start_addr() which checks the kptr_restrict state.

---

commit a93f0e551af9e194db38bfe16001e17a3a1d189a
Author: Simon Que <email address hidden>
Date: Mon Jun 16 11:32:09 2014 -0700

    perf symbols: Get kernel start address by symbol name

This is being fixed by a recent upstream commit:

    https://lkml.org/lkml/2014/9/27/26

Will Ubuntu pick that fix up automatically ?

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-116381 severity-medium targetmilestone-inin---
Luciano Chavez (lnx1138)
affects: ubuntu → linux (Ubuntu)
Changed in linux (Ubuntu):
status: New → Confirmed
bugproxy (bugproxy)
tags: added: targetmilestone-inin1410
removed: targetmilestone-inin---
tags: added: kernel-da-key
Revision history for this message
Tim Gardner (timg-tpi) wrote :

I applied http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/patch/?id=a5c2a4c9561cbbd374231bd341936dae716df9dd for now. If this had been marked for stable it would likely have trickled down automatically.

Changed in linux (Ubuntu Utopic):
assignee: nobody → Tim Gardner (timg-tpi)
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.16.0-20.27

---------------
linux (3.16.0-20.27) utopic; urgency=low

  [ Tim Gardner ]

  * [Config] CONFIG_CXL=m
  * Release Tracking Bug
    - LP: #1376354

  [ Andi Kleen ]

  * SAUCE: perf tools: Fix perf record as non root with kptr_restrict == 1
    - LP: #1375441

  [ Chris J Arges ]

  * SAUCE: Revert "sd: don't use scsi_setup_blk_pc_cmnd for flush requests"
    - LP: #1375452

  [ Ian Munsie ]

  * SAUCE: (no-up) powerpc/cell: Move spu_handle_mm_fault() out of cell platform
  * SAUCE: (no-up) powerpc/cell: Move data segment faulting code out of cell platform
  * SAUCE: (no-up) powerpc/msi: Improve IRQ bitmap allocator
  * SAUCE: (no-up) powerpc/mm: Export mmu_kernel_ssize and mmu_linear_psize
  * SAUCE: (no-up) powerpc/powernv: Split out set MSI IRQ chip code
  * SAUCE: (no-up) cxl: Add new header for call backs and structs
  * SAUCE: (no-up) powerpc/powerpc: Add new PCIe functions for allocating cxl interrupts
  * SAUCE: (no-up) powerpc/mm: Add new hash_page_mm()
  * SAUCE: (no-up) powerpc/opal: Add PHB to cxl mode call
  * SAUCE: (no-up) powerpc/mm: Add hooks for cxl
  * SAUCE: (no-up) cxl: Add base builtin support
  * SAUCE: (no-up) cxl: Driver code for powernv PCIe based cards for userspace access
  * SAUCE: (no-up) cxl: Userspace header file.
  * SAUCE: (no-up) cxl: Add driver to Kbuild and Makefiles
  * SAUCE: (no-up) cxl: Add documentation for userspace APIs
 -- Tim Gardner <email address hidden> Tue, 30 Sep 2014 13:05:27 -0600

Changed in linux (Ubuntu Utopic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.