From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15660 invoked by alias); 3 Apr 2006 08:56:47 -0000 Received: (qmail 15651 invoked by uid 22791); 3 Apr 2006 08:56:46 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO azsmga101-1.ch.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Apr 2006 08:56:45 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101-1.ch.intel.com with ESMTP; 03 Apr 2006 01:56:43 -0700 Received: from orsmsx331.jf.intel.com (HELO orsmsx331.amr.corp.intel.com) ([192.168.65.56]) by azsmga001.ch.intel.com with ESMTP; 03 Apr 2006 01:56:43 -0700 X-IronPort-AV: i="4.03,156,1141632000"; d="scan'208"; a="18268484:sNHT55056148" Received: from orsmsx311.amr.corp.intel.com ([192.168.65.40]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Mon, 3 Apr 2006 01:56:41 -0700 Received: from pdsmsx405.ccr.corp.intel.com ([172.16.12.95]) by orsmsx311.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Mon, 3 Apr 2006 01:56:41 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: patch for module function probe Date: Mon, 03 Apr 2006 08:56:00 -0000 Message-ID: <9FBCE015AF479F46B3B410499F3AE05BEDA977@pdsmsx405> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: patch for module function probe Thread-Index: AcZW/HAY3Wh1iSpYQhiCpLkELHQehA== From: "Mao, Bibo" To: "systemtap" X-OriginalArrivalTime: 03 Apr 2006 08:56:41.0448 (UTC) FILETIME=[86794680:01C656FC] X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q2/txt/msg00007.txt.bz2 Hi, Currently systemtap has some problem when searching module function, which is reported in http://sourceware.org/ml/systemtap/2006-q1/msg00674.html. Kernel is treated as one module whose name is TOK_KERNEL "kernel". So this script will pass to compile, it indeed will probe kernel function: probe module("kernel").function("sys_read"){ } But there will be problem when there is actually one module named kernel.ko though its name is weird. Bibo,mao Here is patch for systemtap --- src.org/tapsets.cxx 2006-04-03 16:19:09.000000000 +0800 +++ src/tapsets.cxx 2006-04-03 16:03:03.000000000 +0800 @@ -714,9 +714,13 @@ dwflpp void iterate_over_modules(int (* callback)(Dwfl_Module *, void **, const char *, Dwarf_Addr, void *), - void * data) + void * data, int has_module) { - ptrdiff_t off =3D 0; + ptrdiff_t off; + + if (has_module) + off =3D 1; + else off =3D 0; do { off =3D dwfl_getmodules (dwfl, callback, data, off); @@ -3204,12 +3208,12 @@ dwarf_builder::build(systemtap_session & if (q.has_kernel) { int flag =3D 0; - dw->iterate_over_modules(&query_kernel_exists, &flag); + dw->iterate_over_modules(&query_kernel_exists, &flag, q.has_module); if (! flag) throw semantic_error ("cannot find kernel debuginfo"); } - dw->iterate_over_modules(&query_module, &q); + dw->iterate_over_modules(&query_module, &q, q.has_module); } }