public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Re: FW: function return value
       [not found] <006701c760d4$32170090$ee04a8c0@ibrixfaf958395>
@ 2007-03-07 16:35 ` Frank Ch. Eigler
  2007-03-07 16:51   ` John Liang
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Ch. Eigler @ 2007-03-07 16:35 UTC (permalink / raw)
  To: John Liang; +Cc: systemtap

Hi -

> Thanks for your help. I actually sent out one in the morning as
> following.  Did you see it? Since I did not receive the following
> email, I was thinking maybe I did not get the right email address to
> send to.

The machine that hosts the project routinely rejects HTML mail.
Maybe that's the problem.  Just go for plain text.

> [...]  Is there a way to get the return value of a function in
> systemstap?

Certainly.  In function().return probes, "$return" gives the value
of the return value, assuming it is a suitable integral type.

- FChE

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

* RE: FW: function return value
  2007-03-07 16:35 ` FW: function return value Frank Ch. Eigler
@ 2007-03-07 16:51   ` John Liang
  2007-03-07 18:20     ` Frank Ch. Eigler
  2007-03-07 18:23     ` David Smith
  0 siblings, 2 replies; 4+ messages in thread
From: John Liang @ 2007-03-07 16:51 UTC (permalink / raw)
  To: 'Frank Ch. Eigler'; +Cc: systemtap

FchE,

The function I am interested in returns a dentry pointer. 
Does $return have to be an integral type? 

Thanks,
--
John Liang

-----Original Message-----
From: Frank Ch. Eigler [mailto:fche@redhat.com] 
Sent: Wednesday, March 07, 2007 11:35 AM
To: John Liang
Cc: systemtap@sources.redhat.com
Subject: Re: FW: function return value

Hi -

> Thanks for your help. I actually sent out one in the morning as
> following.  Did you see it? Since I did not receive the following
> email, I was thinking maybe I did not get the right email address to
> send to.

The machine that hosts the project routinely rejects HTML mail.
Maybe that's the problem.  Just go for plain text.

> [...]  Is there a way to get the return value of a function in
> systemstap?

Certainly.  In function().return probes, "$return" gives the value
of the return value, assuming it is a suitable integral type.

- FChE

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

* Re: FW: function return value
  2007-03-07 16:51   ` John Liang
@ 2007-03-07 18:20     ` Frank Ch. Eigler
  2007-03-07 18:23     ` David Smith
  1 sibling, 0 replies; 4+ messages in thread
From: Frank Ch. Eigler @ 2007-03-07 18:20 UTC (permalink / raw)
  To: John Liang; +Cc: systemtap

Hi -

On Wed, Mar 07, 2007 at 11:51:31AM -0500, John Liang wrote:
> The function I am interested in returns a dentry pointer. 
> Does $return have to be an integral type? 

A pointer is deemed integral.  $return will simply be the pointer
value.  It should also be dereferencable like other $variables
("$return->d_mounted") to some extent.

- FChE

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

* Re: FW: function return value
  2007-03-07 16:51   ` John Liang
  2007-03-07 18:20     ` Frank Ch. Eigler
@ 2007-03-07 18:23     ` David Smith
  1 sibling, 0 replies; 4+ messages in thread
From: David Smith @ 2007-03-07 18:23 UTC (permalink / raw)
  To: John Liang; +Cc: 'Frank Ch. Eigler', systemtap

John Liang wrote:
> FchE,
> 
> The function I am interested in returns a dentry pointer. 
> Does $return have to be an integral type? 

Although a pointer is just a special case of an integral type (on most 
arches anyway), the translator won't let you do "$return->d_count" to 
access the d_count field out of the dentry pointer.  I'm not 100% 
positive it is possible, but it wouldn't hurt to file a bugzilla against it.

For now, what you'll have to create a function that accesses the 
structure for you.  Look at the _struct_timeval_u() function in 
tapset/aux_syscall.stp for an example.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

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

end of thread, other threads:[~2007-03-07 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <006701c760d4$32170090$ee04a8c0@ibrixfaf958395>
2007-03-07 16:35 ` FW: function return value Frank Ch. Eigler
2007-03-07 16:51   ` John Liang
2007-03-07 18:20     ` Frank Ch. Eigler
2007-03-07 18:23     ` David Smith

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