bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `time ( someCmd )` Doesn't Print Time Under 5.2


From: Koichi Murase
Subject: Re: `time ( someCmd )` Doesn't Print Time Under 5.2
Date: Tue, 22 Nov 2022 11:32:51 +0900

2022年11月22日(火) 9:36 Emanuele Torre <torreemanuele6@gmail.com>:
> No, actually later, I said that it has probably been introduced earlier
> since I tried running 'time (sleep 1)' in a version of bash that
> preceeds that change (namely 6711d2dc7793ed3d35e91b2bd4ecbdfccfcf469f
> (2022-10-24)), and it still didn't print the timing report.

`git bisect' finds the following commit (2022-01-31) which introduced
the behavior:

> commit b325b0e96bd05c76bbfc4d60d0707fc93d58f03f (HEAD, refs/bisect/bad)
> Author: Chet Ramey <chet.ramey@case.edu>
> Date:   Mon Jan 31 09:53:03 2022 -0500
>
>     more changes for here-docs and $'...'; command optimization updates
>
> [CWRU/CWRU.chlog]
>
>                                    1/25
>                                    ----
> parse.y
>         - parse_matched_pair: ansi-expand $'...' in WORD for ${PARAM OP WORD}
>           and single-quote the result if dolbrace_state == DOLBRACE_QUOTE
>           (posix pattern removal operators) even if extended_quote == 0
>
> subst.c
>         - extract_heredoc_dolbrace_string: add logic to align with parse.y:
>           parse_matched_pair and its $'...' expansion, including handling
>           extended_quote
>
>                                    1/27
>                                    ----
> builtins/evalstring.c
>         - should_optimize_fork: broke conditions for optimizing away the fork
>           for a simple command out of optimize_fork into new function, call
>           from should_suppress_fork and optimize_subshell_command. Call from
>           optimize_fork if (subshell_environment & SUBSHELL_PAREN), relying
>           on fact that CMD_TRY_OPTIMIZING is only set in a couple of specific
>           conditions
>         - optimize_fork: call should_suppress_fork only if startup_state == 2;
>           it does the extra checks for that specific case
>         - optimize_fork: call should_optimize_fork if we're in a (list)
>           subshell (subshell_environment & SUBSHELL_PAREN)
>         - optimize_subshell_command: set CMD_TRY_OPTIMIZING on the right side
>           of a `&&', `||', or `;' list as long as it's a simple command so
>           we can check with optimize_fork() when it's time to execute it
>
> execute_cmd.c
>         - execute_in_subshell: call optimize_subshell_command for (list)
>           subshells to either set CMD_NO_FORK for simple commands or set
>           CMD_TRY_OPTIMIZING for likely candidates for later optimization
>
> builtins/common.h,builtins/evalstring.c
>         - optimize_fork: renamed to optimize_connection_fork; changed callers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]