Linux DTrace development list
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Zhan Xusheng <zhanxusheng1024@gmail.com>
Cc: Greg Marsden <greg.marsden@oracle.com>,
	dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com,
	zhanxusheng@xiaomi.com
Subject: Re: [PATCH] llm: fix newline escape in the SKILL.md script skeleton
Date: Fri, 28 Aug 2026 17:39:56 +0000	[thread overview]
Message-ID: <apHH7EKhUDMzGPwo@kvh-deb-bpf> (raw)
In-Reply-To: <20260807023349.1133517-1-zhanxusheng@xiaomi.com>

Thanks!

Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>

On Fri, Aug 07, 2026 at 10:33:49AM +0800, Zhan Xusheng wrote:
> The skeleton's BEGIN and ERROR clauses use "\\n" where "\n" is meant.
> In a D string literal that is an escaped backslash followed by 'n', so
> printf() emits a stray backslash instead of a newline.
> 
> Agents copy the skeleton verbatim, and "\\n" is a valid literal, so the
> 'dtrace -e' check prescribed in the same file does not catch it.
> 
> Every other D snippet in the tree uses a single backslash.
> 
> Assisted-by: Kiro:claude-opus-4.8
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
> ---
> Not tested under DTrace; this is purely a string-literal escape.
> Applies to devel (30c9c22).
> 
> One thing I left alone: the skeleton's ERROR clause prints probeprov/
> probemod/probefunc/probename, but those describe the probe that is
> currently firing, which inside an ERROR clause is dtrace:::ERROR itself
> rather than the probe that faulted.
> doc/userguide/reference/dtrace_providers_dtrace.md gives the culprit as
> arg1 (its EPID) and the fault type as arg4, and
> examples/language_features/001intro-ERROR-probe.d sidesteps this by
> printing a static message.  Should the skeleton use arg1/arg4?
> 
> Also minor: the "Target one process" pattern needs -p PID or -c CMD,
> which the suggested "sudo dtrace -s script.d" does not provide.
> 
>  llm/SKILL.md | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/llm/SKILL.md b/llm/SKILL.md
> index e5e2f3e..a6ff502 100644
> --- a/llm/SKILL.md
> +++ b/llm/SKILL.md
> @@ -66,7 +66,7 @@ probe-descriptions
>  
>  dtrace:::BEGIN
>  {
> -    printf("Tracing started...\\n");
> +    printf("Tracing started...\n");
>  }
>  
>  /* tracing clauses */
> @@ -78,7 +78,7 @@ dtrace:::END
>  
>  dtrace:::ERROR
>  {
> -    printf("DTrace error at %s:%s:%s:%s\\n", probeprov, probemod, probefunc, probename);
> +    printf("DTrace error at %s:%s:%s:%s\n", probeprov, probemod, probefunc, probename);
>  }
>  ```
>  
> -- 
> 2.43.0
> 

      reply	other threads:[~2026-08-28 17:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  2:33 [PATCH] llm: fix newline escape in the SKILL.md script skeleton Zhan Xusheng
2026-08-28 17:39 ` Kris Van Hees [this message]

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=apHH7EKhUDMzGPwo@kvh-deb-bpf \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=greg.marsden@oracle.com \
    --cc=zhanxusheng1024@gmail.com \
    --cc=zhanxusheng@xiaomi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox