Add linux-tools-<version> package containing the perf tool (Closes: #548715)

svn path=/dists/sid/linux-2.6/; revision=15932
This commit is contained in:
Ben Hutchings 2010-07-04 17:08:13 +00:00
parent b50f02593b
commit 97238c15a8
7 changed files with 80 additions and 4 deletions

11
debian/bin/perf vendored Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# Execute the right version of perf for the current kernel.
version="$(uname -r)"
version="${version%%-*}"
shopt -s execfail
exec "perf_$version" "$@"
# Not found? Tell the user which package to install.
echo >&2 "E: linux-tools-$version is not installed."
exit 1

2
debian/changelog vendored
View File

@ -56,6 +56,8 @@ linux-2.6 (2.6.32-16) UNRELEASED; urgency=low
not called wlan0 (Closes: #582972)
- Correct device ID table (Closes: #584945, #587985)
* Add r8192u_usb driver
* Add linux-tools-<version> package containing the perf tool
(Closes: #548715)
[ Aurelien Jarno ]
* [sh4] fix sh_tmu clocksource following recent nohz changes.

19
debian/perf.1 vendored Normal file
View File

@ -0,0 +1,19 @@
.TH PERF 1 "4 July 2010"
.SH NAME
perf \- performance analysis tools for Linux
.SH SYNOPSIS
.HP
\fBperf\fR [\fB\-\-version\fR] [\fB\-\-help\fR] \fICOMMAND\fR [\fIARGS\fR]
.SH DESCRIPTION
.LP
Performance counters for Linux are are a new kernel\-based subsystem
that provide a framework for all things performance analysis. It
covers hardware level (CPU/PMU, Performance Monitoring Unit) features
and software features (software counters, tracepoints) as well.
.LP
Each version of the perf tools may depend on new kernel features, so
you must install a different version for each kernel version. The
\fBperf\fR command will automatically run the correct version for the
running kernel version.
.SH SEE ALSO
perf_\fIversion\fR(1)

2
debian/rules vendored
View File

@ -56,7 +56,7 @@ maintainerclean:
clean: debian/control
dh_testdir
rm -rf $(BUILD_DIR) $(STAMPS_DIR) debian/lib/python/debian_linux/*.pyc debian/linux-headers-* debian/linux-image-*
rm -rf $(BUILD_DIR) $(STAMPS_DIR) debian/lib/python/debian_linux/*.pyc debian/linux-headers-* debian/linux-image-* debian/linux-tools-*
dh_clean
binary-indep: $(STAMPS_DIR)/source-base

34
debian/rules.real vendored
View File

@ -32,12 +32,14 @@ setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTION_UPLOADER=$(UPLOADER) DIS
MAKE_CLEAN = $(setup_env) $(MAKE)
MAKE_SELF := $(MAKE) -f debian/rules.real $(MAKEOVERRIDES)
MAKEOVERRIDES =
MAKE_PERF_VARS = prefix=/usr NO_PERL=1 MBITS=
#
# Targets
#
binary-arch-arch: install-headers_$(ARCH)
binary-arch-arch: install-libc-dev_$(ARCH)
binary-arch-arch: install-tools_$(ARCH)
binary-arch-featureset: install-headers_$(ARCH)_$(FEATURESET)
binary-arch-flavour: install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
ifeq ($(DEBUG),True)
@ -133,6 +135,14 @@ $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen:
python debian/bin/buildcheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
@$(stamp)
$(STAMPS_DIR)/build-tools_$(ARCH): SOURCE_DIR=$(BUILD_DIR)/source
$(STAMPS_DIR)/build-tools_$(ARCH): DIR=$(BUILD_DIR)/build-tools_$(ARCH)
$(STAMPS_DIR)/build-tools_$(ARCH): $(STAMPS_DIR)/source
rm -rf $(DIR)
cp -al $(SOURCE_DIR) $(DIR)
+$(MAKE_CLEAN) -C '$(DIR)/tools/perf' $(JOBS_ARG) $(MAKE_PERF_VARS) all man
@$(stamp)
$(STAMPS_DIR)/build-doc: SOURCE_DIR=$(BUILD_DIR)/source
$(STAMPS_DIR)/build-doc: DIR=$(BUILD_DIR)/build-doc
$(STAMPS_DIR)/build-doc: $(STAMPS_DIR)/source
@ -468,6 +478,27 @@ ifeq ($(MODULES),True)
endif
+$(MAKE_SELF) install-base BUILDDEB_ARGS="-Zbzip2"
install-tools_$(ARCH): PACKAGE_NAME = linux-tools-$(UPSTREAMVERSION)
install-tools_$(ARCH): PACKAGE_DIR = debian/$(PACKAGE_NAME)
install-tools_$(ARCH): DIR = $(BUILD_DIR)/build-tools_$(ARCH)
install-tools_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
install-tools_$(ARCH): $(STAMPS_DIR)/build-tools_$(ARCH)
dh_testdir
dh_testroot
dh_prep
dh_installdirs usr/bin
+$(MAKE_CLEAN) -C '$(DIR)/tools/perf' $(MAKE_PERF_VARS) \
DESTDIR='$(CURDIR)/$(PACKAGE_DIR)' install install-man
# Rename command and manual pages to include version
mv $(PACKAGE_DIR)/usr/bin/perf $(PACKAGE_DIR)/usr/bin/perf_$(UPSTREAMVERSION)
for manpage in $(PACKAGE_DIR)/usr/share/man/*/*; do \
mv "$$manpage" "$$(echo "$$manpage" | sed 's,/perf,&_$(UPSTREAMVERSION),')" || exit; \
done
# Fix up cross-references
sed -i '/^\.SH "SEE ALSO"/,/^\.SH/ { s/perf-/perf_$(UPSTREAMVERSION)-/g }' \
$(PACKAGE_DIR)/usr/share/man/*/*
+$(MAKE_SELF) install-base
install-patch: PACKAGE = linux-patch-debian-$(VERSION)
install-patch: pbase := /usr/src/kernel-patches/all/$(UPSTREAMVERSION)
install-patch: pfull := debian/$(PACKAGE)$(pbase)
@ -510,7 +541,8 @@ install-linux-base:
dh_testdir
dh_testroot
dh_prep
dh_install -X.svn
dh_install debian/bin/perf /usr/bin
dh_installman debian/perf.1
dh_installdebconf
+$(MAKE_SELF) install-base

View File

@ -1,3 +1,15 @@
Package: linux-tools-@version@
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: linux-base (>= 2.6.32-16)
Suggests: linux-doc-@version@
Description: Performance analysis tools for Linux @upstreamversion@
This package contains the 'perf' performance analysis tools for Linux
kernel version @upstreamversion@.
.
The linux-base package contains a 'perf' command which will invoke the
appropriate version for the running kernel.
Package: linux-source-@version@
Architecture: all
Section: kernel

View File

@ -3,7 +3,7 @@ Priority: optional
Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
Uploaders: Bastian Blank <waldi@debian.org>, Frederik Schüler <fs@debian.org>, maximilian attems <maks@debian.org>, Ben Hutchings <ben@decadent.org.uk>
Standards-Version: 3.8.4
Build-Depends: debhelper (>> 7), cpio, module-init-tools, python, lzma [armel]
Build-Depends-Indep: bzip2, python-support, xmlto
Build-Depends: debhelper (>> 7), cpio, module-init-tools, python, lzma [armel], libelf-dev, asciidoc, xmlto
Build-Depends-Indep: bzip2, python-support
Vcs-Svn: svn://svn.debian.org/svn/kernel/dists/sid/linux-2.6/
Vcs-Browser: http://svn.debian.org/wsvn/kernel/dists/sid/linux-2.6/?op=log