1 # -*- Mode: Makefile -*-
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
16 # The Original Code is Makefile, released
19 # The Initial Developer of the Original Code is
20 # Netscape Communications Corporation.
21 # Portions created by the Initial Developer are Copyright (C) 2000
22 # the Initial Developer. All Rights Reserved.
25 # Chris Waterson <waterson@netscape.com>
27 # Alternatively, the contents of this file may be used under the terms of
28 # either the GNU General Public License Version 2 or later (the "GPL"), or
29 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 # in which case the provisions of the GPL or the LGPL are applicable instead
31 # of those above. If you wish to allow use of your version of this file only
32 # under the terms of either the GPL or the LGPL, and not to allow others to
33 # use your version of this file under the terms of the MPL, indicate your
34 # decision by deleting the provisions above and replace them with the notice
35 # and other provisions required by the GPL or the LGPL. If you do not delete
36 # the provisions above, a recipient may use your version of this file under
37 # the terms of any one of the MPL, the GPL or the LGPL.
39 # ***** END LICENSE BLOCK *****
41 # This makefile takes raw data files named ``winEmbed.dat'' and
42 # ``mozilla.dat'' produces a graph that shows memory usage and peak
43 # memory usage versus number of URLs loaded.
45 # The data files are assumed to be of the form:
47 # <working-set-size-1> <peak-working-set-size-1>
48 # <working-set-size-2> <peak-working-set-size-2>
51 # It is also assumed that each measurement corresponds (roughly) to a
54 # You can tweak ``win32.gnuplot.in'' to change the graph's output.
56 # You should use this with ``make --unix'' (which will use
57 # sh.exe instead of cmd.exe to process commands); e.g.,
59 # make --unix -f win32-gdf.mk \
60 # BUSTER_URL="http://localhost/cgi-bin/buster.cgi?refresh=10"
65 # . Get gnuplot for Win32 from
67 # ftp://ftp.dartmouth.edu/pub/gnuplot/gnuplot3.7cyg.zip
69 # . The "standard" cygwin tools that you probably already have. (If
70 # you don't have 'em, see the Win32 build instructions on
74 # This script computes a line using linear regression; its output is
79 # Where <b1> is the slope and <b0> is the y-intercept.
80 LINEAR_REGRESSION
=awk
-f linear-regression.awk
82 PROGRAM_PATH
=..
\\..
\\dist\\win32_o.obj
\\bin
83 WINEMBED_PROGRAM
=winEmbed
84 MOZILLA_PROGRAM
=mozilla
87 BUSTER_URL
=http
://btek
/cgi-bin
/buster.cgi?refresh
=10
89 #----------------------------------------------------------------------
94 #----------------------------------------------------------------------
98 .INTERMEDIATE
: winEmbed-ws.dat winEmbed-pws.dat mozilla-ws.dat mozilla-pws.dat win32.gnuplot
100 # Create a PNG image using the generated ``win32.gnuplot'' script
101 win32-gdf.png
: winEmbed-ws.dat winEmbed-pws.dat mozilla-ws.dat mozilla-pws.dat win32.gnuplot
102 $(GNUPLOT
) win32.gnuplot
104 # Generate a ``gnuplot'' script from ``win32.gnuplot.in'', making
105 # appropriate substitutions as necessary.
106 win32.gnuplot
: win32.gnuplot.in winEmbed-ws.dat mozilla-ws.dat
107 sed
-e
"s/@WINEMBED-WS-LINE@/`$(LINEAR_REGRESSION) winEmbed-ws.dat`/" \
108 -e
"s/@WINEMBED-GROWTH-RATE@/`$(LINEAR_REGRESSION) winEmbed-ws.dat | awk '{ printf \"%0.1f\n\", $$1; }'`/" \
109 -e
"s/@WINEMBED-BASE-SIZE@/`$(LINEAR_REGRESSION) winEmbed-ws.dat | awk '{ print $$5; }'`/" \
110 -e
"s/@MOZILLA-WS-LINE@/`$(LINEAR_REGRESSION) mozilla-ws.dat`/" \
111 -e
"s/@MOZILLA-GROWTH-RATE@/`$(LINEAR_REGRESSION) mozilla-ws.dat | awk '{ printf \"%0.1f\n\", $$1; }'`/" \
112 -e
"s/@MOZILLA-BASE-SIZE@/`$(LINEAR_REGRESSION) mozilla-ws.dat | awk '{ print $$5; }'`/" \
113 win32.gnuplot.in
> $@
115 # Break the raw data file into temporary files that can be processed
116 # by gnuplot directly.
117 winEmbed-ws.dat
: winEmbed.dat
118 awk
'{ print NR, $$1 / 1024; }' $?
> $@
120 winEmbed-pws.dat
: winEmbed.dat
121 awk
'{ print NR, $$2 / 1024; }' $?
> $@
123 mozilla-ws.dat
: mozilla.dat
124 awk
'{ print NR, $$1 / 1024; }' $?
> $@
126 mozilla-pws.dat
: mozilla.dat
127 awk
'{ print NR, $$2 / 1024; }' $?
> $@
129 # Run programs to collect data
131 cmd
/c
"start $(PROGRAM_PATH)\\$(WINEMBED_PROGRAM) $(BUSTER_URL) && .\\wm $(WINEMBED_PROGRAM) > $@"
134 cmd
/c
"start $(PROGRAM_PATH)\\$(MOZILLA_PROGRAM) $(BUSTER_URL) && .\\wm $(MOZILLA_PROGRAM) > $@"
136 # Build ``wm.exe'', the memory spy
138 cl
-Od
-Zi wm.
cpp advapi32.lib
142 rm -f wm.exe
*-gdf.png
*.dat
*~