From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11987 invoked by alias); 15 Sep 2011 07:15:24 -0000 Received: (qmail 11970 invoked by uid 22791); 15 Sep 2011 07:15:20 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,LOTS_OF_MONEY,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from arroyo.ext.ti.com (HELO arroyo.ext.ti.com) (192.94.94.40) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Sep 2011 07:15:05 +0000 Received: from dlep36.itg.ti.com ([157.170.170.91]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p8F7F4sc008705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Sep 2011 02:15:04 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id p8F7F3DT014151; Thu, 15 Sep 2011 02:15:03 -0500 (CDT) Received: from dnce72.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p8F7F3iN029157; Thu, 15 Sep 2011 02:15:03 -0500 (CDT) Received: from dnce02.ent.ti.com ([137.167.131.106]) by dnce72.ent.ti.com ([137.167.131.87]) with mapi; Thu, 15 Sep 2011 09:15:02 +0200 From: "Turgis, Frederic" To: "Yao,Yanjun" CC: "systemtap@sourceware.org" Content-Class: urn:content-classes:message Date: Thu, 15 Sep 2011 07:15:00 -0000 Subject: RE: Met Problem on Enable SystemTap on Android Message-ID: <13872098A06B02418CF379A158C0F1460163513B77@dnce02.ent.ti.com> References: <4E5D449B.70109@redhat.com><4E5D6127.2070602@redhat.com><13872098A06B02418CF379A158C0F146016301D041@dnce02.ent.ti.com><4E5E5E8F.5070700@redhat.com><13872098A06B02418CF379A158C0F146016301D5B9@dnce02.ent.ti.com><13872098A06B02418CF379A158C0F146016301D989@dnce02.ent.ti.com><20110908074552.GA7531@hermans.wildebeest.org><13872098A06B02418CF379A158C0F14601632B8369@dnce02.ent.ti.com><13872098A06B02418CF379A158C0F14601633A0B60@dnce02.ent.ti.com><4E7110BB.80608@redhat.com> In-Reply-To: Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes 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: 2011-q3/txt/msg00345.txt.bz2 Hi, I would also suggest for any topic to have a look at http://sourceware.org/= systemtap -> documentation (top right) -> all examples (by keyword). For example, in SYSCALL keyword, you will find lots of examples showing how= to dump immediately syscalls or accumulate in arrays and dump at the end. = This page + tapset are a big source inspiration (thanks to all contributors) Depending on the needs, it can be interesting to accumulate internally rath= er than tracing everything (but you may then lose some info) Example from http://sources.redhat.com/ml/systemtap/2011-q3/msg00085.html: global starttime, timebycall probe begin { printf("Collecting data - type Ctrl-C to print output and exi= t... %d\n", get_32k()) } probe syscall.* { starttime[name, tid()] =3D } probe syscall.*.return { # Skip if we have not seen this before if (!([name, tid()] in starttime)) next delta =3D - starttime[name, tid()] timebycall[name, tid(), execname()] <<< delta delete starttime[name, tid()] } function print_header() { printf("%22s %16s:%-6s %10s %12s %12s %12s %12s\n", "System Call", "execname", "pid", "Count", "Total 32K", "Avg 32K", "Min 32K", "Max 32K") } probe end { printf("END TIME %d\n", ) printf("\nTimes for XXX:\n\n") print_header() foreach ([call, pidt+, exe] in timebycall) printf("%22s %16s:%-6d %10d %12d %12d %12d %12d\n", call, exe, pidt, @count(timebycall[call, pidt, exe]), @sum(timebycall[call, pidt, exe]), @avg(timebycall[call, pidt, exe]), @min(timebycall[call, pidt, exe]), @max(timebycall[call, pidt, exe])) delete timebycall } Regards Fred Frederic Turgis OMAP Platform Business Unit - OMAP System Engineering - Platform Enablement > Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet= . 036 420 040 R.C.S Antibes. Capital de EUR 753.920 -----Original Message----- >From: Yao,Yanjun [mailto:jiaoyang28@gmail.com] >Sent: Wednesday, September 14, 2011 10:41 PM >To: David Smith >Cc: Turgis, Frederic; Mark Wielaard; Josh Stone; >systemtap@sourceware.org >Subject: Re: Met Problem on Enable SystemTap on Android > >Thanks a lot. > >This just fits what I want. > >Yours >Sincerely > >2011/9/14 David Smith : >> On 09/14/2011 03:20 PM, Yao,Yanjun wrote: >> >>> Thanks Turgis, >>> >>> I got the problem fixed as what you said. >>> >>> One last question, in my implementation, we want to know >what system >>> calls each program made. However, in SystemTap tutorial or >examples, >>> people already know what to probe, then they go to probe that file. >>> >>> What's in my mind is like: >>> probe syscall.* { >>> //print out the * part of the target "syscall.*" >>> } >>> >>> May I ask how can I do that? >> >> >> Like this: >> >> probe syscall.* { printf("%s: %s (%s) =3D ", execname(), name, >argstr) } >> >> If you want to get fancier and see the return values also, do this >> (this is from testsuite/buildok/syscall.stp): >> >> probe syscall.*, syscall.*.return { >> >> if (retstr !=3D "") >> printf("%s\n", retstr) >> else >> printf("%s: %s (%s) =3D ", execname(), name, argstr) } >> >> >> -- >> David Smith >> dsmith@redhat.com >> Red Hat >> http://www.redhat.com >> 256.217.0141 (direct) >> 256.837.0057 (fax) >> >