Skip to contentSkip to conversation

android_config: add time headers

PATCH In review Jaegeuk Kim 2 participants 5 messages Jun 15, 2022 – Jun 20, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 android_config: add time headers

This allows f2fs_io report latency.

---
 include/android_config.h | 2 ++
 1 file changed, 2 insertions(+)
include/android_config.h +2 -0
index 21eed28669e1..67e5d5871bf8 100644
@@ -22,6 +22,8 @@
 #define HAVE_SYS_XATTR_H 1
 #define HAVE_UNISTD_H 1
 #define HAVE_UUID_UUID_H 1
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOCK_BOOTTIME 1
 
 #define HAVE_FALLOCATE 1
 #define HAVE_FSETXATTR 1
Signature · 8 lines
2.36.1.476.g0c4daa206d-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#1 lore raw

PATCH 2/2 f2fs_io: add dsync option for write

---
 tools/f2fs_io/f2fs_io.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/f2fs_io/f2fs_io.c +4 -1
index 2f0fc7b25d41..e7359836b126 100644
@@ -508,7 +508,8 @@ static void do_erase(int argc, char **argv, const struct cmd_desc *cmd)
 "  rand          : random numbers\n"			\
 "IO can be\n"						\
 "  buffered      : buffered IO\n"			\
-"  dio           : direct IO\n"				\
+"  dio           : O_DIRECT\n"				\
+"  dsync         : O_DIRECT | O_DSYNC\n"		\
 "  osync         : O_SYNC\n"				\
 "  atomic_commit : atomic write & commit\n"		\
 "  atomic_abort  : atomic write & abort\n"		\
@@ -552,6 +553,8 @@ static void do_write(int argc, char **argv, const struct cmd_desc *cmd)
 
 	if (!strcmp(argv[5], "dio"))
 		flags |= O_DIRECT;
+	else if (!strcmp(argv[5], "dsync"))
+		flags |= O_DIRECT | O_DSYNC;
 	else if (!strcmp(argv[5], "osync"))
 		flags |= O_SYNC;
 	else if (!strcmp(argv[5], "atomic_commit"))
Signature · 8 lines
2.36.1.476.g0c4daa206d-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#2 lore raw

Re: [f2fs-dev] [PATCH 2/2] f2fs_io: add dsync option for write

Quoted 10 lines · Jaegeuk Kim
---
  tools/f2fs_io/f2fs_io.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
tools/f2fs_io/f2fs_io.c +0 -0
index 2f0fc7b25d41..e7359836b126 100644

tools/f2fs_io/f2fs_io.c static void do_erase(int argc, char **argv, const struct cmd_desc *cmd) · line 512

Quoted 6 lines
tools/f2fs_io/f2fs_io.c +2 -1
@@ -508,7 +508,8 @@ static void do_erase(int argc, char **argv, const struct cmd_desc *cmd)
  "  rand          : random numbers\n"			\
  "IO can be\n"						\
  "  buffered      : buffered IO\n"			\
-"  dio           : direct IO\n"				\
+"  dio           : O_DIRECT\n"				\
+"  dsync         : O_DIRECT | O_DSYNC\n"		\

Should update manual as well.

Thanks,

tools/f2fs_io/f2fs_io.c static void do_write(int argc, char **argv, const struct cmd_desc *cmd) · line 560

Quoted 12 lines
tools/f2fs_io/f2fs_io.c +2 -0
  "  osync         : O_SYNC\n"				\
  "  atomic_commit : atomic write & commit\n"		\
  "  atomic_abort  : atomic write & abort\n"		\
@@ -552,6 +553,8 @@ static void do_write(int argc, char **argv, const struct cmd_desc *cmd)
 
  	if (!strcmp(argv[5], "dio"))
  		flags |= O_DIRECT;
+	else if (!strcmp(argv[5], "dsync"))
+		flags |= O_DIRECT | O_DSYNC;
  	else if (!strcmp(argv[5], "osync"))
  		flags |= O_SYNC;
  	else if (!strcmp(argv[5], "atomic_commit"))

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#3 lore raw

Re: [f2fs-dev] [PATCH 2/2 v2] f2fs_io: add dsync option for write

In reply to Jaegeuk Kim

This adds a write option having O_DIRECT | O_DSYNC.

---

Change log from v1:
- update man page

 man/f2fs_io.8           | 3 +++
 tools/f2fs_io/f2fs_io.c | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
man/f2fs_io.8 +3 -0
index 8a2c37489939..af7325add388 100644
@@ -76,6 +76,9 @@ buffered I/O
 .TP
 .B dio
 direct I/O
+.TP
+.B dsync
+direct I/O with O_DSYNC
 .RE
 .TP
 \fBread\fR \fI[chunk_size in 4kb] [offset in chunk_size] [count] [IO] [print_nbytes] [file_path]\fR
tools/f2fs_io/f2fs_io.c +4 -1
index 2f0fc7b25d41..e7359836b126 100644
@@ -508,7 +508,8 @@ static void do_erase(int argc, char **argv, const struct cmd_desc *cmd)
 "  rand          : random numbers\n"			\
 "IO can be\n"						\
 "  buffered      : buffered IO\n"			\
-"  dio           : direct IO\n"				\
+"  dio           : O_DIRECT\n"				\
+"  dsync         : O_DIRECT | O_DSYNC\n"		\
 "  osync         : O_SYNC\n"				\
 "  atomic_commit : atomic write & commit\n"		\
 "  atomic_abort  : atomic write & abort\n"		\
@@ -552,6 +553,8 @@ static void do_write(int argc, char **argv, const struct cmd_desc *cmd)
 
 	if (!strcmp(argv[5], "dio"))
 		flags |= O_DIRECT;
+	else if (!strcmp(argv[5], "dsync"))
+		flags |= O_DIRECT | O_DSYNC;
 	else if (!strcmp(argv[5], "osync"))
 		flags |= O_SYNC;
 	else if (!strcmp(argv[5], "atomic_commit"))
Signature · 9 lines
2.36.1.476.g0c4daa206d-goog




_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel