As root, I try to attach strace to a running kworker process, without success.

      root@rasal# whoami
      root@rasal:/# cat  /proc/sys/kernel/yama/ptrace_scope
      root@rasal:/# ps ax | grep kworker
            1030 ?        S<     0:00 [kworker/u17:0]
      root@rasal:/# strace -fp 1030
            strace: attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted
            Could not attach to process.  If your uid matches the uid of the target
            process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
            again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf

The etc/sysctl.d/10-ptrace.conf file simply states:

A PTRACE scope of "0" is the more permissive mode.

This is exactly what I have, see above. Is there any reason why this should fail? Or is this a bug?


The kworker "process" that you show is a kernel thread and not a normal process. There is no userspace portion for it and thus no syscalls. Even if it worked it couldn't possibly show anything.

On top of everything else, I guess that tracing kernel threads (under whatever fictional scenario one can imagine) would most probably freeze the system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.