buildtools: lighter experimental symbol check

Message ID 1565593348-6431-1-git-send-email-david.marchand@redhat.com
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • buildtools: lighter experimental symbol check
Related show

Checks

Context Check Description
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/iol-Compile-Testing success Compile Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

David Marchand Aug. 12, 2019, 7:02 a.m.
Dumping every object file for every symbol is too heavy.
Use a temporary storage.

Before:
$ rm -rf master && make defconfig O=master
$ time make EXTRA_CFLAGS=-g O=master
[...]
real	2m24.063s
user	1m16.985s
sys	1m46.372s

After:
$ rm -rf master && make defconfig O=master
$ time make EXTRA_CFLAGS=-g O=master
[...]
real	1m37.110s
user	0m49.417s
sys	0m51.803s

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 buildtools/check-experimental-syms.sh | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Comments

Neil Horman Aug. 12, 2019, 8:13 p.m. | #1
On Mon, Aug 12, 2019 at 09:02:28AM +0200, David Marchand wrote:
> Dumping every object file for every symbol is too heavy.
> Use a temporary storage.
> 
> Before:
> $ rm -rf master && make defconfig O=master
> $ time make EXTRA_CFLAGS=-g O=master
> [...]
> real	2m24.063s
> user	1m16.985s
> sys	1m46.372s
> 
> After:
> $ rm -rf master && make defconfig O=master
> $ time make EXTRA_CFLAGS=-g O=master
> [...]
> real	1m37.110s
> user	0m49.417s
> sys	0m51.803s
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  buildtools/check-experimental-syms.sh | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-experimental-syms.sh
> index 0f6c62d..47a06fc 100755
> --- a/buildtools/check-experimental-syms.sh
> +++ b/buildtools/check-experimental-syms.sh
> @@ -18,14 +18,15 @@ then
>  	exit 0
>  fi
>  
> +DUMPFILE=$(mktemp -t dpdk.${0##*/}.XXX.objdump)
> +trap 'rm -f "$DUMPFILE"' EXIT
> +objdump -t $OBJFILE >$DUMPFILE
> +
When does this temporary file get deleted?
David Marchand Aug. 13, 2019, 6:32 a.m. | #2
On Mon, Aug 12, 2019 at 10:14 PM Neil Horman <nhorman@tuxdriver.com> wrote:
>
> On Mon, Aug 12, 2019 at 09:02:28AM +0200, David Marchand wrote:
> > Dumping every object file for every symbol is too heavy.
> > Use a temporary storage.
> >
> > Before:
> > $ rm -rf master && make defconfig O=master
> > $ time make EXTRA_CFLAGS=-g O=master
> > [...]
> > real  2m24.063s
> > user  1m16.985s
> > sys   1m46.372s
> >
> > After:
> > $ rm -rf master && make defconfig O=master
> > $ time make EXTRA_CFLAGS=-g O=master
> > [...]
> > real  1m37.110s
> > user  0m49.417s
> > sys   0m51.803s
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> >  buildtools/check-experimental-syms.sh | 15 ++++++++-------
> >  1 file changed, 8 insertions(+), 7 deletions(-)
> >
> > diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-experimental-syms.sh
> > index 0f6c62d..47a06fc 100755
> > --- a/buildtools/check-experimental-syms.sh
> > +++ b/buildtools/check-experimental-syms.sh
> > @@ -18,14 +18,15 @@ then
> >       exit 0
> >  fi
> >
> > +DUMPFILE=$(mktemp -t dpdk.${0##*/}.XXX.objdump)
> > +trap 'rm -f "$DUMPFILE"' EXIT

"If a sigspec is EXIT (0) the command arg is executed on exit from the shell."

> > +objdump -t $OBJFILE >$DUMPFILE
> > +
> When does this temporary file get deleted?

It should be enough?
Neil Horman Aug. 14, 2019, 12:09 a.m. | #3
On Tue, Aug 13, 2019 at 08:32:44AM +0200, David Marchand wrote:
> On Mon, Aug 12, 2019 at 10:14 PM Neil Horman <nhorman@tuxdriver.com> wrote:
> >
> > On Mon, Aug 12, 2019 at 09:02:28AM +0200, David Marchand wrote:
> > > Dumping every object file for every symbol is too heavy.
> > > Use a temporary storage.
> > >
> > > Before:
> > > $ rm -rf master && make defconfig O=master
> > > $ time make EXTRA_CFLAGS=-g O=master
> > > [...]
> > > real  2m24.063s
> > > user  1m16.985s
> > > sys   1m46.372s
> > >
> > > After:
> > > $ rm -rf master && make defconfig O=master
> > > $ time make EXTRA_CFLAGS=-g O=master
> > > [...]
> > > real  1m37.110s
> > > user  0m49.417s
> > > sys   0m51.803s
> > >
> > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > > ---
> > >  buildtools/check-experimental-syms.sh | 15 ++++++++-------
> > >  1 file changed, 8 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-experimental-syms.sh
> > > index 0f6c62d..47a06fc 100755
> > > --- a/buildtools/check-experimental-syms.sh
> > > +++ b/buildtools/check-experimental-syms.sh
> > > @@ -18,14 +18,15 @@ then
> > >       exit 0
> > >  fi
> > >
> > > +DUMPFILE=$(mktemp -t dpdk.${0##*/}.XXX.objdump)
> > > +trap 'rm -f "$DUMPFILE"' EXIT
> 
> "If a sigspec is EXIT (0) the command arg is executed on exit from the shell."
> 
> > > +objdump -t $OBJFILE >$DUMPFILE
> > > +
> > When does this temporary file get deleted?
> 
> It should be enough?
> 
Yes, thank you, I missed that.

Acked-by: Neil Horman <nhorman@tuxdriver.com>

> -- 
> David Marchand
>

Patch

diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-experimental-syms.sh
index 0f6c62d..47a06fc 100755
--- a/buildtools/check-experimental-syms.sh
+++ b/buildtools/check-experimental-syms.sh
@@ -18,14 +18,15 @@  then
 	exit 0
 fi
 
+DUMPFILE=$(mktemp -t dpdk.${0##*/}.XXX.objdump)
+trap 'rm -f "$DUMPFILE"' EXIT
+objdump -t $OBJFILE >$DUMPFILE
+
 ret=0
 for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE`
 do
-	objdump -t $OBJFILE | grep -q "\.text.*$SYM$"
-	IN_TEXT=$?
-	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM$"
-	IN_EXP=$?
-	if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
+	if grep -q "\.text.*$SYM$" $DUMPFILE &&
+		! grep -q "\.text\.experimental.*$SYM$" $DUMPFILE
 	then
 		cat >&2 <<- END_OF_MESSAGE
 		$SYM is not flagged as experimental
@@ -37,11 +38,11 @@  do
 done
 
 # Filter out symbols suffixed with a . for icc
-for SYM in `objdump -t $OBJFILE |awk '{
+for SYM in `awk '{
 	if ($2 != "l" && $4 == ".text.experimental" && !($NF ~ /\.$/)) {
 		print $NF
 	}
-}'`
+}' $DUMPFILE`
 do
 	$LIST_SYMBOL -S EXPERIMENTAL -s $SYM -q $MAPFILE || {
 		cat >&2 <<- END_OF_MESSAGE