From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65558 invoked by alias); 30 Nov 2015 21:52:14 -0000 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 Received: (qmail 65541 invoked by uid 89); 30 Nov 2015 21:52:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 30 Nov 2015 21:52:13 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 1FCF0935D5; Mon, 30 Nov 2015 21:52:12 +0000 (UTC) Received: from t540p.usersys.redhat.com (dhcp-10-15-1-6.hsv.redhat.com [10.15.1.6]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAULqBDI016887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Nov 2015 16:52:11 -0500 Subject: Re: How to track the functions in self-written module using SystemTap? To: Nan Xiao References: <564B5A4C.1080302@redhat.com> <564CD3C1.2090900@redhat.com> <564DE376.3020104@redhat.com> Cc: systemtap@sourceware.org From: David Smith Message-ID: <565CC50B.90104@redhat.com> Date: Mon, 30 Nov 2015 21:52:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-q4/txt/msg00203.txt.bz2 On 11/26/2015 12:10 AM, Nan Xiao wrote: > Hi David, > > I do "insmod kex.ko" and "rmmod kex" repeatedly, but It seems the > related probes can't be triggered: > > # stap -l 'module("/root/kernel/105.ops/kex.ko").function("*")' > module("/root/kernel/105.ops/kex.ko").function("_open@/root/kernel/105.ops/kex.c:21") > module("/root/kernel/105.ops/kex.ko").function("_read@/root/kernel/105.ops/kex.c:45") > module("/root/kernel/105.ops/kex.ko").function("_release@/root/kernel/105.ops/kex.c:33") > module("/root/kernel/105.ops/kex.ko").function("copy_to_user@/usr/src/kernels/3.10.0-123.el7.x86_64.debug/arch/x86/include/asm/uaccess_64.h:72") > module("/root/kernel/105.ops/kex.ko").function("kex_cleanup@/root/kernel/105.ops/kex.c:90") > module("/root/kernel/105.ops/kex.ko").function("kex_init@/root/kernel/105.ops/kex.c:61") > # stap -e 'probe > module("/root/kernel/105.ops/kex.ko").function("kex_init"), > module("/root/kernel/105.ops/kex.ko").function("kex_cleanup") > {print_backtrace()}' Hmm. Note that I've done a good bit of work in the area of catching module init functions recently. What version of systemtap are you working with? Let's see if systemtap can catch anything in your module. Try something like: # stap -e 'probe module("/root/kernel/105.ops/kex.ko").function("*") { printf("%s\n", ppfunc()) }' -- David Smith dsmith@redhat.com Red Hat http://www.redhat.com 256.217.0141 (direct) 256.837.0057 (fax)