]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/oprofile/buffer_sync.c
mm: use mm->exe_file instead of first VM_EXECUTABLE vma->vm_file
[karo-tx-linux.git] / drivers / oprofile / buffer_sync.c
index f34b5b29fb955cb3129dd38f15296583ce64ff5e..d93b2b6b1f7a2b3598bb8fcc3bb9ba4d2231e626 100644 (file)
@@ -216,7 +216,7 @@ static inline unsigned long fast_get_dcookie(struct path *path)
 }
 
 
-/* Look up the dcookie for the task's first VM_EXECUTABLE mapping,
+/* Look up the dcookie for the task's mm->exe_file,
  * which corresponds loosely to "application name". This is
  * not strictly necessary but allows oprofile to associate
  * shared-library samples with particular applications
@@ -224,21 +224,10 @@ static inline unsigned long fast_get_dcookie(struct path *path)
 static unsigned long get_exec_dcookie(struct mm_struct *mm)
 {
        unsigned long cookie = NO_COOKIE;
-       struct vm_area_struct *vma;
-
-       if (!mm)
-               goto out;
 
-       for (vma = mm->mmap; vma; vma = vma->vm_next) {
-               if (!vma->vm_file)
-                       continue;
-               if (!(vma->vm_flags & VM_EXECUTABLE))
-                       continue;
-               cookie = fast_get_dcookie(&vma->vm_file->f_path);
-               break;
-       }
+       if (mm && mm->exe_file)
+               cookie = fast_get_dcookie(&mm->exe_file->f_path);
 
-out:
        return cookie;
 }