perf doesn't work on -pae-kernels [patch proposal]

Bug #555130 reported by Ulrik Mikaelsson
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Low
Andy Whitcroft
Lucid
Fix Released
Low
Unassigned
Maverick
Fix Released
Low
Andy Whitcroft

Bug Description

SRU Justification

Justification: by default the perf command will not work correctly on any flavour which contains a - in its name

Impact: unable to use the perf command to debug applications when using generic-paeetc

Fix Description: change flavour removal to work with all flavours through use of the known shape version number

Patch: http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-lucid.git;a=commit;h=6ec3efb32496eafa8be998507d26f7ffbe0747c4

Risks: low, this only changes the perf wrapper which has been tested with all known flavours

TEST CASE: attempt to use perf on a generic-pae install note it fails, install patch, note it now works as expected

===

Binary package hint: linux-tools-common

linux-tools-common contains a small redirection-script (/usr/bin/perf), for dispatching to the perf-version corresponding to the running kernel.

This script uses basically ${`uname -r`%-*} to figure the running kernel version, where %-* strips the last dash-delimited component of the kernel name. This breaks for -generic-pae.

Examples of uname "-r":
2.6.32-19-generic # Works today
2.6.32-19-generic-pae # Breaks, since the TWO last components needs to be stripped.

A proposed solution could be to instead use "%%-[a-z-]*", which would remove ALL trailing letters, and dashes, up to the last digit in the string (the package-release-number).

However, since I don't know kernel-release names for other architectures, it needs to be verified first.

Suggested new perf, change only on line 3
----------------
#!/bin/bash
version=`uname -r`
version=${version%%-[a-z-]*}
exec "perf_$version" "$@"

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

Would you mind attaching your fix in patch form? Thanks in advance.

Revision history for this message
Ulrik Mikaelsson (rawler) wrote :

Couldn't figure how to build a debdiff, but here's a regular patch to the file, from within the package sources.

Revision history for this message
Andy Whitcroft (apw) wrote :
  • X Edit (1.3 KiB, text/plain)

@Ulrik -- that will do the right thing for all of our flavours except for -386. We have had some other patches for this proposed on kernel-team@ and the patch below has been committed.

Changed in linux (Ubuntu):
importance: Undecided → Low
assignee: nobody → Andy Whitcroft (apw)
status: New → Fix Committed
Andy Whitcroft (apw)
description: updated
Stefan Bader (smb)
Changed in linux (Ubuntu Lucid):
importance: Undecided → Low
status: New → Fix Committed
Martin Pitt (pitti)
Changed in linux (Ubuntu Maverick):
milestone: none → maverick-alpha-2
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted linux into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Andy Whitcroft (apw)
Changed in linux (Ubuntu Maverick):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (25.2 KiB)

This bug was fixed in the package linux - 2.6.32-23.37

---------------
linux (2.6.32-23.37) lucid-proposed; urgency=low

  [ Alex Deucher ]

  * SAUCE: drm/radeon/kms/atom: fix dual-link DVI on DCE3.2/4.0
    - LP: #564559

  [ Andy Whitcroft ]

  * [Config] ports -- build in dm-mod to enable LVM boot
    - LP: #560717
  * tools -- fix perf version extraction for multi-part flavours
    - LP: #555130
  * SAUCE: ACPI: EC: Allow multibyte access to EC (v3)
    - LP: #526354
  * [Config] enforce -- ensure dm_mod is built-in for LVM
    - LP: #560717
  * update to ubuntu-debian:7e708d33054c373faf41da23b73e8b48c342d958
    - LP: #570500, #576274

  [ Chase Douglas ]

  * Revert "(pre-stable): input: ALPS - Add signature for HP Pavilion dm3
    laptops"
    - LP: #550625
  * Enable ftrace function profiler
    - LP: #570389
  * enforce CONFIG_TMPFS_POSIX_ACL=y
    - LP: #575940

  [ Leann Ogasawara ]

  * Revert "staging/comdi -- disable"
    - LP: #563436
  * [Config] Enable multicast routing for sparc
    - LP: #416266
  * [Config] Add ahci.ko to virtual sub-flavour
    - LP: #570542

  [ Stefan Bader ]

  * Revert "SAUCE: drm/i915: Disable FBC on 915GM and 945GM"
    - LP: #588832

  [ Tim Gardner ]

  * ubuntu: rtl8192se -- update to version 0015.0127.2010
    - LP: #567016
  * [Config] Add atl1c to nic-modules udeb
    - LP: #557130

  [ Upstream Kernel Changes ]

  * Revert "(pre-stable) iwlwifi: fix nfreed--"
    - LP: #575853
  * Revert "backlight: mbp_nvidia_bl - add five more MacBook variants"
    - LP: #575853
  * Revert "(pre-stable) pata_via: Add VIA VX900 support"
    - LP: #575853
  * Revert "(pre-stable) x86-32, resume: do a global tlb flush in S4
    resume"
    - LP: #575853
  * Revert "x86: disable IOMMUs on kernel crash"
    - LP: #575853
  * Revert "sunrpc: fix peername failed on closed listener"
    - LP: #575853
  * Revert "sunrpc: move the close processing after do recvfrom method"
    - LP: #575853
  * Revert "(pre-stable) drm/edid: allow certain bogus edids to hit a fixup
    path rather than fail"
    - LP: #575853
  * Revert "drm/radeon/kms: don't print error on -ERESTARTSYS."
    - LP: #575853
  * Revert "ath9k: fix lockdep warning when unloading module" on stable
    kernels
    - LP: #588832
  * Staging: comedi: removed "depricated" from COMEDI_CB_BLOCK
    - LP: #483343
  * fat: fix buffer overflow in vfat_create_shortname()
    - LP: #575853
  * xfs: simplify inode teardown
    - LP: #575853
  * xfs: fix mmap_sem/iolock inversion in xfs_free_eofblocks
    - LP: #575853
  * xfs: I/O completion handlers must use NOFS allocations
    - LP: #575853
  * xfs: Wrapped journal record corruption on read at recovery
    - LP: #575853
  * xfs: Fix error return for fallocate() on XFS
    - LP: #575853
  * xfs: check for not fully initialized inodes in xfs_ireclaim
    - LP: #575853
  * xfs: fix timestamp handling in xfs_setattr
    - LP: #575853
  * xfs: Don't flush stale inodes
    - LP: #575853
  * xfs: Ensure we force all busy extents in range to disk
    - LP: #575853
  * xfs: reclaim inodes under a write lock
    - LP: #575853
  * xfs: Avoid inodes in reclaim when flushing from inode cache
    - LP: #575853
  * xfs: recla...

Changed in linux (Ubuntu Lucid):
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