Skip to contentSkip to conversation

f2fs: pass I_NEW flag to trace event

PATCH In review Wu Bo 4 participants 7 messages May 16, 2023 – May 18, 2023 F2FS file system

lore
Share & tools
lore

Wu Bo

author
#0 lore raw

PATCH 1/1 f2fs: pass I_NEW flag to trace event

Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the I_NEW can pass to the trace event when the inode initialised.

---
 fs/f2fs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/inode.c +1 -1
index cf4327ad106c..caf959289fe7 100644
@@ -577,8 +577,8 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino)
 		file_dont_truncate(inode);
 	}
 
-	unlock_new_inode(inode);
 	trace_f2fs_iget(inode);
+	unlock_new_inode(inode);
 	return inode;
 
 bad_inode:
Signature · 1 line
2.35.3
maintainer
#1 lore raw
Quoted 2 lines · Wu Bo

Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the I_NEW can pass to the trace event when the inode initialised.

Why is it needed? And trace_f2fs_iget() won't print inode->i_state?

Thanks,

Quoted 20 lines
---
  fs/f2fs/inode.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/inode.c +1 -1
index cf4327ad106c..caf959289fe7 100644
@@ -577,8 +577,8 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino)
  		file_dont_truncate(inode);
  	}
 
-	unlock_new_inode(inode);
  	trace_f2fs_iget(inode);
+	unlock_new_inode(inode);
  	return inode;
 
  bad_inode:
author
#2 lore raw
Quoted 5 lines · Chao Yu
Quoted 2 lines · Wu Bo

Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the I_NEW can pass to the trace event when the inode initialised.

Why is it needed? And trace_f2fs_iget() won't print inode->i_state?

When connect a trace_probe to f2fs_iget, it will be able to determine whether the inode is new initialised in order to do different process.

Quoted 29 lines

Thanks,

Quoted 11 lines
---
  fs/f2fs/inode.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/inode.c +0 -0
index cf4327ad106c..caf959289fe7 100644

fs/f2fs/inode.c struct inode *f2fs_iget(struct super_block *sb, · line 584

Quoted 8 lines
fs/f2fs/inode.c +1 -0
@@ -577,8 +577,8 @@ struct inode *f2fs_iget(struct super_block *sb,
 unsigned long ino)
          file_dont_truncate(inode);
      }
  -    unlock_new_inode(inode);
      trace_f2fs_iget(inode);
+    unlock_new_inode(inode);
      return inode;
    bad_inode:

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

maintainer
#3 lore raw
Quoted 9 lines · Wu Bo
Quoted 5 lines · Chao Yu
Quoted 2 lines · Wu Bo

Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the I_NEW can pass to the trace event when the inode initialised.

Why is it needed? And trace_f2fs_iget() won't print inode->i_state?

When connect a trace_probe to f2fs_iget, it will be able to determine whether the inode is new initialised in order to do different process.

I didn't get it, you want to hook __tracepoint_f2fs_iget() w/ your own callback?

Thanks,

Quoted 22 lines
Quoted 22 lines

Thanks,

Quoted 18 lines
---
   fs/f2fs/inode.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/inode.c +1 -0
index cf4327ad106c..caf959289fe7 100644
@@ -577,8 +577,8 @@ struct inode *f2fs_iget(struct super_block *sb,
 unsigned long ino)
           file_dont_truncate(inode);
       }
   -    unlock_new_inode(inode);
       trace_f2fs_iget(inode);
+    unlock_new_inode(inode);
       return inode;
Quoted 8 lines
Quoted 8 lines

fs/f2fs/inode.c struct inode *f2fs_iget(struct super_block *sb, unsigned long ino) · line 584

Quoted 1 line
fs/f2fs/inode.c +0 -0
     bad_inode:

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

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

#4 lore raw
Quoted 6 lines · Chao Yu
Quoted 5 lines · Wu Bo
Quoted 4 lines · Chao Yu
Quoted 2 lines · Wu Bo

Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the I_NEW can pass to the trace event when the inode initialised.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Why is it needed? And trace_f2fs_iget() won't print inode->i_state?

When connect a trace_probe to f2fs_iget, it will be able to determine whether the inode is new initialised in order to do different process.

I didn't get it, you want to hook __tracepoint_f2fs_iget() w/ your own callback?

Yes,  to use 'tracepoint_probe_register ' to register a probe at trace_f2fs_iget

Quoted 33 lines

Thanks,

Quoted 30 lines
Quoted 30 lines

Thanks,

Quoted 18 lines

---
   fs/f2fs/inode.c | 2 +-

   1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/inode.c +1 -0
index cf4327ad106c..caf959289fe7 100644
@@ -577,8 +577,8 @@ struct inode *f2fs_iget(struct super_block *sb,
 unsigned long ino)
            file_dont_truncate(inode);
        }
    -    unlock_new_inode(inode);
        trace_f2fs_iget(inode);
+    unlock_new_inode(inode);
        return inode;
Quoted 1 line

     bad_inode:

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

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

maintainer
#5 lore raw
Quoted 10 lines · Wu Bo
Quoted 9 lines · Chao Yu
Quoted 8 lines · Wu Bo
Quoted 6 lines · Chao Yu
Quoted 3 lines · Wu Bo

Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the
I_NEW can pass to the trace event when the inode initialised.

Why is it needed? And trace_f2fs_iget() won't print inode->i_state?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

When connect a trace_probe to f2fs_iget, it will be able to determine whether
the inode is new initialised in order to do different process.

I didn't get it, you want to hook __tracepoint_f2fs_iget() w/ your own callback?

Yes,  to use 'tracepoint_probe_register ' to register a probe at trace_f2fs_iget

Why?

Quoted 33 lines
Quoted 33 lines

Thanks,

Quoted 30 lines
Quoted 30 lines

Thanks,

Quoted 18 lines

---
   fs/f2fs/inode.c | 2 +-

   1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/inode.c +1 -0
index cf4327ad106c..caf959289fe7 100644
@@ -577,8 +577,8 @@ struct inode *f2fs_iget(struct super_block *sb,
 unsigned long ino)
            file_dont_truncate(inode);
        }
    -    unlock_new_inode(inode);
        trace_f2fs_iget(inode);
+    unlock_new_inode(inode);
        return inode;
Quoted 1 line

     bad_inode:

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

#6 lore raw
Quoted 9 lines · Jaegeuk Kim
Quoted 8 lines · Wu Bo
Quoted 7 lines · Chao Yu
Quoted 6 lines · Wu Bo
Quoted 5 lines · Chao Yu
Quoted 3 lines · Wu Bo

Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the
I_NEW can pass to the trace event when the inode initialised.

Why is it needed? And trace_f2fs_iget() won't print inode->i_state?

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

When connect a trace_probe to f2fs_iget, it will be able to determine whether
the inode is new initialised in order to do different process.

I didn't get it, you want to hook __tracepoint_f2fs_iget() w/ your own callback?

Yes,  to use 'tracepoint_probe_register ' to register a probe at trace_f2fs_iget

Why?

Sorry, I don't understand what is your real question.

In my understanding, a trace_event is also a  non-volatile point in kernel for probing.

And for my case, I want to develop a tool by trace_probe to collect some information.

Thanks

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines

Thanks,

Quoted 18 lines
Quoted 18 lines

Thanks,

Quoted 16 lines
---
    fs/f2fs/inode.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/inode.c +1 -0
index cf4327ad106c..caf959289fe7 100644
@@ -577,8 +577,8 @@ struct inode *f2fs_iget(struct super_block *sb,
 unsigned long ino)
            file_dont_truncate(inode);
        }
    -    unlock_new_inode(inode);
        trace_f2fs_iget(inode);
+    unlock_new_inode(inode);
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

fs/f2fs/inode.c struct inode *f2fs_iget(struct super_block *sb, unsigned long ino) · line 584

Quoted 2 lines
fs/f2fs/inode.c +0 -0
        return inode;
      bad_inode:

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

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