From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2631 invoked by alias); 3 Nov 2005 14:01:40 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 2536 invoked by uid 22791); 3 Nov 2005 14:01:29 -0000 To: systemtap@sources.redhat.com MIME-Version: 1.0 Subject: return probe not executed on SMP system X-Mailer: Lotus Notes Release 6.5.3 September 14, 2004 Message-ID: From: Guang Lei Li Date: Thu, 03 Nov 2005 14:01:00 -0000 X-MIMETrack: Serialize by Router on d23m0017/23/M/IBM(Release 6.53HF654 | July 22, 2005) at 11/03/2005 22:01:24, Serialize complete at 11/03/2005 22:01:24 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2005-q4/txt/msg00123.txt.bz2 Hi, I met some difficulties when dealing with the return probe on a multi-processor system(Power5 System, 4 CPU). This is the stap script I used: global counter function info() %{ struct task_struct *cur = current; _stp_printf("\n|%ld|%ld|%ld|%u|", cur->pid, cur->tgid, cur->thread_info->cpu); %} probe kernel.function("sys_read") { if(pid() == target()) { counter-- info() log("pid:".string(pid())." target:".string(target())."entry") } } probe kernel.function("sys_read").return { if(pid() == target()) { counter++ info() log("pid:".string(pid())." target:".string(target())."return") } } probe begin { counter=100 } probe end { log("counter: ".string(counter)) } then I run: stap -g a.stp -c "ls > a" The output: root:/root/temp>stap -g b.stp -c "ls > a" |3713|3713|3|0|pid:3713 target:3713entry |3713|3713|3|0|pid:3713 target:3713entry |3713|3713|3|0|pid:3713 target:3713entry |3713|3713|3|0|pid:3713 target:3713entry |3713|3713|3|0|pid:3713 target:3713entry counter: 95 It seemed that the return probe didn't work for me. I tried the same script on a uni-processor x86 system, it worked fine. And I also tried to write a simple c application which will open a file, and read some data from this file. I run it: stap -g b.stp -c "./a.out" It gave the output like: ... |3881|3881|0|0|pid:3881 target:3881entry |3881|3881|0|0|pid:3881 target:3881entry |3881|3881|0|0|pid:3881 target:3881entry |3881|3881|0|0|pid:3881 target:3881return |3881|3881|0|0|pid:3881 target:3881entry |3881|3881|0|0|pid:3881 target:3881return |3881|3881|0|0|pid:3881 target:3881entry .... |3881|3881|3|0|pid:3881 target:3881entry |3881|3881|3|0|pid:3881 target:3881return counter: 33 You can see that there are still some return probes not be executed at all(if all are executed, the counter should be 100). Could anybody give me a hint about this problem? Best Regards, Li Guanglei