• Oleg Nesterov's avatar
    uprobes: Reintroduce uprobe_consumer->filter() · 8a7f2fa0
    Oleg Nesterov authored
    Finally add uprobe_consumer->filter() and change consumer_filter()
    to actually call this method.
    
    Note that ->filter() accepts mm_struct, not task_struct. Because:
    
    	1. We do not have for_each_mm_user(mm, task).
    
    	2. Even if we implement for_each_mm_user(), ->filter() can
    	   use it itself.
    
    	3. It is not clear who will actually need this interface to
    	   do the "nontrivial" filtering.
    
    Another argument is "enum uprobe_filter_ctx", consumer->filter() can
    use it to figure out why/where it was called. For example, perhaps
    we can add UPROBE_FILTER_PRE_REGISTER used by build_map_info() to
    quickly "nack" the unwanted mm's. In this case consumer should know
    that it is called under ->i_mmap_mutex.
    
    See the previous discussion at http://marc.info/?t=135214229700002
    Perhaps we should pass more arguments, vma/vaddr?
    
    Note: this patch obviously can't help to filter out the child created
    by fork(), this will be addressed later.
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
    8a7f2fa0
uprobes.c 38.6 KB