c - task_pid_nr(current) returns a pid that doesn't appear in the output of ps -
within linux kernel (4.5.5), have added printk()
mm/filemap.c.
the code have added inside of __generic_file_write_iter()
:
if(io_tracing_on) { ssize_t write_size = iov_length(from->iov, from->nr_segs); printk(kern_info "write size=%zu, pid=%d, inode=%lu\n", write_size, task_pid_nr(current), inode->i_ino); }
when io_tracing_on
evaluates true, continuous stream of output (discussed in different question) follows:
jun 27 15:00:41 malka kernel: [ 463.424155] write size=168, pid=715, inode=7864653 jun 27 15:00:41 malka kernel: [ 463.428064] write size=168, pid=715, inode=7864354
during continuous stream of output, have tried map pid (715) output of ps -ef
, no avail -- pid not exist in process list. there way me determine process task_pid_nr(current)
referring to?
the pid in kernel have little bit different meaning, should use tgid match pid userspace perspective
Comments
Post a Comment