All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tianchen Ding <dtcccc@linux.alibaba.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Shuah Khan <shuah@kernel.org>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v2] selftests/ftrace: Fix trace_marker_raw test on 64K page kernels
Date: Fri, 29 May 2026 09:15:29 -0400	[thread overview]
Message-ID: <20260529091529.3ec09629@fedora> (raw)
In-Reply-To: <bcb52d91-0440-4e73-86af-997e8b723711@linux.alibaba.com>

On Fri, 29 May 2026 10:59:34 +0800
Tianchen Ding <dtcccc@linux.alibaba.com> wrote:

> We can take advantage of this by having make_str return the escape-sequence text 
> instead of binary, and letting write_buffer handle the conversion:
> 
>    make_str() {
>          ...
>          printf '%s' "${val}${data}"
>    }
> 
>    write_buffer() {
>          id=$1
>          size=$2
> 
>          str=`make_str $id $size`
>          len=$(printf "$str" | wc -c)
>          printf "$str" | dd of=trace_marker_raw bs=$len iflag=fullblock
>    }
> 
> This way str holds only printable escape-sequence text (no NUL), printf "$str" 
> converts it to real binary through the pipe, and wc -c measures the true binary 
> length.

This is quite hacky, but at least it removes the hardcoded assumptions.

OK, you can send a v3 that does that.

Thanks,

-- Steve

  reply	other threads:[~2026-05-29 13:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27  9:54 [PATCH] selftests/ftrace: Fix trace_marker_raw test on 64K page kernels Tianchen Ding
2026-05-27 14:09 ` Steven Rostedt
2026-05-28  2:24 ` [PATCH v2] " Tianchen Ding
2026-05-28 13:13   ` Steven Rostedt
2026-05-29  2:59     ` Tianchen Ding
2026-05-29 13:15       ` Steven Rostedt [this message]
2026-06-01  2:32 ` [PATCH v3] " Tianchen Ding
2026-06-01 13:51   ` Steven Rostedt

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=20260529091529.3ec09629@fedora \
    --to=rostedt@goodmis.org \
    --cc=dtcccc@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=shuah@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.