public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
@ 2009-02-20 12:38 ananth at in dot ibm dot com
  2009-02-20 12:39 ` [Bug tapsets/9876] " ananth at in dot ibm dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: ananth at in dot ibm dot com @ 2009-02-20 12:38 UTC (permalink / raw)
  To: systemtap

Recently, the upstream kernel acquired the SYSCALL_WRAPPER code that is now
being used by multiple architectures including ARM, SPARC, POWERPC and s390.
With that change the current syscall tapsets are broken.

The change necessarily creates the an asmlinkage SyS_* routines that encapsulate
the sys_* routines that are inlined. With the change, even simple scripts as fail:

[ananth@... ~]$ stap -ve 'probe syscall.access {print("here\n") exit() }'
Pass 1: parsed user script and 47 library script(s) in 450usr/0sys/509real ms.
semantic error: no match while resolving probe point kernel.function("sys_access")
semantic error: no match while resolving probe point syscall.access
semantic error: no probes found
Pass 2: analyzed script: 0 probe(s), 0 function(s), 0 embed(s), 0 global(s) in
520usr/880sys/1633real ms.
Pass 2: analysis failed.  Try again with another '--vp 01' option.
[ananth@... ~]$ stap -ve 'probe kernel.function("sys_access") {print("here\n")
exit() }'
Pass 1: parsed user script and 47 library script(s) in 450usr/0sys/509real ms.
semantic error: no match while resolving probe point kernel.function("sys_access")
semantic error: no probes found
Pass 2: analyzed script: 0 probe(s), 0 function(s), 0 embed(s), 0 global(s) in
520usr/880sys/1663real ms.
Pass 2: analysis failed.  Try again with another '--vp 01' option.

While probing the wrapper works:
[ananth@... ~]$ 'stap -ve 'probe kernel.function("SyS_access") {print("here\n")
exit() }'
Pass 1: parsed user script and 47 library script(s) in 450usr/10sys/511real ms.
Pass 2: analyzed script: 1 probe(s), 2 function(s), 0 embed(s), 0 global(s) in
510usr/860sys/1616real ms.
Pass 3: translated to C into
"/tmp/stapnRd0lO/stap_2b2ebb56d31314a25fff4a30d7eda8c2_527.c" in
870usr/1310sys/2499real ms.
Pass 4: compiled C into "stap_2b2ebb56d31314a25fff4a30d7eda8c2_527.ko" in
6640usr/610sys/10331real ms.
Pass 5: starting run.

-- 
           Summary: Syscall tapset broken on architectures that use
                    SYSCALL_WRAPPERS
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: critical
          Priority: P2
         Component: tapsets
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: ananth at in dot ibm dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
@ 2009-02-20 12:39 ` ananth at in dot ibm dot com
  2009-02-20 12:43 ` fche at redhat dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: ananth at in dot ibm dot com @ 2009-02-20 12:39 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From ananth at in dot ibm dot com  2009-02-20 11:25 -------
Frank,
This just slipped the 0.9 release. Any chance of doing a 0.9.1 with the changes
required (patch should be available soon).

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
  2009-02-20 12:39 ` [Bug tapsets/9876] " ananth at in dot ibm dot com
@ 2009-02-20 12:43 ` fche at redhat dot com
  2009-02-20 23:51 ` mahesh at linux dot vnet dot ibm dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: fche at redhat dot com @ 2009-02-20 12:43 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2009-02-20 12:38 -------
probe kernel.function("sys_foo")
  ->
probe kernel.function("SyS_foo")!, kernel.function("sys_foo")


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
  2009-02-20 12:39 ` [Bug tapsets/9876] " ananth at in dot ibm dot com
  2009-02-20 12:43 ` fche at redhat dot com
@ 2009-02-20 23:51 ` mahesh at linux dot vnet dot ibm dot com
  2009-02-21 15:27 ` mahesh at linux dot vnet dot ibm dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: mahesh at linux dot vnet dot ibm dot com @ 2009-02-20 23:51 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mahesh at linux dot vnet dot ibm dot com  2009-02-20 14:24 -------
Working on a patch. I should be able to roll out the patch very soon.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
                   ` (2 preceding siblings ...)
  2009-02-20 23:51 ` mahesh at linux dot vnet dot ibm dot com
@ 2009-02-21 15:27 ` mahesh at linux dot vnet dot ibm dot com
  2009-02-21 16:13 ` fche at redhat dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: mahesh at linux dot vnet dot ibm dot com @ 2009-02-21 15:27 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mahesh at linux dot vnet dot ibm dot com  2009-02-21 14:47 -------
Created an attachment (id=3756)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3756&action=view)
Patch to handle SYSCALL WRAPPERS.

Here is the patch to cover SYSCALL wrappers SyS_* calls. 
Please pour in your comments.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
                   ` (3 preceding siblings ...)
  2009-02-21 15:27 ` mahesh at linux dot vnet dot ibm dot com
@ 2009-02-21 16:13 ` fche at redhat dot com
  2009-02-23 10:00   ` Ananth N Mavinakayanahalli
  2009-02-22 22:22 ` ananth at in dot ibm dot com
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 12+ messages in thread
From: fche at redhat dot com @ 2009-02-21 16:13 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2009-02-21 15:27 -------
There are some hunks that don't use "!" but rather "?" (syscall.writev.return,
syscall.mount, ...), probably because there are "compat" variants also.  This
can still result in double-counting syscalls, so please write & run a test case
to check for this.

If a problem exists, this might solve it.  Instead of this ...

probe syscall.mount = 
		kernel.function("SyS_mount") ?,
		kernel.function("sys_mount") ?,
 		kernel.function("compat_sys_mount") ?

try

probe syscall.mount = 
 		kernel.function("compat_sys_mount") ?
		kernel.function("SyS_mount") !,
		kernel.function("sys_mount")

It all depends whether any of these sibling functions can call each other.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
                   ` (4 preceding siblings ...)
  2009-02-21 16:13 ` fche at redhat dot com
@ 2009-02-22 22:22 ` ananth at in dot ibm dot com
  2009-02-23  9:47 ` ananth at in dot ibm dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: ananth at in dot ibm dot com @ 2009-02-22 22:22 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From ananth at in dot ibm dot com  2009-02-21 16:09 -------
A simple test with SyS_access and compat_sys_access shows that both routines are
indeed hit on a ssh for example.

I did have the compat_sys_foo first idea but there are more complex cases where
the ! construct isn't that easy to use - sys_getdents and variants. What's the
easy way to handle them? Split them into multiple entries?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
                   ` (5 preceding siblings ...)
  2009-02-22 22:22 ` ananth at in dot ibm dot com
@ 2009-02-23  9:47 ` ananth at in dot ibm dot com
  2009-02-23 13:28 ` ananth at in dot ibm dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: ananth at in dot ibm dot com @ 2009-02-23  9:47 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From ananth at in dot ibm dot com  2009-02-21 16:13 -------
The other complex case is when a specific config may cause one or more syscalls
to not exist in the kernel eg., sys_kexec_load, currently handled with a ?
With the ! construct, how do we prevent a hard failure when the call is absent?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* Re: [Bug tapsets/9876] Syscall tapset broken on architectures that  use SYSCALL_WRAPPERS
  2009-02-21 16:13 ` fche at redhat dot com
@ 2009-02-23 10:00   ` Ananth N Mavinakayanahalli
  0 siblings, 0 replies; 12+ messages in thread
From: Ananth N Mavinakayanahalli @ 2009-02-23 10:00 UTC (permalink / raw)
  To: fche at redhat dot com; +Cc: systemtap

On Sat, Feb 21, 2009 at 03:27:03PM -0000, fche at redhat dot com wrote:
 
> It all depends whether any of these sibling functions can call each other.

Ran a few tests to verify this. Except for sys_ioctl, there weren't
cases where both the SyS_ and compat_sys_ were called for the same
instance.

New patch on the way with the compat_sys_ option first. If there are no
objections, I'll commit the patch to git tomorrow.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
                   ` (6 preceding siblings ...)
  2009-02-23  9:47 ` ananth at in dot ibm dot com
@ 2009-02-23 13:28 ` ananth at in dot ibm dot com
  2009-02-23 13:29 ` ananth at in dot ibm dot com
  2009-02-24 10:10 ` ananth at in dot ibm dot com
  9 siblings, 0 replies; 12+ messages in thread
From: ananth at in dot ibm dot com @ 2009-02-23 13:28 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From ananth at in dot ibm dot com  2009-02-23 09:56 -------
Subject: Re:  Syscall tapset broken on architectures that
	use SYSCALL_WRAPPERS

On Sat, Feb 21, 2009 at 03:27:03PM -0000, fche at redhat dot com wrote:
 
> It all depends whether any of these sibling functions can call each other.

Ran a few tests to verify this. Except for sys_ioctl, there weren't
cases where both the SyS_ and compat_sys_ were called for the same
instance.

New patch on the way with the compat_sys_ option first. If there are no
objections, I'll commit the patch to git tomorrow.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
                   ` (7 preceding siblings ...)
  2009-02-23 13:28 ` ananth at in dot ibm dot com
@ 2009-02-23 13:29 ` ananth at in dot ibm dot com
  2009-02-24 10:10 ` ananth at in dot ibm dot com
  9 siblings, 0 replies; 12+ messages in thread
From: ananth at in dot ibm dot com @ 2009-02-23 13:29 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From ananth at in dot ibm dot com  2009-02-23 10:00 -------
Created an attachment (id=3758)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3758&action=view)
Fix the syscall tapset for architectures that use SYSCALL_WRAPPERS


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #3756 is|0                           |1
           obsolete|                            |


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

* [Bug tapsets/9876] Syscall tapset broken on architectures that use SYSCALL_WRAPPERS
  2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
                   ` (8 preceding siblings ...)
  2009-02-23 13:29 ` ananth at in dot ibm dot com
@ 2009-02-24 10:10 ` ananth at in dot ibm dot com
  9 siblings, 0 replies; 12+ messages in thread
From: ananth at in dot ibm dot com @ 2009-02-24 10:10 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From ananth at in dot ibm dot com  2009-02-24 03:15 -------
Commit 132c337cb in the upstream git tree.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|systemtap at sources dot    |ananth at in dot ibm dot com
                   |redhat dot com              |
             Status|NEW                         |ASSIGNED


http://sourceware.org/bugzilla/show_bug.cgi?id=9876

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

end of thread, other threads:[~2009-02-24  3:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-20 12:38 [Bug tapsets/9876] New: Syscall tapset broken on architectures that use SYSCALL_WRAPPERS ananth at in dot ibm dot com
2009-02-20 12:39 ` [Bug tapsets/9876] " ananth at in dot ibm dot com
2009-02-20 12:43 ` fche at redhat dot com
2009-02-20 23:51 ` mahesh at linux dot vnet dot ibm dot com
2009-02-21 15:27 ` mahesh at linux dot vnet dot ibm dot com
2009-02-21 16:13 ` fche at redhat dot com
2009-02-23 10:00   ` Ananth N Mavinakayanahalli
2009-02-22 22:22 ` ananth at in dot ibm dot com
2009-02-23  9:47 ` ananth at in dot ibm dot com
2009-02-23 13:28 ` ananth at in dot ibm dot com
2009-02-23 13:29 ` ananth at in dot ibm dot com
2009-02-24 10:10 ` ananth at in dot ibm dot com

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