Many test cases write to sysfs attributes, and these writes are important for understanding test behavior. However, bash's xtrace feature does not record the target file in commands like `echo X > Y`; it only records `echo X`. To capture the write target, introduce `_echo()`, which writes its first argument to the file specified by its second argument. This allows xtrace to record the complete operation (e.g., `_echo X Y` instead of just `echo X`). Signed-off-by: Shin'ichiro Kawasaki --- common/rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/rc b/common/rc index d2c1d74..0941678 100644 --- a/common/rc +++ b/common/rc @@ -780,3 +780,9 @@ _min() { done echo "$ret" } + +# Echo a value to a file. This wrapper is used to trace sysfs attribute writes +# when the --cmd-trace option is enabled. +_echo() { + echo "$1" > "$2" +} -- 2.54.0