public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "dsmith at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug tapsets/12748] need syscall-number database in tapset
Date: Mon, 20 Jun 2016 18:07:00 -0000	[thread overview]
Message-ID: <bug-12748-6586-ovBGjT8FNy@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-12748-6586@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=12748

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsmith at redhat dot com

--- Comment #3 from David Smith <dsmith at redhat dot com> ---
(In reply to Martin Cermak from comment #1)
> Created attachment 9343 [details]
> syscall table tapset generator script
> 
> Attached script generates tapset file providing syscall_name() and
> syscall_num() functions by parsing the strace sources.  Currently only
> x86_64/i386 syscalls are supported, but extension is trivial.
> 
> However, it turns out that stap syscall names do not match their strace
> counterparts exactly.  For example, all of 'stat64', 'lstat64', and
> 'fstat64', known to strace, are being interpreted as 'stat' by systemtap.

That's by design. The user always calls "stat", "lstat", or "fstat" -
underneath glibc will call either stat/stat64 based on whether a couple of
defines are defined. If the following are defined, glibc will call the 64-bit
versions:

#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64

(BTW, some platforms also have newfstat/newfstatat/newlstat/newstat.)

systemtap tries to report things from the user's point of view, so if we get a
stat/stat64/newstat syscall, it reports all of them just as "stat".

> Another problem is that e.g. when running the accept.c stap syscall
> testcase, _stp_syscall_nr() returns value 102 for various syscalls like
> 'accept', 'socket', and 'bind'.  But 102 maps to 'socketcall' syscall as
> known to strace. Not sure how to reasonably deal with this yet.

I'm not sure you can without looking at the args. What is going on there is
that on some platforms
connect/getpeername/getsockname/getsockopt/listen/recv/recvfrom/recvmsg/send/sendmsg/sendto/setsockopt/shutdown/socket/socketpair
can either be individual syscalls or some/all of them can use socketcall as a
common kernel entry point.

Once again systemtap tries to report what the user actually called, not what
kernel entry point got used.

> So, in general, it's easy to create a tapset carrying the per arch syscall
> tables.  But values returned by _stp_syscall_nr() transformed to syscall
> names using such tables, very often do not match systemtap syscall names as
> provided by the 'name' context variable of probe syscall.

I think we're just going to have to live with them not matching sometimes.

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

  parent reply	other threads:[~2016-06-20 18:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 21:02 [Bug tapsets/12748] New: " fche at redhat dot com
2016-06-09 15:26 ` [Bug tapsets/12748] " mcermak at redhat dot com
2016-06-20 15:26 ` mcermak at redhat dot com
2016-06-20 15:31 ` mcermak at redhat dot com
2016-06-20 18:07 ` dsmith at redhat dot com [this message]
2016-06-20 18:22 ` dsmith at redhat dot com
2016-06-20 18:25 ` dsmith at redhat dot com
2016-06-21  8:42 ` mcermak at redhat dot com
2016-06-21 18:41 ` dsmith at redhat dot com
2016-06-23 14:53 ` mcermak at redhat dot com
2016-06-23 15:02 ` dsmith at redhat dot com
2016-06-24 13:11 ` mcermak at redhat dot com
2016-06-24 15:40 ` mcermak at redhat dot com
2016-06-28 12:30 ` mcermak at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-12748-6586-ovBGjT8FNy@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).