Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
ceae52df
Commit
ceae52df
authored
Sep 12, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "baseline" and "bloatcheck" makefile targets
parent
c2d8d3ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
154 additions
and
6 deletions
+154
-6
.gitignore
.gitignore
+1
-0
CHANGELOG
CHANGELOG
+4
-0
Makefile
Makefile
+19
-6
bld/bloat-o-meter
bld/bloat-o-meter
+130
-0
No files found.
.gitignore
View file @
ceae52df
...
@@ -2,6 +2,7 @@ src/*.o
...
@@ -2,6 +2,7 @@ src/*.o
src/*.mo
src/*.mo
src/dnsmasq.pot
src/dnsmasq.pot
src/dnsmasq
src/dnsmasq
src/dnsmasq_baseline
src/.configured
src/.configured
contrib/wrt/dhcp_lease_time
contrib/wrt/dhcp_lease_time
contrib/wrt/dhcp_release
contrib/wrt/dhcp_release
...
...
CHANGELOG
View file @
ceae52df
...
@@ -107,6 +107,10 @@ version 2.67
...
@@ -107,6 +107,10 @@ version 2.67
Fix crash with empty tag: in --dhcp-range. Thanks to
Fix crash with empty tag: in --dhcp-range. Thanks to
Kaspar Schleiser for the bug report.
Kaspar Schleiser for the bug report.
Add "baseline" and "bloatcheck" makefile targets, for
revealing size changes during development. Thanks to
Vladislav Grishenko for the patch.
version 2.66
version 2.66
Add the ability to act as an authoritative DNS
Add the ability to act as an authoritative DNS
...
...
Makefile
View file @
ceae52df
...
@@ -77,10 +77,14 @@ all : $(BUILDDIR)
...
@@ -77,10 +77,14 @@ all : $(BUILDDIR)
build_libs
=
"
$(dbus_libs)
$(idn_libs)
$(ct_libs)
$(lua_libs)
$(sunos_libs)
"
\
build_libs
=
"
$(dbus_libs)
$(idn_libs)
$(ct_libs)
$(lua_libs)
$(sunos_libs)
"
\
-f
$(top)
/Makefile dnsmasq
-f
$(top)
/Makefile dnsmasq
clean
:
mostly_
clean
:
rm
-f
*
~
$(BUILDDIR)
/
*
.mo contrib/
*
/
*
~
*
/
*
~
$(BUILDDIR)
/
*
.pot
rm
-f
$(BUILDDIR)
/
*
.mo
$(BUILDDIR)
/
*
.pot
rm
-f
$(BUILDDIR)
/.configured
$(BUILDDIR)
/
*
.o
$(BUILDDIR)
/dnsmasq.a
$(BUILDDIR)
/dnsmasq
rm
-f
$(BUILDDIR)
/.configured
$(BUILDDIR)
/
*
.o
$(BUILDDIR)
/dnsmasq.a
$(BUILDDIR)
/dnsmasq
rm
-rf
core
*
/core
clean
:
mostly_clean
rm
-f
$(BUILDDIR)
/dnsmasq_baseline
rm
-f
core
*
/core
rm
-f
*
~ contrib/
*
/
*
~
*
/
*
~
install
:
all install-common
install
:
all install-common
...
@@ -113,6 +117,16 @@ merge :
...
@@ -113,6 +117,16 @@ merge :
$(BUILDDIR)
:
$(BUILDDIR)
:
mkdir
-p
$(BUILDDIR)
mkdir
-p
$(BUILDDIR)
# rules below are helpers for size tracking
baseline
:
mostly_clean all
@
cd
$(BUILDDIR)
&&
\
mv
dnsmasq dnsmasq_baseline
bloatcheck
:
$(BUILDDIR)/dnsmasq_baseline mostly_clean all
@
cd
$(BUILDDIR)
&&
\
$(top)
/bld/bloat-o-meter dnsmasq_baseline dnsmasq
;
\
size dnsmasq_baseline dnsmasq
# rules below are targets in recusive makes with cwd=$(BUILDDIR)
# rules below are targets in recusive makes with cwd=$(BUILDDIR)
...
@@ -126,7 +140,7 @@ $(objs:.o=.c) $(hdrs):
...
@@ -126,7 +140,7 @@ $(objs:.o=.c) $(hdrs):
.c.o
:
.c.o
:
$(CC)
$(CFLAGS)
$(COPTS)
$(i18n)
$(build_cflags)
$(RPM_OPT_FLAGS)
-c
$<
$(CC)
$(CFLAGS)
$(COPTS)
$(i18n)
$(build_cflags)
$(RPM_OPT_FLAGS)
-c
$<
dnsmasq
:
.configured $(hdrs) $(objs)
dnsmasq
:
.configured $(hdrs) $(objs)
$(CC)
$(LDFLAGS)
-o
$@
$(objs)
$(build_libs)
$(LIBS)
$(CC)
$(LDFLAGS)
-o
$@
$(objs)
$(build_libs)
$(LIBS)
dnsmasq.pot
:
$(objs:.o=.c) $(hdrs)
dnsmasq.pot
:
$(objs:.o=.c) $(hdrs)
...
@@ -135,5 +149,4 @@ dnsmasq.pot : $(objs:.o=.c) $(hdrs)
...
@@ -135,5 +149,4 @@ dnsmasq.pot : $(objs:.o=.c) $(hdrs)
%.mo
:
$(top)/$(PO)/%.po dnsmasq.pot
%.mo
:
$(top)/$(PO)/%.po dnsmasq.pot
$(MSGMERGE)
-o
-
$(top)
/
$(PO)
/
$*
.po dnsmasq.pot |
$(MSGFMT)
-o
$*
.mo -
$(MSGMERGE)
-o
-
$(top)
/
$(PO)
/
$*
.po dnsmasq.pot |
$(MSGFMT)
-o
$*
.mo -
.PHONY
:
all clean mostly_clean install install-common all-i18n install-i18n merge baseline bloatcheck
.PHONY
:
all clean install install-common all-i18n install-i18n merge
bld/bloat-o-meter
0 → 100755
View file @
ceae52df
#!/usr/bin/env python
#
# Copyright 2004 Matt Mackall <mpm@selenic.com>
#
# Inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
import
sys
,
os
#, re
def
usage
():
sys
.
stderr
.
write
(
"usage:
%
s [-t] file1 file2
\n
"
%
sys
.
argv
[
0
])
sys
.
exit
(
-
1
)
f1
,
f2
=
(
None
,
None
)
flag_timing
,
dashes
=
(
False
,
False
)
for
f
in
sys
.
argv
[
1
:]:
if
f
.
startswith
(
"-"
):
if
f
==
"--"
:
# sym_args
dashes
=
True
break
if
f
==
"-t"
:
# timings
flag_timing
=
True
else
:
if
not
os
.
path
.
exists
(
f
):
sys
.
stderr
.
write
(
"Error: file '
%
s' does not exist
\n
"
%
f
)
usage
()
if
f1
is
None
:
f1
=
f
elif
f2
is
None
:
f2
=
f
if
flag_timing
:
import
time
if
f1
is
None
or
f2
is
None
:
usage
()
sym_args
=
" "
.
join
(
sys
.
argv
[
3
+
flag_timing
+
dashes
:])
def
getsizes
(
file
):
sym
,
alias
,
lut
=
{},
{},
{}
for
l
in
os
.
popen
(
"readelf -W -s
%
s
%
s"
%
(
sym_args
,
file
))
.
readlines
():
l
=
l
.
strip
()
if
not
(
len
(
l
)
and
l
[
0
]
.
isdigit
()
and
len
(
l
.
split
())
==
8
):
continue
num
,
value
,
size
,
typ
,
bind
,
vis
,
ndx
,
name
=
l
.
split
()
if
ndx
==
"UND"
:
continue
# skip undefined
if
typ
in
[
"SECTION"
,
"FILES"
]:
continue
# skip sections and files
if
"."
in
name
:
name
=
"static."
+
name
.
split
(
"."
)[
0
]
value
=
int
(
value
,
16
)
size
=
int
(
size
,
16
)
if
size
.
startswith
(
'0x'
)
else
int
(
size
)
if
vis
!=
"DEFAULT"
and
bind
!=
"GLOBAL"
:
# see if it is an alias
alias
[(
value
,
size
)]
=
{
"name"
:
name
}
else
:
sym
[
name
]
=
{
"addr"
:
value
,
"size"
:
size
}
lut
[(
value
,
size
)]
=
0
for
addr
,
sz
in
iter
(
alias
.
keys
()):
# If the non-GLOBAL sym has an implementation elsewhere then
# it's an alias, disregard it.
if
not
(
addr
,
sz
)
in
lut
:
# If this non-GLOBAL sym does not have an implementation at
# another address, then treat it as a normal symbol.
sym
[
alias
[(
addr
,
sz
)][
"name"
]]
=
{
"addr"
:
addr
,
"size"
:
sz
}
for
l
in
os
.
popen
(
"readelf -W -S "
+
file
)
.
readlines
():
x
=
l
.
split
()
if
len
(
x
)
<
6
:
continue
# Should take these into account too!
#if x[1] not in [".text", ".rodata", ".symtab", ".strtab"]: continue
if
x
[
1
]
not
in
[
".rodata"
]:
continue
sym
[
x
[
1
]]
=
{
"addr"
:
int
(
x
[
3
],
16
),
"size"
:
int
(
x
[
5
],
16
)}
return
sym
if
flag_timing
:
start_t1
=
int
(
time
.
time
()
*
1e9
)
old
=
getsizes
(
f1
)
if
flag_timing
:
end_t1
=
int
(
time
.
time
()
*
1e9
)
start_t2
=
int
(
time
.
time
()
*
1e9
)
new
=
getsizes
(
f2
)
if
flag_timing
:
end_t2
=
int
(
time
.
time
()
*
1e9
)
start_t3
=
int
(
time
.
time
()
*
1e9
)
grow
,
shrink
,
add
,
remove
,
up
,
down
=
0
,
0
,
0
,
0
,
0
,
0
delta
,
common
=
[],
{}
for
name
in
iter
(
old
.
keys
()):
if
name
in
new
:
common
[
name
]
=
1
for
name
in
old
:
if
name
not
in
common
:
remove
+=
1
sz
=
old
[
name
][
"size"
]
down
+=
sz
delta
.
append
((
-
sz
,
name
))
for
name
in
new
:
if
name
not
in
common
:
add
+=
1
sz
=
new
[
name
][
"size"
]
up
+=
sz
delta
.
append
((
sz
,
name
))
for
name
in
common
:
d
=
new
[
name
]
.
get
(
"size"
,
0
)
-
old
[
name
]
.
get
(
"size"
,
0
)
if
d
>
0
:
grow
,
up
=
grow
+
1
,
up
+
d
elif
d
<
0
:
shrink
,
down
=
shrink
+
1
,
down
-
d
else
:
continue
delta
.
append
((
d
,
name
))
delta
.
sort
()
delta
.
reverse
()
if
flag_timing
:
end_t3
=
int
(
time
.
time
()
*
1e9
)
print
(
"
%-48
s
%7
s
%7
s
%+7
s"
%
(
"function"
,
"old"
,
"new"
,
"delta"
))
for
d
,
n
in
delta
:
if
d
:
old_sz
=
old
.
get
(
n
,
{})
.
get
(
"size"
,
"-"
)
new_sz
=
new
.
get
(
n
,
{})
.
get
(
"size"
,
"-"
)
print
(
"
%-48
s
%7
s
%7
s
%+7
d"
%
(
n
,
old_sz
,
new_sz
,
d
))
print
(
"-"
*
78
)
total
=
"(add/remove:
%
s/
%
s grow/shrink:
%
s/
%
s up/down:
%
s/
%
s)
%%
sTotal:
%
s bytes"
\
%
(
add
,
remove
,
grow
,
shrink
,
up
,
-
down
,
up
-
down
)
print
(
total
%
(
" "
*
(
80
-
len
(
total
))))
if
flag_timing
:
print
(
"
\n
%
d/
%
d;
%
d Parse origin/new; processing nsecs"
%
(
end_t1
-
start_t1
,
end_t2
-
start_t2
,
end_t3
-
start_t3
))
print
(
"total nsecs:
%
d"
%
(
end_t3
-
start_t1
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment