Commit 8e5564e6c7554902301543e731354ad2ad58ae53

Authored by Arnaldo Carvalho de Melo
1 parent c45c6ea2e5

perf tools: Make target to generate self contained source tarball

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 <mmarek@suse.cz>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <20100528185357.GA28009@ghostprotocols.net>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Showing 3 changed files with 44 additions and 7 deletions Side-by-side Diff

... ... @@ -411,7 +411,7 @@
411 411 no-dot-config-targets := clean mrproper distclean \
412 412 cscope TAGS tags help %docs check% \
413 413 include/linux/version.h headers_% \
414   - kernelrelease kernelversion
  414 + kernelrelease kernelversion %src-pkg
415 415  
416 416 config-targets := 0
417 417 mixed-targets := 0
scripts/package/Makefile
... ... @@ -111,13 +111,38 @@
111 111 clean-dirs += $(objtree)/tar-install/
112 112  
113 113  
  114 +# perf-pkg - generate a source tarball with perf source
  115 +# ---------------------------------------------------------------------------
  116 +
  117 +perf-tar=perf-$(KERNELVERSION)
  118 +
  119 +quiet_cmd_perf_tar = TAR
  120 + cmd_perf_tar = \
  121 +git archive --prefix=$(perf-tar)/ HEAD^{tree} \
  122 + $$(cat $(srctree)/tools/perf/MANIFEST) -o $(perf-tar).tar; \
  123 +mkdir -p $(perf-tar); \
  124 +git rev-parse HEAD > $(perf-tar)/HEAD; \
  125 +tar rf $(perf-tar).tar $(perf-tar)/HEAD; \
  126 +rm -r $(perf-tar); \
  127 +$(if $(findstring tar-src,$@),, \
  128 +$(if $(findstring bz2,$@),bzip2, \
  129 +$(if $(findstring gz,$@),gzip, \
  130 +$(error unknown target $@))) \
  131 + -f -9 $(perf-tar).tar)
  132 +
  133 +perf-%pkg: FORCE
  134 + $(call cmd,perf_tar)
  135 +
114 136 # Help text displayed when executing 'make help'
115 137 # ---------------------------------------------------------------------------
116 138 help: FORCE
117   - @echo ' rpm-pkg - Build both source and binary RPM kernel packages'
118   - @echo ' binrpm-pkg - Build only the binary kernel package'
119   - @echo ' deb-pkg - Build the kernel as an deb package'
120   - @echo ' tar-pkg - Build the kernel as an uncompressed tarball'
121   - @echo ' targz-pkg - Build the kernel as a gzip compressed tarball'
122   - @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'
  139 + @echo ' rpm-pkg - Build both source and binary RPM kernel packages'
  140 + @echo ' binrpm-pkg - Build only the binary kernel package'
  141 + @echo ' deb-pkg - Build the kernel as an deb package'
  142 + @echo ' tar-pkg - Build the kernel as an uncompressed tarball'
  143 + @echo ' targz-pkg - Build the kernel as a gzip compressed tarball'
  144 + @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'
  145 + @echo ' perf-tar-src-pkg - Build $(perf-tar).tar source tarball'
  146 + @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball'
  147 + @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball'
  1 +tools/perf
  2 +include/linux/perf_event.h
  3 +include/linux/rbtree.h
  4 +include/linux/list.h
  5 +include/linux/hash.h
  6 +include/linux/stringify.h
  7 +lib/rbtree.c
  8 +include/linux/swab.h
  9 +arch/*/include/asm/unistd*.h
  10 +include/linux/poison.h
  11 +include/linux/magic.h
  12 +include/linux/hw_breakpoint.h