From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18275 invoked by alias); 15 Dec 2006 02:15:14 -0000 Received: (qmail 18260 invoked by uid 22791); 15 Dec 2006 02:15:13 -0000 X-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_40,TW_XA,TW_XB X-Spam-Check-By: sourceware.org Received: from rwcrmhc15.comcast.net (HELO rwcrmhc15.comcast.net) (216.148.227.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 15 Dec 2006 02:15:08 +0000 Received: from [192.168.1.8] (midgel.hsd1.ma.comcast.net[24.147.246.42]) by comcast.net (rwcrmhc15) with SMTP id <20061215021505m1500qgvvce>; Fri, 15 Dec 2006 02:15:05 +0000 Subject: Re: Cannot access data passed in via gettimeofday From: Dave Sperry Reply-To: dave_sperry@ieee.nospam.dot.org To: Perry Cheng , systemtap@sources.redhat.com In-Reply-To: References: Content-Type: text/plain Date: Fri, 15 Dec 2006 03:45:00 -0000 Message-Id: <1166148904.3034.3.camel@fc6-rt> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1.1 (2.8.1.1-3.fc6) Content-Transfer-Encoding: 7bit Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q4/txt/msg00684.txt.bz2 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); } >