This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Review patches of user space kprobe


>General question:
>1) How to insert an uprobe at anonymous page (VMA)? I think there are 2 =
>cases related to the question.
>	a) Many applications execute codes produced themselves, such like JIT =
>(Just-In-Time) of JVM.

At present we do not support it, need to look into such a case.

>	b) Some executables include TEXTREL section. When they are loaded into =
>memory and linked dynamically, the text section might be changed, and =
>kernel will do a Copy-On-Write to create a new anonymous page and map =
>the new page to the process address space. So after the process starts, =
>we couldn't insert uprobe on its copied pages.
>Should a new interface be added to support it? The parameters could be =
>process id and offset in the process address space. Of course, it could =
>be an enhancement and implemented later.

User space probes support insertion of probes on dynamically linked libraries 
and even probes can be inserted on the text pages that are not even loaded
into the memory.

>3) Can function register_userspace_probe do not call register_kprobe? I =
>think it's not necessary. It's just my feeling. It's up to you to make =
>decision. :)

register_kprobe already does most of what userspace probe registeration needs.

>2) Function get_inode_ops should take care of errors and its caller, =
>register_userspace_probe should check if the return value of =
>get_inode_ops is IS_ERR. If so, the error code should be returned =
>instead of a hard-coded -ENOSYS.

Next patch release will take care of these things.

>>>>+			spin_unlock(&mapping->i_mmap_lock);
>>>>+			return vma;
>It's not safe to return vma without lock. There is a race condition. If =
>vma is released by another thread, kernel might be crazy when this =
>thread tries to access it later.

>If the page is mapped to many vma in different processes, function =
>find_get_vma just returns one vma. It's not enough.
>I'd like to suggest to do the flush_icache in the vma_prio_tree_foreach =
>loop.

could you please elaborate this.

Thanks
Prasanna
-- 
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Email: prasanna@in.ibm.com
Ph: 91-80-25044636


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]