URL: <http://savannah.gnu.org/bugs/?40639>
Summary: GNU Make with profiling information Project: make Submitted by: eddyp Submitted on: Tue 19 Nov 2013 21:31:16 GMT Severity: 3 - Normal Item Group: Enhancement Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: SCM Operating System: Any Fixed Release: None Triage Status: None _______________________________________________________ Details: Hello all, For perfomance analysis of the build systems I maintain I have found the need for GNU Make to provide profiling information so it can help the developer with spotting the slow parts of the build system. I have found others had the same need (see also the related patch #7447), but nobody was motivated enough to refine the patch to something useful. I have taken the crude work done by OpenShift guest <zlq...@daum.net> on profiling for make 3.82, I reworked it and updated to on top of the master version. I now I consider the profiling feature ready to be proposed for review. Here is how it looks when used: 0 eddy@heidi ~/usr/src/make/make-profiler $ ./make -P"target=%N start=%S duration=%D" >/dev/null target=all start=1384896401494 duration=0 target=all-am start=1384896401494 duration=0 target=all start=1384896401498 duration=0 target=all-am start=1384896401498 duration=0 target=all start=1384896401508 duration=0 target=all-yes start=1384896401508 duration=0 target=check-macro-version start=1384896401503 duration=5 target=all start=1384896401512 duration=0 target=all-am start=1384896401512 duration=0 target=all-am start=1384896401539 duration=0 target=config.h start=1384896401527 duration=5 target=all-recursive start=1384896401487 duration=53 target=all start=1384896401466 duration=75 target=config.h start=1384896401462 duration=4 The new profiling parameter is -P[FMT]/--profile[=FMT]/--profile-format[=FMT]. The man page is also updated, so here is a quote: -P[FMT], --profile[=FMT], --profile-format[=FMT] Print to stderr profiling information for each run target, one line per target, according to format string FMT. The FMT string can contain plain text and the following formatting sequences: %N target name %L recursion level for the make instance processing the target %P pid of the make instance processing the target %S start target timestamp (in miliseconds since 1 ian 1970) %E end target timestamp (in miliseconds since 1 ian 1970) %D difference between the target start and end timestamps (in miliseconds) %% literal % If the option is repeated, all the FMT parameters are concate‐ nated internally into a single formatting string. Any unrecognized % sequence will generate an error. If the FMT string ends with a single % character, then that character will be ignored. The default FMT string is [PROF:%N:lvl=%L:pid=%P] %S;%E;%D. My git repo is at (work is rebased on top of official master): https://github.com/eddyp/make-profiler The first results I got based on Make's own build system can be visible in this screenshot: https://github.com/eddyp/make-profiler/blob/master-rebase/make-j_profile.png Please tell me what you think, or tell me if you prefer a unified diff patch attached to this report for a review. Or maybe you prefer me to squash the profile related changes into a single commit. Notes: - My master-rebase branch, as the name suggests, will be rebased - I am aware the code in my master-rebase contains the more mature profiling feature code and the less polished graph code; I will separate the profiling code from the graph code on different branches, but I have had the need to use both features _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?40639> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make