Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

lsfd: *early* file path filter#3328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
masatake wants to merge4 commits intoutil-linux:master
base:master
Choose a base branch
Loading
frommasatake:lsfd--early-path-filter

Conversation

@masatake
Copy link
Member

@masatakemasatake commentedDec 13, 2024
edited
Loading

Partial solves#2567.

$  ./lsfd /dev/null | head -3COMMAND             PID   USER ASSOC  XMODE TYPE SOURCE MNTID INODE NAMEpipewire          12620 yamato     0 r-----  CHR  mem:3    34     4 /dev/nullwireplumber       12621 yamato     0 r-----  CHR  mem:3    34     4 /dev/null$  ./lsfd -- /dev/null | head -3COMMAND             PID   USER ASSOC  XMODE TYPE SOURCE MNTID INODE NAMEpipewire          12620 yamato     0 r-----  CHR  mem:3    34     4 /dev/nullwireplumber       12621 yamato     0 r-----  CHR  mem:3    34     4 /dev/null$  ./lsfd -- /dev/zero | head -3COMMAND     PID   USER ASSOC  XMODE TYPE SOURCE MNTID INODE NAMEdd      2434997 yamato     0 r-----  CHR  mem:5    34     6 /dev/zero

This feature is not implemented as a syntax-sugar for-Q.
The early filter works in the "collecting"-information stage.
I expected the early filter to work much faster than-Q 'NAME == "/dev/zero", a filter working in the "post-collecting" information stage.

# time ./lsfd | wc -l216088real0m4.811suser0m3.638ssys0m1.196s# time ./lsfd -Q 'NAME == "/dev/zero"' | wc -l5real0m1.605suser0m0.702ssys0m0.893s# time ./lsfd -- /dev/zero | wc -l5real0m0.977suser0m0.439ssys0m0.539s

However, the difference between-Q and-- was much smaller than I expected.

Is the early filter mechanism a way to go?

TODO:

  • test cases
  • update lsfd(1)

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@masatakemasatakeforce-pushed thelsfd--early-path-filter branch from2f9aa6d to494b8d8CompareJanuary 8, 2025 21:01
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@masatake

[8]ページ先頭

©2009-2025 Movatter.jp