diff mbox series

[ptest-runner,1/2] ptest-runner-collect-system-data: add info to logs

Message ID 20260302174500.357368-1-yoann.congal@smile.fr
State New
Headers show
Series [ptest-runner,1/2] ptest-runner-collect-system-data: add info to logs | expand

Commit Message

Yoann Congal March 2, 2026, 5:44 p.m. UTC
From: Yoann Congal <yoann.congal@smile.fr>

Print a banner to make it more clear what is happening when reading the
logs.

Add used commands to stdout by using shell's "set -x" (which prints used
commands to stderr, so, also redirect stderr to stdout).

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 ptest-runner-collect-system-data | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Anibal Limon March 4, 2026, 3:38 p.m. UTC | #1
Hi Yoann,

Adding Alexander, comment below,

On Mon, Mar 2, 2026 at 11:45 AM Yoann Congal <yoann.congal@smile.fr> wrote:

> From: Yoann Congal <yoann.congal@smile.fr>
>
> Print a banner to make it more clear what is happening when reading the
> logs.
>
> Add used commands to stdout by using shell's "set -x" (which prints used
> commands to stderr, so, also redirect stderr to stdout).
>
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---
>  ptest-runner-collect-system-data | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/ptest-runner-collect-system-data
> b/ptest-runner-collect-system-data
> index ba335da..15205f1 100755
> --- a/ptest-runner-collect-system-data
> +++ b/ptest-runner-collect-system-data
> @@ -1,5 +1,9 @@
>  #!/bin/sh
>  # Other ideas on what to do when a ptest gets stuck welcome.
> +
> +echo "Collected system state:"
>

Can you add a comment here explaining why `exec` and `set` are used?

+exec 2>&1
> +set -x
>  dmesg
>  pstree -a -l
>  df
>
Yoann Congal March 4, 2026, 4 p.m. UTC | #2
On Wed Mar 4, 2026 at 4:38 PM CET, Anibal Limon wrote:
> Hi Yoann,
>
> Adding Alexander, comment below,
>
> On Mon, Mar 2, 2026 at 11:45 AM Yoann Congal <yoann.congal@smile.fr> wrote:
>
>> From: Yoann Congal <yoann.congal@smile.fr>
>>
>> Print a banner to make it more clear what is happening when reading the
>> logs.
>>
>> Add used commands to stdout by using shell's "set -x" (which prints used
>> commands to stderr, so, also redirect stderr to stdout).
>>
>> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
>> ---
>>  ptest-runner-collect-system-data | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/ptest-runner-collect-system-data
>> b/ptest-runner-collect-system-data
>> index ba335da..15205f1 100755
>> --- a/ptest-runner-collect-system-data
>> +++ b/ptest-runner-collect-system-data
>> @@ -1,5 +1,9 @@
>>  #!/bin/sh
>>  # Other ideas on what to do when a ptest gets stuck welcome.
>> +
>> +echo "Collected system state:"
>>
>
> Can you add a comment here explaining why `exec` and `set` are used?

Sure! v2 sent.

>
> +exec 2>&1
>> +set -x
>>  dmesg
>>  pstree -a -l
>>  df
>>
diff mbox series

Patch

diff --git a/ptest-runner-collect-system-data b/ptest-runner-collect-system-data
index ba335da..15205f1 100755
--- a/ptest-runner-collect-system-data
+++ b/ptest-runner-collect-system-data
@@ -1,5 +1,9 @@ 
 #!/bin/sh
 # Other ideas on what to do when a ptest gets stuck welcome.
+
+echo "Collected system state:"
+exec 2>&1
+set -x
 dmesg
 pstree -a -l
 df