2022-10-08 10:06:34

by Leo Yan

[permalink] [raw]
Subject: [PATCH] docs: ftrace: Correct access mode

The documentation gives an example for opening trace marker with
write-only mode, but the flag WR_ONLY is not defined by glibc.

Use O_WRONLY to replace it.

Signed-off-by: Leo Yan <[email protected]>
---
Documentation/trace/ftrace.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
index b37dc19e4d40..60bceb018d6a 100644
--- a/Documentation/trace/ftrace.rst
+++ b/Documentation/trace/ftrace.rst
@@ -564,7 +564,7 @@ of ftrace. Here is a list of some of the key files:

start::

- trace_fd = open("trace_marker", WR_ONLY);
+ trace_fd = open("trace_marker", O_WRONLY);

Note: Writing into the trace_marker file can also initiate triggers
that are written into /sys/kernel/tracing/events/ftrace/print/trigger
--
2.34.1


2022-10-08 20:35:02

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] docs: ftrace: Correct access mode

On Sat, 8 Oct 2022 08:32:50 +0000
Leo Yan <[email protected]> wrote:

> The documentation gives an example for opening trace marker with
> write-only mode, but the flag WR_ONLY is not defined by glibc.
>
> Use O_WRONLY to replace it.
>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> Documentation/trace/ftrace.rst | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
> index b37dc19e4d40..60bceb018d6a 100644
> --- a/Documentation/trace/ftrace.rst
> +++ b/Documentation/trace/ftrace.rst
> @@ -564,7 +564,7 @@ of ftrace. Here is a list of some of the key files:
>
> start::
>
> - trace_fd = open("trace_marker", WR_ONLY);
> + trace_fd = open("trace_marker", O_WRONLY);

Acked-by: Steven Rostedt (Google) <[email protected]>

-- Steve

>
> Note: Writing into the trace_marker file can also initiate triggers
> that are written into /sys/kernel/tracing/events/ftrace/print/trigger

2022-10-10 18:56:03

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH] docs: ftrace: Correct access mode

Leo Yan <[email protected]> writes:

> The documentation gives an example for opening trace marker with
> write-only mode, but the flag WR_ONLY is not defined by glibc.
>
> Use O_WRONLY to replace it.
>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> Documentation/trace/ftrace.rst | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
> index b37dc19e4d40..60bceb018d6a 100644
> --- a/Documentation/trace/ftrace.rst
> +++ b/Documentation/trace/ftrace.rst
> @@ -564,7 +564,7 @@ of ftrace. Here is a list of some of the key files:
>
> start::
>
> - trace_fd = open("trace_marker", WR_ONLY);
> + trace_fd = open("trace_marker", O_WRONLY);
>

Applied, thanks.

jon