fs: Add Kernel-level VFS Performance Profiler#18607
Conversation
6cbaa23 to
b34527a
Compare
cederom
left a comment
There was a problem hiding this comment.
- Thank you @Sumit6307 very nice idea! :-)
- My remarks noted in the code.
- We should align the nomenclature
PROFILEvsPROFILER(second seems better suited imho), as both names are used for the same functionality. MaybePERForPERFPROFwould clearly indicate performance profiler? - Please also provide simple
nuttx/Documentationfor the new functionality.
|
@Sumit6307 why are you including mnemofs commit here? |
Yup, I would put that into a separate PR too :-P |
|
@Sumit6307 why not reuse sched_note syscall to profile fs performance? you can learn from Documentation |
b34527a to
f8a783e
Compare
14dee63 to
472b99f
Compare
This adds a kernel-level performance profiler for the VFS. By enabling CONFIG_FS_PROFILER, the core VFS system calls (file_read, file_write, file_open, and file_close) are instrumented to track high-resolution execution times using clock_systime_timespec() seamlessly. The collected statistics are exposed dynamically via a new procfs node at /proc/fs/profile, allowing CI regression testing without needing external debugging tools. Signed-off-by: Sumit6307 <sumitkesar6307@gmail.com>
472b99f to
1fd8903
Compare
|
@xiaoxiang781216 All final cleanup and refactoring is complete:
The PR is now ready for final review. |
cederom
left a comment
There was a problem hiding this comment.
Thank you @Sumit6307 great work! :-)
|
@acassis If everything looks good and correct now, please merge this PR. |
@Sumit6307 yes, but since @anchao added a Change Request, we need an approval from him to merge this PR |
|
Hi @anchao, I’ve addressed all the requested changes and updated the PR accordingly. Could you please review the latest changes and approve if everything looks good? Once approved, we can proceed with merging. Thanks |
@acassis |
|
@Sumit6307 sure, if the reviewer disappear for few weeks, we can dismiss their Change Request, let way more few days, maybe he is busy |
Okay Sir @acassis |
|
@acassis I’ve been actively contributing to Apache and the NuttX project and have a good understanding of its structure and workflows. Also, from your perspective, does my approach align well with what you're looking for in GSoC? |
Dismissed because more than 2 week has passed without reviewer return
Hi @Sumit6307, yes I reviewed your proposal and it was submitted and ranked correctly. However we don't know many projects will be approved, since Apache Software Foundation reserves only 2 slot for each project. |
Hi @acassis Sir, Since submitting the proposal, I have continued contributing and recently got a few more PRs merged, including: apache/incubator-seata#7981 I also have a couple of PRs currently under review which should be merged soon. I wanted to ask if these recent contributions after proposal submission are also considered during the evaluation process. I’ve been actively contributing across Apache Software Foundation projects and continuing to deepen my understanding of Apache NuttX. Please let me know if there’s anything else I can improve or work on. |
@Sumit6307 I'm on a short break recently. Congrats on getting this PR merged. |
@anchao |
|
@acassis |
This year we had many proposals and candidates and unfortunately ASF receives only about 27 to divide with all projects. And keep in mind that you applied to Multi-user Support project that had a more stronger candidate (Abhishek), he is also a great contributor like you, and his proposal was perfect. We wanted that all contributors and candidates get selected, but unfortunately ASF have very few slots, compared to amount of projects under their umbrella. |
@acassis I just wanted to say that I also gave my full effort, understood the codebase, contributed consistently, and felt that I was also a deserving candidate, but still I was not selected. Thank you for explaining this clearly and for guiding me throughout the process. |
Note: Please adhere to Contributing Guidelines.
Summary
Currently, assessing the latency or throughput of VFS operations requires external tools, ad-hoc test apps, or complex debug setups. This makes automated performance regression testing in CI difficult.
This PR introduces a Kernel-level VFS Performance Profiler to address this gap.
By enabling the new
CONFIG_FS_PROFILERconfiguration, the core VFS system calls (file_read, file_write, file_open, and file_close) are instrumented to track high-resolution execution times (in nanoseconds) and invocation counts seamlessly usingclock_systime_timespec().The collected statistics are exposed dynamically via a new procfs node at
/proc/fs/profile. This enables any testing script, CI workflow, or user-space application to effortlessly monitor filesystem performance bottlenecks and catch regressions.Impact
cat /proc/fs/profile.CONFIG_FS_PROFILER). When disabled, code size and performance impact are exactly zero.enter_critical_section) to ensure SMP (multi-core) scaling is not bottlenecked.Testing
Tested on Host: Windows 11 (via WSL2).
Tested on Board:
sim:nsh(NuttX Simulator).Test procedure:
CONFIG_FS_PROFILER=yandCONFIG_FS_PROCFS=y.Test Log: