public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Correct misnamed and remove superfluous variables in syscalls.stp.
@ 2009-05-18 23:36 Przemyslaw Pawelczyk
  2009-05-19  0:17 ` Josh Stone
  0 siblings, 1 reply; 4+ messages in thread
From: Przemyslaw Pawelczyk @ 2009-05-18 23:36 UTC (permalink / raw)
  To: systemtap

In syscall.(faccess|fchmod|fchown|link|mknod)at probe points:
- Rename variables accordingly to argument names used in man pages.
- Remove string-formatted integer variables.
---
 tapset/syscalls.stp |   57 ++++++++++++++++++--------------------------------
 1 files changed, 21 insertions(+), 36 deletions(-)

diff --git a/tapset/syscalls.stp b/tapset/syscalls.stp
index 0eaf84c..aa265cd 100644
--- a/tapset/syscalls.stp
+++ b/tapset/syscalls.stp
@@ -712,13 +712,11 @@ probe syscall.exit_group = kernel.function("SyS_exit_group") !,
 probe syscall.faccessat = kernel.function("SyS_faccessat") !,
 		kernel.function("sys_faccessat") ? {
 	name = "faccessat"
-	dfd = $dfd
-	dfd_str = _dfd_str($dfd)
-	filename = $filename
-	filename_str = user_string($filename)
+	dirfd = $dfd
+	pathname = user_string($filename)
 	mode = $mode
 	mode_str = _access_mode_str($mode)
-	argstr = sprintf("%s, %s, %s", dfd_str, user_string_quoted($filename), mode_str)
+	argstr = sprintf("%s, %s, %s", _dfd_str($dfd), user_string_quoted($filename), mode_str)
 }
 probe syscall.faccessat.return = kernel.function("SyS_faccessat").return !,
 		kernel.function("sys_faccessat").return ? {
@@ -838,12 +836,10 @@ probe syscall.fchmod.return = kernel.function("SyS_fchmod").return !,
 probe syscall.fchmodat = kernel.function("SyS_fchmodat") !,
 		kernel.function("sys_fchmodat") ? {
 	name = "fchmodat"
-	dfd = $dfd
-	dfd_str = _dfd_str($dfd)
-	filename = $filename
-	filename_str = user_string($filename)
+	dirfd = $dfd
+	pathname = user_string($filename)
 	mode = $mode
-	argstr = sprintf("%s, %s, %#o", dfd_str, user_string_quoted($filename), $mode)
+	argstr = sprintf("%s, %s, %#o", _dfd_str($dfd), user_string_quoted($filename), $mode)
 }
 probe syscall.fchmodat.return = kernel.function("SyS_fchmodat").return !,
 		kernel.function("sys_fchmodat").return ? {
@@ -888,16 +884,13 @@ probe syscall.fchown16.return = kernel.function("sys_fchown16").return ? {
 probe syscall.fchownat = kernel.function("SyS_fchownat") !,
 		kernel.function("sys_fchownat") ? {
 	name = "fchownat"
-	dfd = $dfd
-	dfd_str = _dfd_str($dfd)
-	filename = $filename
-	filename_str = user_string($filename)
-	user = __int32($user)
+	dirfd = $dfd
+	pathname = user_string($filename)
+	owner = __int32($user)
 	group = __int32($group)
-	flag = $flag
-	flag_str = _at_flag_str($flag)
+	flags = $flag
 	argstr = sprintf("%s, %s, %d, %d, %s",
-		dfd_str, user_string_quoted($filename), user, group, flag_str)
+		_dfd_str($dfd), user_string_quoted($filename), owner, group, _at_flag_str($flag))
 }
 probe syscall.fchownat.return = kernel.function("SyS_fchownat").return !,
 		kernel.function("sys_fchownat").return ? {
@@ -2332,20 +2325,15 @@ probe syscall.link.return = kernel.function("SyS_link").return !,
 probe syscall.linkat = kernel.function("SyS_linkat") !,
 		kernel.function("sys_linkat") ? {
 	name = "linkat"
-	olddfd = $olddfd
-	olddfd_str = _dfd_str($olddfd)
-	oldname = $oldname
-	oldname_str = user_string($oldname)
-	newdfd = $newdfd
-	newdfd_str = _dfd_str($newdfd)
-	newname = $newname
-	newname_str = user_string($newname)
+	olddirfd = $olddfd
+	oldpath = user_string($oldname)
+	newdirfd = $newdfd
+	newpath = user_string($newname)
 	flags = $flags
-	flags_str = _at_flag_str($flags)
 	argstr = sprintf("%s, %s, %s, %s, %s",
-		olddfd_str, user_string_quoted($oldname),
-		newdfd_str, user_string_quoted($newname),
-		flags_str)
+		_dfd_str($olddfd), user_string_quoted($oldname),
+		_dfd_str($newdfd), user_string_quoted($newname),
+		_at_flag_str($flags))
 }
 probe syscall.linkat.return = kernel.function("SyS_linkat").return !,
 		kernel.function("sys_linkat").return ? {
@@ -2720,15 +2708,12 @@ probe syscall.mknod.return = kernel.function("SyS_mknod").return !,
 probe syscall.mknodat = kernel.function("SyS_mknodat") !,
 		kernel.function("sys_mknodat") ? {
 	name = "mknodat"
-	dfd = $dfd
-	dfd_str = _dfd_str($dfd)
-	filename = $filename
-	filename_str = user_string($filename)
+	dirfd = $dfd
+	pathname = user_string($filename)
 	mode = $mode
-	mode_str = _mknod_mode_str($mode)
 	dev = $dev
 	argstr = sprintf("%s, %s, %s, %p",
-		dfd_str, user_string_quoted($filename), mode_str, $dev)
+		_dfd_str($dfd), user_string_quoted($filename), _mknod_mode_str($mode), $dev)
 }
 probe syscall.mknodat.return = kernel.function("SyS_mknodat").return !,
 		kernel.function("sys_mknodat").return ? {
-- 
1.5.6.5

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

* Re: [PATCH] Correct misnamed and remove superfluous variables in  syscalls.stp.
  2009-05-18 23:36 [PATCH] Correct misnamed and remove superfluous variables in syscalls.stp Przemyslaw Pawelczyk
@ 2009-05-19  0:17 ` Josh Stone
  2009-05-19  0:39   ` Przemysław Pawełczyk
  2009-05-19  7:58   ` [PATCH] Correct misnamed " Przemyslaw Pawelczyk
  0 siblings, 2 replies; 4+ messages in thread
From: Josh Stone @ 2009-05-19  0:17 UTC (permalink / raw)
  To: Przemyslaw Pawelczyk; +Cc: systemtap

On 05/18/2009 04:12 PM, Przemyslaw Pawelczyk wrote:
> In syscall.(faccess|fchmod|fchown|link|mknod)at probe points:
> - Rename variables accordingly to argument names used in man pages.

This much is good.

> - Remove string-formatted integer variables.

I don't agree with this part though, because those string variables are
providing a non-trivial conversion using undocumented functions
(prefixed with '_').  I think that's valuable to have, and it doesn't
hurt anything for scripts that don't use them.

Josh

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

* Re: [PATCH] Correct misnamed and remove superfluous variables in   syscalls.stp.
  2009-05-19  0:17 ` Josh Stone
@ 2009-05-19  0:39   ` Przemysław Pawełczyk
  2009-05-19  7:58   ` [PATCH] Correct misnamed " Przemyslaw Pawelczyk
  1 sibling, 0 replies; 4+ messages in thread
From: Przemysław Pawełczyk @ 2009-05-19  0:39 UTC (permalink / raw)
  To: Josh Stone; +Cc: systemtap

On Tue, May 19, 2009 at 02:16, Josh Stone <jistone@redhat.com> wrote:
> On 05/18/2009 04:12 PM, Przemyslaw Pawelczyk wrote:
>> In syscall.(faccess|fchmod|fchown|link|mknod)at probe points:
>> - Rename variables accordingly to argument names used in man pages.
>
> This much is good.

I'll resend the patch in 10 hours.

>> - Remove string-formatted integer variables.
>
> I don't agree with this part though, because those string variables are
> providing a non-trivial conversion using undocumented functions
> (prefixed with '_').  I think that's valuable to have, and it doesn't
> hurt anything for scripts that don't use them.

You're right and as a consequence of this there is a need for
"reversed" patch, that provides string-formatted integer variables in
other probes..

> Josh

Regards.

-- 
Przemysław Pawełczyk

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

* [PATCH] Correct misnamed variables in syscalls.stp.
  2009-05-19  0:17 ` Josh Stone
  2009-05-19  0:39   ` Przemysław Pawełczyk
@ 2009-05-19  7:58   ` Przemyslaw Pawelczyk
  1 sibling, 0 replies; 4+ messages in thread
From: Przemyslaw Pawelczyk @ 2009-05-19  7:58 UTC (permalink / raw)
  To: systemtap

Rename variables accordingly to argument names used in man pages in
syscall.(faccess|fchmod|fchown|link|mknod)at probe points.
---
 tapset/syscalls.stp |   60 +++++++++++++++++++++++----------------------------
 1 files changed, 27 insertions(+), 33 deletions(-)

diff --git a/tapset/syscalls.stp b/tapset/syscalls.stp
index 0eaf84c..1b04269 100644
--- a/tapset/syscalls.stp
+++ b/tapset/syscalls.stp
@@ -712,13 +712,12 @@ probe syscall.exit_group = kernel.function("SyS_exit_group") !,
 probe syscall.faccessat = kernel.function("SyS_faccessat") !,
 		kernel.function("sys_faccessat") ? {
 	name = "faccessat"
-	dfd = $dfd
-	dfd_str = _dfd_str($dfd)
-	filename = $filename
-	filename_str = user_string($filename)
+	dirfd = $dfd
+	dirfd_str = _dfd_str($dfd)
+	pathname = user_string($filename)
 	mode = $mode
 	mode_str = _access_mode_str($mode)
-	argstr = sprintf("%s, %s, %s", dfd_str, user_string_quoted($filename), mode_str)
+	argstr = sprintf("%s, %s, %s", dirfd_str, user_string_quoted($filename), mode_str)
 }
 probe syscall.faccessat.return = kernel.function("SyS_faccessat").return !,
 		kernel.function("sys_faccessat").return ? {
@@ -838,12 +837,11 @@ probe syscall.fchmod.return = kernel.function("SyS_fchmod").return !,
 probe syscall.fchmodat = kernel.function("SyS_fchmodat") !,
 		kernel.function("sys_fchmodat") ? {
 	name = "fchmodat"
-	dfd = $dfd
-	dfd_str = _dfd_str($dfd)
-	filename = $filename
-	filename_str = user_string($filename)
+	dirfd = $dfd
+	dirfd_str = _dfd_str($dfd)
+	pathname = user_string($filename)
 	mode = $mode
-	argstr = sprintf("%s, %s, %#o", dfd_str, user_string_quoted($filename), $mode)
+	argstr = sprintf("%s, %s, %#o", dirfd_str, user_string_quoted($filename), $mode)
 }
 probe syscall.fchmodat.return = kernel.function("SyS_fchmodat").return !,
 		kernel.function("sys_fchmodat").return ? {
@@ -888,16 +886,15 @@ probe syscall.fchown16.return = kernel.function("sys_fchown16").return ? {
 probe syscall.fchownat = kernel.function("SyS_fchownat") !,
 		kernel.function("sys_fchownat") ? {
 	name = "fchownat"
-	dfd = $dfd
-	dfd_str = _dfd_str($dfd)
-	filename = $filename
-	filename_str = user_string($filename)
-	user = __int32($user)
+	dirfd = $dfd
+	dirfd_str = _dfd_str($dfd)
+	pathname = user_string($filename)
+	owner = __int32($user)
 	group = __int32($group)
-	flag = $flag
-	flag_str = _at_flag_str($flag)
+	flags = $flag
+	flags_str = _at_flag_str($flag)
 	argstr = sprintf("%s, %s, %d, %d, %s",
-		dfd_str, user_string_quoted($filename), user, group, flag_str)
+		dirfd_str, user_string_quoted($filename), owner, group, flags_str)
 }
 probe syscall.fchownat.return = kernel.function("SyS_fchownat").return !,
 		kernel.function("sys_fchownat").return ? {
@@ -2332,19 +2329,17 @@ probe syscall.link.return = kernel.function("SyS_link").return !,
 probe syscall.linkat = kernel.function("SyS_linkat") !,
 		kernel.function("sys_linkat") ? {
 	name = "linkat"
-	olddfd = $olddfd
-	olddfd_str = _dfd_str($olddfd)
-	oldname = $oldname
-	oldname_str = user_string($oldname)
-	newdfd = $newdfd
-	newdfd_str = _dfd_str($newdfd)
-	newname = $newname
-	newname_str = user_string($newname)
+	olddirfd = $olddfd
+	olddirfd_str = _dfd_str($olddfd)
+	oldpath = user_string($oldname)
+	newdirfd = $newdfd
+	newdirfd_str = _dfd_str($newdfd)
+	newpath = user_string($newname)
 	flags = $flags
 	flags_str = _at_flag_str($flags)
 	argstr = sprintf("%s, %s, %s, %s, %s",
-		olddfd_str, user_string_quoted($oldname),
-		newdfd_str, user_string_quoted($newname),
+		olddirfd_str, user_string_quoted($oldname),
+		newdirfd_str, user_string_quoted($newname),
 		flags_str)
 }
 probe syscall.linkat.return = kernel.function("SyS_linkat").return !,
@@ -2720,15 +2715,14 @@ probe syscall.mknod.return = kernel.function("SyS_mknod").return !,
 probe syscall.mknodat = kernel.function("SyS_mknodat") !,
 		kernel.function("sys_mknodat") ? {
 	name = "mknodat"
-	dfd = $dfd
-	dfd_str = _dfd_str($dfd)
-	filename = $filename
-	filename_str = user_string($filename)
+	dirfd = $dfd
+	dirfd_str = _dfd_str($dfd)
+	pathname = user_string($filename)
 	mode = $mode
 	mode_str = _mknod_mode_str($mode)
 	dev = $dev
 	argstr = sprintf("%s, %s, %s, %p",
-		dfd_str, user_string_quoted($filename), mode_str, $dev)
+		dirfd_str, user_string_quoted($filename), mode_str, $dev)
 }
 probe syscall.mknodat.return = kernel.function("SyS_mknodat").return !,
 		kernel.function("sys_mknodat").return ? {
-- 
1.5.6.5

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

end of thread, other threads:[~2009-05-19  7:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-18 23:36 [PATCH] Correct misnamed and remove superfluous variables in syscalls.stp Przemyslaw Pawelczyk
2009-05-19  0:17 ` Josh Stone
2009-05-19  0:39   ` Przemysław Pawełczyk
2009-05-19  7:58   ` [PATCH] Correct misnamed " Przemyslaw Pawelczyk

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).