From 8e5564e6c7554902301543e731354ad2ad58ae53 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 31 May 2010 11:13:21 -0300 Subject: perf tools: Make target to generate self contained source tarball MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Useful for when people want to try some version of the perf tools and don't wants to download the kernel tarball. Here is a session using this new target: [root@emilia linux-2.6-tip]# make help | grep -i perf perf-tar-src-pkg - Build perf-2.6.35-rc1.tar source tarball perf-targz-src-pkg - Build perf-2.6.35-rc1.tar.gz source tarball perf-tarbz2-src-pkg - Build perf-2.6.35-rc1.tar.bz2 source tarball [root@emilia linux-2.6-tip]# make perf-tarbz2-src-pkg TAR [root@emilia linux-2.6-tip]# ls -la perf-2.6.35-rc1.tar.bz2 -rw-r--r-- 1 root root 295731 May 31 11:18 perf-2.6.35-rc1.tar.bz2 [root@emilia linux-2.6-tip]# tar xf perf-2.6.35-rc1.tar.bz2 [root@emilia linux-2.6-tip]# cd perf-2.6.35-rc1 [root@emilia perf-2.6.35-rc1]# ls arch HEAD include lib tools [root@emilia perf-2.6.35-rc1]# cd tools/perf [root@emilia perf]# make -j9 2>&1 | tail CC arch/x86/util/dwarf-regs.o CC util/probe-finder.o CC util/newt.o CC util/scripting-engines/trace-event-perl.o CC scripts/perl/Perf-Trace-Util/Context.o CC perf.o CC builtin-help.o AR libperf.a LINK perf rm .perf.dev.null [root@emilia perf]# ./perf record -a sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.262 MB perf.data (~11457 samples) ] [root@emilia perf]# ./perf report | head -12 # Events: 6K cycles # # Overhead Command Shared Object Symbol # ........ ............... .................. ...... # 4.73% perf [kernel.kallsyms] [k] format_decode 4.49% perf libc-2.12.so [.] _IO_file_underflow_internal 4.38% init [kernel.kallsyms] [k] mwait_idle 3.29% perf [kernel.kallsyms] [k] vsnprintf 2.38% init [kernel.kallsyms] [k] sched_clock_local 2.35% init [kernel.kallsyms] [k] apic_timer_interrupt 1.86% sirq-timer/5 [kernel.kallsyms] [k] find_busiest_group [root@emilia perf]# Acked-by: Michal Marek Acked-by: Sam Ravnborg Cc: David S. Miller Cc: Frédéric Weisbecker Cc: Ingo Molnar Cc: Michal Marek Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Sam Ravnborg Cc: Stephane Eranian Cc: Tom Zanussi LKML-Reference: <20100528185357.GA28009@ghostprotocols.net> Signed-off-by: Arnaldo Carvalho de Melo --- scripts/package/Makefile | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 62fcc3a7f4d3..18513b0191db 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -111,13 +111,38 @@ tar%pkg: FORCE clean-dirs += $(objtree)/tar-install/ +# perf-pkg - generate a source tarball with perf source +# --------------------------------------------------------------------------- + +perf-tar=perf-$(KERNELVERSION) + +quiet_cmd_perf_tar = TAR + cmd_perf_tar = \ +git archive --prefix=$(perf-tar)/ HEAD^{tree} \ + $$(cat $(srctree)/tools/perf/MANIFEST) -o $(perf-tar).tar; \ +mkdir -p $(perf-tar); \ +git rev-parse HEAD > $(perf-tar)/HEAD; \ +tar rf $(perf-tar).tar $(perf-tar)/HEAD; \ +rm -r $(perf-tar); \ +$(if $(findstring tar-src,$@),, \ +$(if $(findstring bz2,$@),bzip2, \ +$(if $(findstring gz,$@),gzip, \ +$(error unknown target $@))) \ + -f -9 $(perf-tar).tar) + +perf-%pkg: FORCE + $(call cmd,perf_tar) + # Help text displayed when executing 'make help' # --------------------------------------------------------------------------- help: FORCE - @echo ' rpm-pkg - Build both source and binary RPM kernel packages' - @echo ' binrpm-pkg - Build only the binary kernel package' - @echo ' deb-pkg - Build the kernel as an deb package' - @echo ' tar-pkg - Build the kernel as an uncompressed tarball' - @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' - @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' + @echo ' rpm-pkg - Build both source and binary RPM kernel packages' + @echo ' binrpm-pkg - Build only the binary kernel package' + @echo ' deb-pkg - Build the kernel as an deb package' + @echo ' tar-pkg - Build the kernel as an uncompressed tarball' + @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' + @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' + @echo ' perf-tar-src-pkg - Build $(perf-tar).tar source tarball' + @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball' + @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball' -- cgit v1.2.3 From a484e54fae891703cbe1c9ec1b536605f11f5482 Mon Sep 17 00:00:00 2001 From: David Daney Date: Fri, 9 Jul 2010 14:52:05 -0700 Subject: tracing: Fix $mcount_regex for MIPS in recordmcount.pl I found this issue in a locally patched 2.6.32.x, current kernels have moved the offending code to an __init function which is skipped by recordmcount.pl, so the bug is not currently being exercised. However, I think the patch is still a good idea, to avoid future problems if _mcount were to ever have its address taken in normal code. This is what I originally saw: Although arch/mips/kernel/ftrace.c is built without -pg, and thus contains no calls to _mcount, it does use the address of _mcount in ftrace_make_nop(). This was causing relocations to be emitted for _mcount which recordmcount.pl erronously took to be _mcount call sites. The result was that the text of ftrace_make_nop() would be patched with garbage leading to a system crash. In non-module code, all _mcount call sites will have R_MIPS_26 relocations, so we restrict $mcount_regex to only match on these. Acked-by: Ralf Baechle Acked-by: Wu Zhangjin Signed-off-by: David Daney LKML-Reference: <1278712325-12050-1-git-send-email-ddaney@caviumnetworks.com> Cc: Li Hong Cc: Ingo Molnar Cc: Matt Fleming Signed-off-by: Steven Rostedt --- scripts/recordmcount.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index f3c9c0a90b98..0171060b5fd6 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -326,7 +326,7 @@ if ($arch eq "x86_64") { # 14: R_MIPS_NONE *ABS* # 18: 00020021 nop if ($is_module eq "0") { - $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$"; + $mcount_regex = "^\\s*([0-9a-fA-F]+): R_MIPS_26\\s+_mcount\$"; } else { $mcount_regex = "^\\s*([0-9a-fA-F]+): R_MIPS_HI16\\s+_mcount\$"; } -- cgit v1.2.3