public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [patch] Alter syscall.brk and syscall.mremap to support IA64
@ 2007-09-18 14:20 Lai Jiangshan
  2007-09-18 16:31 ` Wenji Huang
  0 siblings, 1 reply; 4+ messages in thread
From: Lai Jiangshan @ 2007-09-18 14:20 UTC (permalink / raw)
  To: systemtap

Hi, all
     In the current tapset, kernel function sys_brk and sys_mremap are
used to probe syscall.brk and syscall.mremap. But on IA64, the entries
of syscall brk and mremap are actually ia64_brk and ia64_mremap, but not
sys_brk and sys_mremap. Though I think ia64's kernel function will be
finally changed to sys_brk and sys_mremap, it will be a long time so it
is inconvenient for users to probe these 2 syscalls on IA64. So I added
the probe points to syscall.brk and syscall.mremap for IA64 as following:

diff -Nur /usr/share/systemtap/tapset/syscalls.stp tapset/syscalls.stp
--- /usr/share/systemtap/tapset/syscalls.stp	2007-09-18 10:11:15.000000000 +0900
+++ tapset/syscalls.stp	2007-09-18 12:07:19.000000000 +0900
@@ -178,12 +178,14 @@
 
 # brk ________________________________________________________
 # unsigned long sys_brk(unsigned long brk)
-probe syscall.brk = kernel.function("sys_brk") {
+probe syscall.brk = kernel.function("sys_brk"),
+		kernel.function("ia64_brk") ? {
 	name = "brk"
 	brk = $brk
 	argstr = sprintf("%p", brk)
 }
-probe syscall.brk.return = kernel.function("sys_brk").return {
+probe syscall.brk.return = kernel.function("sys_brk").return,
+		kernel.function("ia64_brk").return ? {
 	name = "brk"
 	retstr = returnstr(1)
 }
@@ -2546,7 +2548,8 @@
 #            unsigned long flags,
 #            unsigned long new_addr)
 #
-probe syscall.mremap = kernel.function("sys_mremap") {
+probe syscall.mremap = kernel.function("sys_mremap"),
+		kernel.function("ia64_mremap") ? {
 	name = "mremap"
 	old_address = $addr
 	old_size = $old_len
@@ -2556,7 +2559,8 @@
 	argstr = sprintf("%p, %d, %d, %s, %p", $addr, $old_len, $new_len,
 		_mmap_flags($flags), $new_addr)
 }
-probe syscall.mremap.return = kernel.function("sys_mremap").return {
+probe syscall.mremap.return = kernel.function("sys_mremap").return,
+		kernel.function("ia64_mremap").return ? {
 	name = "mremap"
 	retstr = returnstr(2)
 }



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Alter syscall.brk and syscall.mremap to support IA64
  2007-09-18 14:20 [patch] Alter syscall.brk and syscall.mremap to support IA64 Lai Jiangshan
@ 2007-09-18 16:31 ` Wenji Huang
  2007-09-19  9:30   ` Lai Jiangshan
  0 siblings, 1 reply; 4+ messages in thread
From: Wenji Huang @ 2007-09-18 16:31 UTC (permalink / raw)
  To: Lai Jiangshan; +Cc: systemtap

Lai Jiangshan wrote:

> Hi, all
>     In the current tapset, kernel function sys_brk and sys_mremap are
> used to probe syscall.brk and syscall.mremap. But on IA64, the entries
> of syscall brk and mremap are actually ia64_brk and ia64_mremap, but not
> sys_brk and sys_mremap. Though I think ia64's kernel function will be
> finally changed to sys_brk and sys_mremap, it will be a long time so it
> is inconvenient for users to probe these 2 syscalls on IA64. So I added
> the probe points to syscall.brk and syscall.mremap for IA64 as following:
>
> diff -Nur /usr/share/systemtap/tapset/syscalls.stp tapset/syscalls.stp
> --- /usr/share/systemtap/tapset/syscalls.stp    2007-09-18 
> 10:11:15.000000000 +0900
> +++ tapset/syscalls.stp    2007-09-18 12:07:19.000000000 +0900
> @@ -178,12 +178,14 @@
>
> # brk ________________________________________________________
> # unsigned long sys_brk(unsigned long brk)
> -probe syscall.brk = kernel.function("sys_brk") {
> +probe syscall.brk = kernel.function("sys_brk"),
> +        kernel.function("ia64_brk") ? {
>     name = "brk"
>     brk = $brk
>     argstr = sprintf("%p", brk)
> }

sys_brk is generic, use %( arch == "ia64" %? to make it optional. Of 
course, it is better to put architecture depended probe into the 
corresponding directory.

Regards,
wenji

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Alter syscall.brk and syscall.mremap to support IA64
  2007-09-18 16:31 ` Wenji Huang
@ 2007-09-19  9:30   ` Lai Jiangshan
  2007-09-25 15:17     ` Lai Jiangshan
  0 siblings, 1 reply; 4+ messages in thread
From: Lai Jiangshan @ 2007-09-19  9:30 UTC (permalink / raw)
  To: Wenji Huang; +Cc: systemtap


Wenji Huang wrote:
> Lai Jiangshan wrote:
> 
>> Hi, all
>>     In the current tapset, kernel function sys_brk and sys_mremap are
>> used to probe syscall.brk and syscall.mremap. But on IA64, the entries
>> of syscall brk and mremap are actually ia64_brk and ia64_mremap, but not
>> sys_brk and sys_mremap. Though I think ia64's kernel function will be
>> finally changed to sys_brk and sys_mremap, it will be a long time so it
>> is inconvenient for users to probe these 2 syscalls on IA64. So I added
>> the probe points to syscall.brk and syscall.mremap for IA64 as following:
>>
> 
> sys_brk is generic, use %( arch == "ia64" %? to make it optional. Of 
> course, it is better to put architecture depended probe into the 
> corresponding directory.


    I think "?" ( kernel.function("ia64_brk") ? ) is better than "arch",
because it's  more neat and it will not cause error even ia64_brk and
ia64_mremap is changed to sys_brk and sys_mremap on IA64 (I think it is
of high possibility).

    Putting architecture-depended probe into the corresponding directory
is also nice, but I think the two probe points must be deleted from
tapset/syscall.stp if modify it as you suggested. Also the problem
mentioned above will exist.

    So, I think it will be better to modify the tapset in my way. 

Regards,
LaiJiangshan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Alter syscall.brk and syscall.mremap to support IA64
  2007-09-19  9:30   ` Lai Jiangshan
@ 2007-09-25 15:17     ` Lai Jiangshan
  0 siblings, 0 replies; 4+ messages in thread
From: Lai Jiangshan @ 2007-09-25 15:17 UTC (permalink / raw)
  To: systemtap; +Cc: Wenji Huang

Lai Jiangshan wrote:
> 
> Wenji Huang wrote:
>> Lai Jiangshan wrote:
>>
>>> Hi, all
>>>     In the current tapset, kernel function sys_brk and sys_mremap are
>>> used to probe syscall.brk and syscall.mremap. But on IA64, the entries
>>> of syscall brk and mremap are actually ia64_brk and ia64_mremap, but not
>>> sys_brk and sys_mremap. Though I think ia64's kernel function will be
>>> finally changed to sys_brk and sys_mremap, it will be a long time so it
>>> is inconvenient for users to probe these 2 syscalls on IA64. So I added
>>> the probe points to syscall.brk and syscall.mremap for IA64 as 
>>> following:
>>> ......
>>
>> sys_brk is generic, use %( arch == "ia64" %? to make it optional. Of 
>> course, it is better to put architecture depended probe into the 
>> corresponding directory.
> 
>  ......
> 
>    So, I think it will be better to modify the tapset in my way.

Hi, all
    I will ask zhaolei to commit it if there is no more objection.

    This patch has no any bad effect to current tapset. It just like adding
following code in c. It is of no effect even if the "condition" cannot be
true someday.

    if (condtion) {
        do_something;
    }

Best regards!
Lai Jiangshan 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-25  3:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-18 14:20 [patch] Alter syscall.brk and syscall.mremap to support IA64 Lai Jiangshan
2007-09-18 16:31 ` Wenji Huang
2007-09-19  9:30   ` Lai Jiangshan
2007-09-25 15:17     ` Lai Jiangshan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).