From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] core/intrumetnation: don't spawn to get seconds-since-EPOCH
Date: Sun, 18 Mar 2018 17:16:05 +0100 [thread overview]
Message-ID: <20180318161605.GB2478@scaer> (raw)
In-Reply-To: <CABa6e=qZfehqQHFAkutn-WaFAw6Gp3Za-3_3ZB6mXd1ukxZq7w@mail.gmail.com>
Cam, All,
On 2018-03-17 22:54 +1100, Cam Hutchison spake thusly:
> On 16 March 2018 at 07:35, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > No need to spawn $(date) to get the number of seconds-since-EPOCH, as
> > bash's printf can do it as easily.
> >
> > This is just a micro-optimisation, though. Probably not noticeable.
> >
> > Reported-by: Trent Piepho <tpiepho@impinj.com>
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Trent Piepho <tpiepho@impinj.com>
> > ---
> > package/pkg-generic.mk | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> > index 9eddaeee57..2a82025a04 100644
> > --- a/package/pkg-generic.mk
> > +++ b/package/pkg-generic.mk
> > @@ -49,8 +49,8 @@ endef
> >
> > # Time steps
> > define step_time
> > - printf "%s:%-5.5s:%-20.20s: %s\n" \
> > - "$$(date +%s)" "$(1)" "$(2)" "$(3)" \
> > + printf "%(%s)T:%-5.5s:%-20.20s: %s\n" \
> > + -1 "$(1)" "$(2)" "$(3)" \
>
> Should you note somewhere that this needs bash 4.2? I remember some
> re-working of bash patches in the past to avoid the use of associative arrays
> as they were not supported in the oldest version of bash supported by
> buildroot. Is bash 4.2 ok now?
>
> See http://tiswww.case.edu/php/chet/bash/NEWS for when features were
> added to bash.
OK, I'm dropping this change, then. Thanks for noticing. :-)
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2018-03-18 16:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-15 20:35 [Buildroot] [PATCH 0/2] core/instrumentation: optimisations Yann E. MORIN
2018-03-15 20:35 ` [Buildroot] [PATCH 1/2] core/intrumetnation: don't spawn to get seconds-since-EPOCH Yann E. MORIN
2018-03-17 11:54 ` Cam Hutchison
2018-03-18 16:16 ` Yann E. MORIN [this message]
2018-03-19 16:15 ` Trent Piepho
2018-03-15 20:35 ` [Buildroot] [PATCH 2/2] core/instrumentation: shave minutes off the build time Yann E. MORIN
2018-03-18 14:14 ` Peter Korsgaard
2018-03-18 16:15 ` Yann E. MORIN
2018-03-18 16:33 ` Peter Korsgaard
2018-03-22 16:41 ` Thomas De Schampheleire
2018-03-22 16:50 ` Thomas Petazzoni
2018-03-22 17:11 ` Thomas De Schampheleire
2018-03-22 17:25 ` Trent Piepho
2018-03-22 22:39 ` Peter Korsgaard
2018-03-23 22:39 ` Arnout Vandecappelle
2018-03-23 23:03 ` Thomas Petazzoni
2018-03-19 16:30 ` Trent Piepho
2018-03-19 16:50 ` Thomas Petazzoni
2018-03-19 20:04 ` Peter Korsgaard
2018-03-20 21:47 ` Trent Piepho
2018-03-19 16:53 ` Peter Korsgaard
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=20180318161605.GB2478@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/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