From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20970 invoked by alias); 26 Jun 2009 21:26:43 -0000 Received: (qmail 20963 invoked by uid 22791); 26 Jun 2009 21:26:43 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_73,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Jun 2009 21:26:36 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5QLQY8h024622 for ; Fri, 26 Jun 2009 17:26:34 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5QLQYBs007479 for ; Fri, 26 Jun 2009 17:26:34 -0400 Received: from multics.rdu.redhat.com (multics.rdu.redhat.com [10.11.228.43]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5QLQXo2022854 for ; Fri, 26 Jun 2009 17:26:34 -0400 Message-ID: <4A453D09.60600@redhat.com> Date: Fri, 26 Jun 2009 21:26:00 -0000 From: Stan Cox User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: systemtap@sourceware.org Subject: new static user probe types Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2009-q2/txt/msg01058.txt.bz2 There are now two new static user probe types, one that uses utrace and one that uses kprobes. They are currently available by compiling with -DEXPERIMENTAL_UTRACE_SDT and -DEXPERIMENTAL_KPROBE_SDT. The code in tapsets.cxx has been refactored by creating a probe_table and an sdt_var_expanding_visitor. The probe_table handles retrieving probes from the .probes section and building an stap probe. The sdt_var_expanding_visitor handles expanding arguments. A kprobe probe currently maps to the getegid syscall. The probe_table::convert_probe method will synthesize something like this: The string comparison is acknowledged to be expensive and needs to be replaced by an integer comparison. kernel.function("*sys_getegid*") { // Only done for i386 regparm(0) // Did we get here for the probe in question? if ((user_string(ulong_arg(1))) != ("test_probe_4")) next } A utrace probe uses a dummy syscall value and uses the stap utrace syscall infrastructure. The probe_table::convert_probe method will synthesize something like this: process("PATH").syscall { // Did we get here for the probe in question? if ((user_string(_utrace_syscall_arg(0))) != ("test_probe_4")) next // Is this the expected task? if ((task_tid(task_current())) != (_utrace_syscall_arg(1))) next // Is this the "fake" syscall from the sdt probe? if ((_utrace_syscall_nr()) != (48813)) next }