如何查看tumblerd当前正在处理的文件?
Hey there! I totally get the frustration when tumblerd starts hogging your CPU after cloning a large folder—let's figure out which file it's stuck on with these straightforward methods:
方法1:使用 lsof 查看已打开的文件
lsof (List Open Files) is a handy tool that shows all files a process has open. Here's how to use it for tumblerd:
- First, get the process ID (PID) of tumblerd with
pidof tumblerd(this will output a number like1234). - Then run:
lsof -p [PID](replace[PID]with the number you got). - To narrow it down to actual files (not system-related entries), add a filter:
lsof -p [PID] | grep -E "(REG|DIR)"
Look for entries marked with READ in the MODE column—those are likely the files tumblerd is generating thumbnails for right now.
方法2:用 strace 实时追踪文件打开操作
strace traces system calls made by a process, so you can see exactly which files tumblerd is accessing as it works:
- Run:
strace -p $(pidof tumblerd) -e open,openat - This will output lines like
openat(AT_FDCWD, "/path/to/your/file.jpg", O_RDONLY|O_CLOEXEC) = 12in real-time, showing each file tumblerd tries to open.
Note: This might spit out a lot of lines if tumblerd is processing many files, but the most recent entry will be the current file it's working on.
方法3:启用tumblerd的调试日志
If you want more detailed context about what tumblerd is doing, you can enable debug logging:
- First, kill the running tumblerd process:
kill $(pidof tumblerd) - Then restart it with debug flags:
tumblerd --debug 2>&1 | grep "Loading file" - This will print messages like
Loading file: /path/to/your/document.pdfevery time it starts processing a new file.
That should help you pinpoint exactly which file is keeping tumblerd busy!
备注:内容来源于stack exchange,提问作者J. Mini

