remarkable-linux/tools/perf
Ingo Molnar acddedfba0 perf tools: Speed up the perf build time by simplifying the perf --version string generation
Building perf is pretty slow on trees that have a lot of commits
relative to the nearest Git tag. This slowness manifests itself during
version string generation:

 $ perf stat --null --repeat 3 --sync --pre "rm -f PERF-VERSION-FILE" util/PERF-VERSION-GEN
 PERF_VERSION = 3.7.rc3.1458.g5399b3b
 PERF_VERSION = 3.7.rc3.1458.g5399b3b
 PERF_VERSION = 3.7.rc3.1458.g5399b3b

 Performance counter stats for 'util/PERF-VERSION-GEN' (3 runs):

       2.857503976 seconds time elapsed                                          ( +-  0.22% )

The build can be even slower than that, when one over NFS volumes.

The reason for the slowness is that util/PERF-VERSION-GEN uses "git
describe" to generate the string, which has to count the "number of
commits distance" from the nearest tag - the ".1458." count in the
output above. For that Git had to extract and decompress 1458 Git
objects, which takes time and bandwidth.

But this "number of commits" value is mostly irrelevant in practice. We
either want to know an approximate tag name, or we want to know the
precise sha1.

So this patch simplifies the version string to:

 PERF_VERSION = 3.7.rc3.g5399b3b.dirty

which speeds up the version string generation script by an order of
magnitude:

 $ perf stat --null --repeat 3 --sync --pre "rm -f PERF-VERSION-FILE" util/PERF-VERSION-GEN
 PERF_VERSION = 3.7.rc3.g5399b3b.dirty
 PERF_VERSION = 3.7.rc3.g5399b3b.dirty
 PERF_VERSION = 3.7.rc3.g5399b3b.dirty

 Performance counter stats for 'util/PERF-VERSION-GEN' (3 runs):

       0.307633559 seconds time elapsed                                          ( +-  0.84% )

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Vagin <avagin@openvz.org>
Cc: Borislav Petkov <bp@amd64.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20121030084600.GB8245@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-10-31 12:17:49 -02:00
..
arch perf tools: Try to find cross-built objdump path 2012-10-24 14:20:11 -02:00
bench perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
config perf tools: Always show CHK message when doing try-cc 2012-10-26 11:22:24 -02:00
Documentation perf tools: Add info about cross compiling for Android ARM 2012-10-31 12:17:49 -02:00
python perf python: Use attr.watermark in twatch.py 2012-01-30 18:38:23 -02:00
scripts perf scripts: Add event_analyzing_sample-record/report 2012-09-17 13:11:15 -03:00
ui perf hists browser: Integrate script browser into main hists browser 2012-10-29 11:56:19 -02:00
util perf tools: Speed up the perf build time by simplifying the perf --version string generation 2012-10-31 12:17:49 -02:00
.gitignore perf tools: Ignore compiled python binaries 2012-09-07 12:10:58 -03:00
bash_completion perf tools: Complete tracepoint event names 2012-10-04 12:44:52 -03:00
builtin-annotate.c perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00
builtin-bench.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-buildid-cache.c perf tools: Move BUILD_ID_SIZE into build-id object 2012-10-29 11:35:32 -02:00
builtin-buildid-list.c perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00
builtin-diff.c perf event: No need to create a thread when handling PERF_RECORD_EXIT 2012-10-06 16:33:45 -03:00
builtin-evlist.c perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00
builtin-help.c perf help: Fix --help for builtins 2012-10-22 12:35:49 -02:00
builtin-inject.c perf inject: Mark a dso if it's used 2012-10-26 11:22:25 -02:00
builtin-kmem.c perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00
builtin-kvm.c perf kvm: Add braces around multi-line statements 2012-10-08 17:15:54 -03:00
builtin-list.c perf tools: Use __maybe_used for unused variables 2012-09-11 12:19:15 -03:00
builtin-lock.c perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00
builtin-probe.c perf probe: Don't use globals where not needed to 2012-10-02 18:36:37 -03:00
builtin-record.c perf record: Fix mmap error output condition 2012-10-29 12:14:59 -02:00
builtin-report.c perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00
builtin-sched.c perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00
builtin-script.c perf script: Add more filter to find_scripts() 2012-10-29 11:46:23 -02:00
builtin-stat.c perf stat: Add --pre and --post command 2012-10-26 11:22:25 -02:00
builtin-test.c perf test: Align the 'Ok'/'FAILED!' test results 2012-10-24 15:44:41 -02:00
builtin-timechart.c perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00
builtin-top.c perf tools: Give user better message if precise is not supported 2012-10-24 14:20:11 -02:00
builtin-trace.c perf trace: Use sched:sched_stat_runtime to provide a thread summary 2012-10-25 10:57:43 -02:00
builtin.h perf trace: New tool 2012-09-26 20:42:23 -03:00
command-list.txt perf trace: New tool 2012-09-26 20:42:23 -03:00
CREDITS perf_counter tools: Add CREDITS file for Git contributors 2009-06-24 19:54:29 +02:00
design.txt perf tools: Update ioctl documentation for PERF_IOC_FLAG_GROUP 2012-05-31 11:38:42 -03:00
Makefile perf tools: Warn about missing libelf 2012-10-31 12:17:48 -02:00
MANIFEST perf kvm: Events analysis tool 2012-09-21 12:51:22 -03:00
perf-archive.sh perf archive: Make 'f' the last parameter for tar 2012-09-17 13:10:42 -03:00
perf.c perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00
perf.h perf tools: Add a global variable "const char *input_name" 2012-10-29 11:45:34 -02:00