public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Steve Sakoman" <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][dunfell 28/36] utils: Reduce the number of calls to the "dirname" command
Date: Sat, 28 Aug 2021 08:11:16 -1000	[thread overview]
Message-ID: <912c9eda653c45fee2f55092fbe281efba897bc0.1630174149.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1630174149.git.steve@sakoman.com>

From: Oleksandr Popovych <opopovyc@cisco.com>

utils.bbclass contains create_cmdline_wrapper() function that
creates wrapper script with additional arguments for any passed
"$cmd" command, and uses several calls to "dirname".

Because "dirname" is an external command, in cases of lots of
calls to wrapped "$cmd", each call of "dirname" will incur
significant overhead.

There are three same calls to "dirname": one for saving it`s
output to "realdir" variable, and other two in "exec" command.
So last two "dirname" calls can be replaced with cached value
from "realdir" variable.

Signed-off-by: Oleksandr Popovych <opopovyc@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 4b9cf2c80fd14386e0b88a2e6c40a9fa3f1ae0f7)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes/utils.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index cd3d05709e..99f68f7505 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -233,7 +233,7 @@ create_cmdline_wrapper () {
 #!/bin/bash
 realpath=\`readlink -fn \$0\`
 realdir=\`dirname \$realpath\`
-exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real $cmdoptions "\$@"
+exec -a \$realdir/$cmdname \$realdir/$cmdname.real $cmdoptions "\$@"
 END
 	chmod +x $cmd
 }
-- 
2.25.1


  parent reply	other threads:[~2021-08-28 18:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-28 18:10 [OE-core][dunfell 00/36] Patch review Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 01/36] glibc: Security fix CVE-2021-33574 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 02/36] glibc: Security fix for CVE-2021-38604 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 03/36] gnupg: upgrade 2.2.20 -> 2.2.21 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 04/36] gnupg: update 2.2.21 -> 2.2.22 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 05/36] gnupg: uprev 2.2.22 -> 2.2.23 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 06/36] gnupg: update 2.2.23 -> 2.2.26 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 07/36] gnupg: upgrade 2.2.26 -> 2.2.27 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 08/36] qemu: Security fix CVE-2020-25085 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 09/36] qemu: Security fix CVE-2020-25624 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 10/36] Qemu: Security fix for CVE-2020-25625/2021-3409/2020-17380 Steve Sakoman
2021-08-28 18:10 ` [OE-core][dunfell 11/36] qemu: Security fix for CVE-2020-29443 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 12/36] qemu: Security fix CVE-2021-20221 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 13/36] qemu: fix CVE-2021-20181 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 14/36] qemu: fix CVE-2021-3416 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 15/36] qemu: fix CVE-2021-20257 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 16/36] qemu: Security fix CVE-2021-3544 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 17/36] qemu: Security fixes CVE-2021-3545/6 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 18/36] qemu: fix CVE-2021-3527 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 19/36] qemu: fix CVE-2021-3582 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 20/36] qemu: fix CVE-2021-3607 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 21/36] qemu: fix CVE-2021-3608 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 22/36] rpm: Add fix for CVE-2021-20266 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 23/36] binutils: Security fix for CVE-2021-3549 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 24/36] binutils: Security fix for CVE-2020-16593 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 25/36] openssl: update from 1.1.1k to 1.1.1l Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 26/36] Use the label provided when formating a dos partition Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 27/36] lzo: add CVE_PRODUCT Steve Sakoman
2021-08-28 18:11 ` Steve Sakoman [this message]
2021-08-28 18:11 ` [OE-core][dunfell 29/36] tcf-agent: fetching over git:// no longer works Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 30/36] mklibs-native: drop deprecated cpp17 exceptions Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 31/36] image_types: Restore pre-btrfs-tools 4.14.1 mkfs.btrfs shrink behavior Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 32/36] linux-yocto/5.4: update to v5.4.142 Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 33/36] qemurunner.py: print output from runqemu/qemu-system in stop() Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 34/36] qemurunner.py: handle getOutput() having nothing to read Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 35/36] parselogs.py: ignore intermittent CD/DVDROM identification failure Steve Sakoman
2021-08-28 18:11 ` [OE-core][dunfell 36/36] selftest: disable virgl headless test Steve Sakoman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=912c9eda653c45fee2f55092fbe281efba897bc0.1630174149.git.steve@sakoman.com \
    --to=steve@sakoman.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox