mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 07:30:54 +00:00
Update to work with new vm_operations interface from 2.6.23. Patch from
Sun Sep 14 16:04:17 2008 Søren Sandmann <sandmann@redhat.com> * sysprof/module/sysprof-module.c: Update to work with new vm_operations interface from 2.6.23. Patch from Chris Wilson. svn path=/trunk/; revision=435
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
e11dfce31f
commit
b060e05909
@ -1,3 +1,8 @@
|
|||||||
|
Sun Sep 14 16:04:17 2008 Søren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
|
* sysprof/module/sysprof-module.c: Update to work with new
|
||||||
|
vm_operations interface from 2.6.23. Patch from Chris Wilson.
|
||||||
|
|
||||||
Wed Jun 4 21:52:17 2008 Søren Sandmann <sandmann@redhat.com>
|
Wed Jun 4 21:52:17 2008 Søren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
* demangle.c: Apply patch from binutils to demangle local-source
|
* demangle.c: Apply patch from binutils to demangle local-source
|
||||||
|
|||||||
@ -459,6 +459,29 @@ sysprof_open(struct inode *inode, struct file *file)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
|
||||||
|
static int
|
||||||
|
sysprof_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||||
|
{
|
||||||
|
unsigned long area_start;
|
||||||
|
unsigned long virt;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
printk (KERN_ALERT "fault called: %p (offset: %d) area: %p\n", vmf->virtual_address, addr - vma->vm_start, area);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
area_start = (unsigned long)area;
|
||||||
|
|
||||||
|
virt = area_start + ((unsigned long)vmf->virtual_address - vma->vm_start);
|
||||||
|
if (virt > area_start + sizeof (SysprofMmapArea))
|
||||||
|
return VM_FAULT_SIGBUS;
|
||||||
|
|
||||||
|
vmf->page = vmalloc_to_page ((void *)virt);
|
||||||
|
get_page (vmf->page);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
static struct page *
|
static struct page *
|
||||||
sysprof_nopage(struct vm_area_struct *vma, unsigned long addr, int *type)
|
sysprof_nopage(struct vm_area_struct *vma, unsigned long addr, int *type)
|
||||||
{
|
{
|
||||||
@ -486,12 +509,17 @@ sysprof_nopage(struct vm_area_struct *vma, unsigned long addr, int *type)
|
|||||||
|
|
||||||
return page_ptr;
|
return page_ptr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sysprof_mmap(struct file *filp, struct vm_area_struct *vma)
|
sysprof_mmap(struct file *filp, struct vm_area_struct *vma)
|
||||||
{
|
{
|
||||||
static struct vm_operations_struct ops = {
|
static struct vm_operations_struct ops = {
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
|
||||||
|
.fault = sysprof_fault,
|
||||||
|
#else
|
||||||
.nopage = sysprof_nopage,
|
.nopage = sysprof_nopage,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
if (vma->vm_flags & (VM_WRITE | VM_EXEC))
|
if (vma->vm_flags & (VM_WRITE | VM_EXEC))
|
||||||
|
|||||||
Reference in New Issue
Block a user