This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Cannot access data passed in via gettimeofday
- From: Dave Sperry <dave_sperry at ieee dot nospam dot dot dot org>
- To: Perry Cheng <perryche at us dot ibm dot com>, systemtap at sources dot redhat dot com
- Date: Thu, 14 Dec 2006 21:15:04 -0500
- Subject: Re: Cannot access data passed in via gettimeofday
- References: <OF326DF462.A6D86C8A-ON85257245.00099860-85257245.00099F31@mck.us.ray.com>
- Reply-to: dave_sperry at ieee dot nospam dot dot dot org
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); }
>