* [Patch]Fix the bug of missing definition of argstr and retstr
@ 2007-08-17 2:41 Cai Fei
2007-08-17 3:21 ` Frank Ch. Eigler
0 siblings, 1 reply; 7+ messages in thread
From: Cai Fei @ 2007-08-17 2:41 UTC (permalink / raw)
To: systemtap
Hi, all
After adding definition of pid and argstr for syscall getpgid, I checked
the tapset
for other syscalls. The same problems of missing definition of argstr
and retstr exist.
So I added them all:
diff -Nur systemtap-20070811/tapset/syscalls2.stp systemtap-20070811new/tapset/syscalls2.stp
--- systemtap-20070811/tapset/syscalls2.stp 2007-08-17 10:21:34.000000000 +0900
+++ systemtap-20070811new/tapset/syscalls2.stp 2007-08-17 10:25:10.000000000 +0900
@@ -2147,6 +2147,7 @@
kernel.function("sys32_sigreturn").return ?
{
name = "sigreturn"
+ retstr = returnstr(1)
}
# sigsuspend _________________________________________________
diff -Nur systemtap-20070811/tapset/syscalls.stp systemtap-20070811new/tapset/syscalls.stp
--- systemtap-20070811/tapset/syscalls.stp 2007-08-17 10:18:12.000000000 +0900
+++ systemtap-20070811new/tapset/syscalls.stp 2007-08-17 10:24:46.000000000 +0900
@@ -1116,6 +1116,7 @@
kernel.function("sys_getegid")
{
name = "getegid"
+ argstr = ""
}
probe syscall.getegid.return =
kernel.function("sys_getegid16").return ?,
@@ -1136,6 +1137,7 @@
kernel.function("sys_geteuid")
{
name = "geteuid"
+ argstr = ""
}
probe syscall.geteuid.return =
kernel.function("sys_geteuid16").return ?,
@@ -1156,6 +1158,7 @@
kernel.function("sys_getgid")
{
name = "getgid"
+ argstr = ""
}
probe syscall.getgid.return =
kernel.function("sys_getgid16").return ?,
@@ -1282,6 +1285,7 @@
# long sys_getpgrp(void)
probe syscall.getpgrp = kernel.function("sys_getpgrp") ? {
name = "getpgrp"
+ argstr = ""
}
probe syscall.getpgrp.return = kernel.function("sys_getpgrp").return ? {
name = "getpgrp"
@@ -1292,6 +1296,7 @@
# long sys_getpid(void)
probe syscall.getpid = kernel.function("sys_getpid") {
name = "getpid"
+ argstr = ""
}
probe syscall.getpid.return = kernel.function("sys_getpid").return {
name = "getpid"
@@ -1302,9 +1307,11 @@
# long sys_getppid(void)
probe syscall.getppid = kernel.function("sys_getppid") {
name = "getppid"
+ argstr = ""
}
probe syscall.getppid.return = kernel.function("sys_getppid").return {
name = "getppid"
+ retstr = returnstr(1)
}
# getpriority ________________________________________________
@@ -1466,6 +1473,7 @@
# long sys_gettid(void)
probe syscall.gettid = kernel.function("sys_gettid") {
name = "gettid"
+ argstr = ""
}
probe syscall.gettid.return = kernel.function("sys_gettid").return {
name = "gettid"
@@ -1510,6 +1518,7 @@
kernel.function("sys_getuid")
{
name = "getuid"
+ argstr = ""
}
probe syscall.getuid.return =
kernel.function("sys_getuid16").return ?,
@@ -2546,6 +2555,7 @@
# long sys_munlockall(void)
probe syscall.munlockall = kernel.function("sys_munlockall") {
name = "munlockall"
+ argstr = ""
}
probe syscall.munlockall.return = kernel.function("sys_munlockall").return {
name = "munlockall"
Regards, Cai Fei
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch]Fix the bug of missing definition of argstr and retstr
2007-08-17 2:41 [Patch]Fix the bug of missing definition of argstr and retstr Cai Fei
@ 2007-08-17 3:21 ` Frank Ch. Eigler
2007-08-17 4:01 ` Cai Fei
0 siblings, 1 reply; 7+ messages in thread
From: Frank Ch. Eigler @ 2007-08-17 3:21 UTC (permalink / raw)
To: Cai Fei; +Cc: systemtap
Cai Fei <caifei@cn.fujitsu.com> writes:
> [...]
> After adding definition of pid and argstr for syscall getpgid, I
> checked the tapset
> for other syscalls. The same problems of missing definition of argstr
> and retstr exist.
There is generally no need to create variables that simply carry empty
strings. The translator will do that automatically if necessary.
>
> kernel.function("sys_getegid")
> {
> name = "getegid"
> + argstr = ""
> }
The only substantial effect of this is to prevent a probe based on
this alias from using "argstr" as a *numeric* variable.
- FChE
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch]Fix the bug of missing definition of argstr and retstr
2007-08-17 3:21 ` Frank Ch. Eigler
@ 2007-08-17 4:01 ` Cai Fei
2007-08-17 6:55 ` Frank Ch. Eigler
0 siblings, 1 reply; 7+ messages in thread
From: Cai Fei @ 2007-08-17 4:01 UTC (permalink / raw)
To: Frank Ch. Eigler; +Cc: systemtap
Frank Ch. Eigler wrote:
> Cai Fei <caifei@cn.fujitsu.com> writes:
>
>
>> [...]
>> After adding definition of pid and argstr for syscall getpgid, I
>> checked the tapset
>> for other syscalls. The same problems of missing definition of argstr
>> and retstr exist.
>>
>
> There is generally no need to create variables that simply carry empty
> strings. The translator will do that automatically if necessary.
>
>
My probe definition is :
probe syscall.getpid {
log(sprint(argstr))
}
I used it for tracing syscall getpid, and the following error occured:
Pass 1: parsed user script and 54 library script(s) in
397usr/2sys/399real ms.
semantic error: probe_1526 with unresolved type for identifier 'argstr'
at getpid.stp:2:13
......
But it works well if I change it to
probe syscall.getpid {
log(sprintf("%s\n", argstr))
}
So I think it's better to add all these argstr definitions.
>> kernel.function("sys_getegid")
>> {
>> name = "getegid"
>> + argstr = ""
>> }
>>
>
> The only substantial effect of this is to prevent a probe based on
> this alias from using "argstr" as a *numeric* variable.
>
>
> - FChE
>
>
>
--
A new email address of FJWAN is launched from Apr.1 2007.
The updated address is: caifei@cn.fujitsu.com
--------------------------------------------------
Cai Fei
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
caifei@cn.fujitsu.com (å
7551-5875)
--------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch]Fix the bug of missing definition of argstr and retstr
2007-08-17 4:01 ` Cai Fei
@ 2007-08-17 6:55 ` Frank Ch. Eigler
2007-08-17 6:55 ` Cai Fei
2007-08-20 7:22 ` Cai Fei
0 siblings, 2 replies; 7+ messages in thread
From: Frank Ch. Eigler @ 2007-08-17 6:55 UTC (permalink / raw)
To: Cai Fei; +Cc: systemtap
Hi -
On Fri, Aug 17, 2007 at 12:09:59PM +0900, Cai Fei wrote:
> My probe definition is :
> probe syscall.getpid {
> log(sprint(argstr))
> }
Why not just "log(argstr)" ?
> [...]
> So I think it's better to add all these argstr definitions.
Sure, there is no problem adding them, except that they make the
tapset file larger.
- FChE
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch]Fix the bug of missing definition of argstr and retstr
2007-08-17 6:55 ` Frank Ch. Eigler
@ 2007-08-17 6:55 ` Cai Fei
2007-08-17 16:36 ` Stone, Joshua I
2007-08-20 7:22 ` Cai Fei
1 sibling, 1 reply; 7+ messages in thread
From: Cai Fei @ 2007-08-17 6:55 UTC (permalink / raw)
To: Frank Ch. Eigler; +Cc: systemtap
Frank Ch. Eigler wrote:
> Hi -
>
> On Fri, Aug 17, 2007 at 12:09:59PM +0900, Cai Fei wrote:
>
>> My probe definition is :
>> probe syscall.getpid {
>> log(sprint(argstr))
>> }
>>
>
> Why not just "log(argstr)" ?
>
>
I used sprint so that numeric and non-numeric arguments can both be
outputted
in the same way.
>> [...]
>> So I think it's better to add all these argstr definitions.
>>
>
> Sure, there is no problem adding them, except that they make the
> tapset file larger.
>
> - FChE
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [Patch]Fix the bug of missing definition of argstr and retstr
2007-08-17 6:55 ` Cai Fei
@ 2007-08-17 16:36 ` Stone, Joshua I
0 siblings, 0 replies; 7+ messages in thread
From: Stone, Joshua I @ 2007-08-17 16:36 UTC (permalink / raw)
To: Cai Fei, Frank Ch. Eigler; +Cc: systemtap
Cai Fei wrote:
> Frank Ch. Eigler wrote:
>> Hi -
>>
>> On Fri, Aug 17, 2007 at 12:09:59PM +0900, Cai Fei wrote:
>>
>>> My probe definition is :
>>> probe syscall.getpid {
>>> log(sprint(argstr))
>>> }
>>>
>>
>> Why not just "log(argstr)" ?
>>
>>
> I used sprint so that numeric and non-numeric arguments can both be
> outputted in the same way.
With bug #4591 resolved, you can now use println() for this.
Josh
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch]Fix the bug of missing definition of argstr and retstr
2007-08-17 6:55 ` Frank Ch. Eigler
2007-08-17 6:55 ` Cai Fei
@ 2007-08-20 7:22 ` Cai Fei
1 sibling, 0 replies; 7+ messages in thread
From: Cai Fei @ 2007-08-20 7:22 UTC (permalink / raw)
To: Frank Ch. Eigler; +Cc: systemtap
Hi, Frank.
Frank Ch. Eigler wrote:
> Hi -
>
>
>> [...]
>> So I think it's better to add all these argstr definitions.
>>
>
> Sure, there is no problem adding them, except that they make the
> tapset file larger.
>
Does that mean you will add them? Or not? Sorry for the language question.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-08-20 0:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-17 2:41 [Patch]Fix the bug of missing definition of argstr and retstr Cai Fei
2007-08-17 3:21 ` Frank Ch. Eigler
2007-08-17 4:01 ` Cai Fei
2007-08-17 6:55 ` Frank Ch. Eigler
2007-08-17 6:55 ` Cai Fei
2007-08-17 16:36 ` Stone, Joshua I
2007-08-20 7:22 ` Cai Fei
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).