This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: Patch [3/3] Userspace probes single stepping out-of-line
- From: "Zhang, Yanmin" <yanmin dot zhang at intel dot com>
- To: <prasanna at in dot ibm dot com>
- Cc: <systemtap at sources dot redhat dot com>, "Keshavamurthy, Anil S" <anil dot s dot keshavamurthy at intel dot com>, "Mao, Bibo" <bibo dot mao at intel dot com>
- Date: Thu, 2 Feb 2006 15:37:51 +0800
- Subject: RE: Patch [3/3] Userspace probes single stepping out-of-line
>>-----Original Message-----
>>From: Prasanna S Panchamukhi [mailto:prasanna@in.ibm.com]
>>Sent: 2006年1月30日 16:45
>>To: Zhang, Yanmin
>>Cc: systemtap@sources.redhat.com; Keshavamurthy, Anil S; Mao, Bibo
>>Subject: Re: Patch [3/3] Userspace probes single stepping out-of-line
>>
>>> >>+ if (((stack_addr - sizeof(long long)) - page_addr) < size)
>>> If stack_addr==page_addr, above is always false because they are unsigned long. Pls. change it to:
>>> if ((stack_addr - sizeof(long long)) < (page_addr + size))
>>
>>ok.
>>
>>> >>+ return -ENOMEM;
>>> >>+
>>> >>+ if (__copy_to_user_inatomic((unsigned long *)(page_addr + size),
>>> Should (page_addr + size) is just page_addr?
>>
>>yes, it should be page_addr.
>>
>>> >>+ } else if (vma->vm_flags & VM_GROWSUP) {
>>> >>+ page_addr = (stack_addr & PAGE_MASK) + PAGE_SIZE;
>>> It's weird to get the page align by this approach. Not accurate.
>>
>>Could you please suggest appropriate approach for this?
[YM] page_addr = (stack_addr + PAGE_SIZE -1) & PAGE_MASK;