summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Medhurst2012-10-25 04:42:03 -0500
committerJon Medhurst2012-10-26 11:07:07 -0500
commitb231fe1cde7def4857c5b8ac99c0c7a3c6725e0b (patch)
tree708052aee8d34fd47dde108e5a886ce19a38e063
parente17241f3e69b79e9470797e0dcc2a34094b542c7 (diff)
downloadarm-ds5-gator-b231fe1cde7def4857c5b8ac99c0c7a3c6725e0b.tar.gz
arm-ds5-gator-b231fe1cde7def4857c5b8ac99c0c7a3c6725e0b.tar.xz
arm-ds5-gator-b231fe1cde7def4857c5b8ac99c0c7a3c6725e0b.zip
gator-driver: Stop using VM_EXECUTABLE
In Linux 3.7, commit e9714acf (mm: kill vma flag VM_EXECUTABLE and mm->num_exe_file_vmas) breaks Gator's get_exec_cookie() as it uses the removed flag. Fix this in a similar as commit 2dd8ad81 (mm: use mm->exe_file instead of first VM_EXECUTABLE vma->vm_file) Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--driver/gator_cookies.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/driver/gator_cookies.c b/driver/gator_cookies.c
index b2ed686..21dc4eb 100644
--- a/driver/gator_cookies.c
+++ b/driver/gator_cookies.c
@@ -232,10 +232,13 @@ static inline uint32_t get_cookie(int cpu, struct task_struct *task, struct vm_a
232 if (mod) { 232 if (mod) {
233 text = mod->name; 233 text = mod->name;
234 } else { 234 } else {
235 if (!vma || !vma->vm_file) { 235 if (vma && vma->vm_file) {
236 path = &vma->vm_file->f_path;
237 } else if (task && task->mm && task->mm->exe_file) {
238 path = &task->mm->exe_file->f_path;
239 } else {
236 return INVALID_COOKIE; 240 return INVALID_COOKIE;
237 } 241 }
238 path = &vma->vm_file->f_path;
239 if (!path || !path->dentry) { 242 if (!path || !path->dentry) {
240 return INVALID_COOKIE; 243 return INVALID_COOKIE;
241 } 244 }
@@ -275,20 +278,12 @@ static int get_exec_cookie(int cpu, struct task_struct *task)
275{ 278{
276 unsigned long cookie = NO_COOKIE; 279 unsigned long cookie = NO_COOKIE;
277 struct mm_struct *mm = task->mm; 280 struct mm_struct *mm = task->mm;
278 struct vm_area_struct *vma;
279 281
280 // kernel threads have no address space 282 // kernel threads have no address space
281 if (!mm) 283 if (!mm)
282 return cookie; 284 return cookie;
283 285
284 for (vma = mm->mmap; vma; vma = vma->vm_next) { 286 cookie = get_cookie(cpu, task, NULL, NULL, true);
285 if (!vma->vm_file)
286 continue;
287 if (!(vma->vm_flags & VM_EXECUTABLE))
288 continue;
289 cookie = get_cookie(cpu, task, vma, NULL, true);
290 break;
291 }
292 287
293 return cookie; 288 return cookie;
294} 289}