diff mbox series

[1/5] arm/fvp: Join cli arguments in verbose logging

Message ID 20221115150116.314729-1-peter.hoyes@arm.com
State New
Headers show
Series [1/5] arm/fvp: Join cli arguments in verbose logging | expand

Commit Message

Peter Hoyes Nov. 15, 2022, 3:01 p.m. UTC
From: Peter Hoyes <Peter.Hoyes@arm.com>

It is sometimes helpful to copy and paste the cli arguments from the
verbose runfvp output (e.g. to test with a development FVP build), but
currently the arguments are printed as a Python list.  Use
shlex.join(cli) to safely join the arguments together in form that can
be reused directly in a shell.

Issue-Id: SCM-5314
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: Ibb5c5ed45d02e241cb3858f68740fb9d4e89357a
---
 meta-arm/lib/fvp/runner.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Peter Hoyes Nov. 15, 2022, 3:15 p.m. UTC | #1
Hi Jon,

There's no rush, but our team is planning a release based on langdale 
and it would be beneficial to have these improvements included. Let us 
know what you think.

Peter

On 15/11/2022 15:01, Peter Hoyes wrote:
> From: Peter Hoyes <Peter.Hoyes@arm.com>
>
> It is sometimes helpful to copy and paste the cli arguments from the
> verbose runfvp output (e.g. to test with a development FVP build), but
> currently the arguments are printed as a Python list.  Use
> shlex.join(cli) to safely join the arguments together in form that can
> be reused directly in a shell.
>
> Issue-Id: SCM-5314
> Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
> Change-Id: Ibb5c5ed45d02e241cb3858f68740fb9d4e89357a
> ---
>   meta-arm/lib/fvp/runner.py | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta-arm/lib/fvp/runner.py b/meta-arm/lib/fvp/runner.py
> index 28351a39..f5c61f8b 100644
> --- a/meta-arm/lib/fvp/runner.py
> +++ b/meta-arm/lib/fvp/runner.py
> @@ -2,6 +2,7 @@ import asyncio
>   import re
>   import subprocess
>   import os
> +import shlex
>   import shutil
>   import sys
>   
> @@ -67,7 +68,7 @@ class FVPRunner:
>               if name in os.environ:
>                   env[name] = os.environ[name]
>   
> -        self._logger.debug(f"Constructed FVP call: {cli}")
> +        self._logger.debug(f"Constructed FVP call: {shlex.join(cli)}")
>           self._fvp_process = await asyncio.create_subprocess_exec(
>               *cli,
>               stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
Jon Mason Nov. 15, 2022, 5:15 p.m. UTC | #2
On Tue, 15 Nov 2022 15:01:12 +0000, Peter Hoyes wrote:
> It is sometimes helpful to copy and paste the cli arguments from the
> verbose runfvp output (e.g. to test with a development FVP build), but
> currently the arguments are printed as a Python list.  Use
> shlex.join(cli) to safely join the arguments together in form that can
> be reused directly in a shell.

Applied, thanks!

[1/5] arm/fvp: Join cli arguments in verbose logging
      commit: 721bec250d5c0430591455350c02108769ba095a
[2/5] arm/lib: Factor out asyncio in FVPRunner
      commit: 81e0cf090b6b98525c3caf620214f1602de20800
[3/5] arm/lib: Decouple console parsing from the FVPRunner
      commit: 2265bffdc7ed80c0a1fc74180acb6d1d46b3120c
[4/5] arm/oeqa: Log the FVP output in OEFVPSSHTarget
      commit: 79e78fb31d84d0e55eda47603d76d413d48544a1
[5/5] runfvp: Fix verbose output when using --console
      commit: d5f132b19920870526c3b03c6a932ebb7949f8c6

Best regards,
diff mbox series

Patch

diff --git a/meta-arm/lib/fvp/runner.py b/meta-arm/lib/fvp/runner.py
index 28351a39..f5c61f8b 100644
--- a/meta-arm/lib/fvp/runner.py
+++ b/meta-arm/lib/fvp/runner.py
@@ -2,6 +2,7 @@  import asyncio
 import re
 import subprocess
 import os
+import shlex
 import shutil
 import sys
 
@@ -67,7 +68,7 @@  class FVPRunner:
             if name in os.environ:
                 env[name] = os.environ[name]
 
-        self._logger.debug(f"Constructed FVP call: {cli}")
+        self._logger.debug(f"Constructed FVP call: {shlex.join(cli)}")
         self._fvp_process = await asyncio.create_subprocess_exec(
             *cli,
             stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,