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: Cannot access data passed in via gettimeofday


Perry,

The test worked the first time I ran it. The second time I ran it I got
wacky results. Then I noticed I had a number of runaway processes after
the second test.

You may want to try a reboot and run the test again

Dave  



> Perry Cheng wrote:
> > I am having trouble getting parameters out of what seems to be a simple
> > but buggy system-tap script.  The script is included below and the test
> > case (a short C program) follows.  Basically, I am trying to hi-jack
> > gettimeofday and piggyback some information back by treating the struct
> it
> > passes in as a larger buffer than struct timeval.  However, I need to
> > separate regular calls to gettimeofday from the special ones where the
> > special path triggers.  To do this, I though I could treat the struct as
> > an incoming parameter by looking for unusual bit patterns in the struct.
> > Unfortunately, I can't seem to see the data at all despite using the
> > copy_from_user function to copy data from user to kernel space.  Any idea
> 
> > what's going on here?   I additionally hijack stime so i can distinguish
> > in the output my special call to gettimeofday.   The sample out below
> > shows that the special values 0xaaaaaaaa and 0xbbbbbbbb are not
> > transmitted.   If I use settimeofday instead of gettimeofday, then this
> > program seems to work.   It feels like there is some other mechanism at
> > work here that I don't know about.
> 
> [eteo@kerndev tmp]$ stap -g test.stp -c ./test
> Password:
> ---------------------------
> gettimeofday 0:   sec = aaaaaaaa  usec = bbbbbbbb
> ---------------------------
> gettimeofday 0:   sec = 23a  usec = 1
> ...
> 
> Eugene
> --
> 1024D/58DF8823 print 47B9 90F6 AE4A 9C51 37E0  D6E1 EA84 C6A2 58DF 8823
> main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }
> 


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