Skip to contentSkip to conversation

docs: ftrace: Correct access mode

PATCH Applied Leo Yan 3 participants 3 messages Oct 8, 2022 – Oct 10, 2022

Subsystems (3)
lore
Share & tools
lore

Leo Yan

author
#0 lore raw

PATCH 1/1 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.

---
 Documentation/trace/ftrace.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/trace/ftrace.rst +1 -1
index b37dc19e4d40..60bceb018d6a 100644
@@ -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
Signature · 1 line
2.34.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · 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.

---
 Documentation/trace/ftrace.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/trace/ftrace.rst +0 -0
index b37dc19e4d40..60bceb018d6a 100644

Documentation/trace/ftrace.rst of ftrace. Here is a list of some of the key files: · line 567

Quoted 5 lines
Documentation/trace/ftrace.rst +1 -1
@@ -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);

-- Steve

Quoted 3 lines
Documentation/trace/ftrace.rst +0 -0
 	Note: Writing into the trace_marker file can also initiate triggers
 	      that are written into /sys/kernel/tracing/events/ftrace/print/trigger
maintainer Applied
#2 lore raw
In reply to Leo Yan
Quoted 15 lines · Leo Yan

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.

---
 Documentation/trace/ftrace.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/trace/ftrace.rst +0 -0
index b37dc19e4d40..60bceb018d6a 100644

Documentation/trace/ftrace.rst of ftrace. Here is a list of some of the key files: · line 568

Quoted 6 lines
Documentation/trace/ftrace.rst +1 -1
@@ -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