This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: structure access and tapsets


On Tue, 2006-02-14 at 10:59 -0800, Hien Nguyen wrote:
> Martin,
> 
> For the time being, I agree with you we are going to have a bunch of 
> structure printing functions (for the system calls tapset). I am going 
> to do the same for the structures I see in the syscalls2.stp.

OK.

> But for some stucture such as 'struct stat' or 'struct rusage' (has lot 
> of members)  do we want to have a string that represents all members?

No, that would be way too long to be useful or readable.

> What about if people want the struct membersindividually? I think we 
> still need to export the structure data individually. It would be nice 
> that we could export just the structure (if we have struct data type in 
> the language) and user could access to all members of the struct.

I think the best we can do for now is to do nothing and focus on more
important things. Eventually the translator will be fixed to allow
automatic access.  In the meantime, if someone really needs this, they
have the pointer to the struct, so they can write their own embedded C
function to extract any members they need.

For now, use your judgment on which structs to print as strings. Try to
consider the typical user's needs. For example, looking at a trace, the
user probably doesn't care about the details contained in an rusage
struct because it won't likely impact program flow. On the other hand,
the details of different socket structures are important because they
show important connection information. (I am actually planning to do
socket printing functions next)

If in doubt, don't do it. Let's keep it simple for now.  We are learning
as we do this and we can always add complexity later. Or we may think of
a better approach.

Martin




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]