From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8526 invoked by alias); 11 Jul 2008 10:10:09 -0000 Received: (qmail 8517 invoked by uid 22791); 11 Jul 2008 10:10:08 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.190) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 11 Jul 2008 10:09:40 +0000 Received: by ti-out-0910.google.com with SMTP id y6so1766600tia.18 for ; Fri, 11 Jul 2008 03:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type; bh=m8rdORDkL+vb2fAvgktGti8d5iXpX4PeShT7p6/khcw=; b=CXSym7rFDDH4ptlrgtCiojeD97dgYiK2tgKGaxdLED+/Jg/Hot+3jdiNbehHXz45/G /mpxY+b/39I/c3J16/Vavcm0lrjabLEdKIAH/Fg3embcLhbhug4TdFcF2O/MOE1blfef 4qGwgYLi3+p3HrGuc1GOVS/3vJwJT5V2ZxeV0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; b=PwwQW2a95wwKdWkFODrhD4D+4gj4Y0m0V1acJVNCjKX2hAoLeg1oUji9otaZZ2y8z+ q6GMwcOz58B4TK4aCpVjmHer88nSo4c9mZVlskGgka3aercpz6nfBLqvRvAev721uLXq 9lRbDFTDkS3gygzopA0kJaZhoWu9RoiVBG2/U= Received: by 10.110.8.5 with SMTP id 5mr5883905tih.3.1215770977328; Fri, 11 Jul 2008 03:09:37 -0700 (PDT) Received: from ?9.124.35.39? ( [59.145.136.1]) by mx.google.com with ESMTPS id 2sm162431tif.7.2008.07.11.03.09.32 (version=SSLv3 cipher=RC4-MD5); Fri, 11 Jul 2008 03:09:36 -0700 (PDT) Message-ID: <48773122.3020800@gmail.com> Date: Fri, 11 Jul 2008 10:10:00 -0000 From: Anup C Shan User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: systemtap@sources.redhat.com CC: kghoshnitk@gmail.com, akinobu.mita@gmail.com, k-tanaka@ce.jp.nec.com Subject: [RFC 3/5] Slab allocation fault injection script References: <48773047.1050906@gmail.com> <487730B4.5070106@gmail.com> In-Reply-To: <487730B4.5070106@gmail.com> Content-Type: multipart/mixed; boundary="------------080004060803090505060108" X-Virus-Checked: Checked by ClamAV on sourceware.org 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: 2008-q3/txt/msg00141.txt.bz2 This is a multi-part message in MIME format. --------------080004060803090505060108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 109 The following script implements fault injection for kmem_cache_alloc() using the fault injection framework. --------------080004060803090505060108 Content-Type: text/plain; name="slab-faultinject.stp" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="slab-faultinject.stp" Content-length: 981 #!/usr/local/bin/stap %{ #include #include %} probe begin { fij_load_param(0,0,100,0,0,1,2000) fij_add_gfp_wait_param() } /* * Free the node if it was allocated. Effectively rolling back actions of * kmem_cache_alloc() function. */ function cleanup_alloc(cacheptr:long,objptr:long) %{ void *objp = (void *)THIS->objptr; struct kmem_cache *cachep = (struct kmem_cache *)THIS->cacheptr; if (objp != NULL) { kmem_cache_free(cachep,objp); objp = NULL; } %} /* * Check additional parameter of ignore_gfp_wait */ function should_fail_slab:long (flags:long) { if (fij_should_fail_gfp_wait(flags) == 0) return 0 return fij_should_fail() } /* * Method of fault injection: * Free the cache page created using kmem_cache_free() and send * fake return value NULL. */ probe kernel.function("kmem_cache_alloc@mm/slab.c").return { if (should_fail_slab($flags) == 0) next cleanup_alloc($cachep,$return) $return = 0 fij_done_fail() } --------------080004060803090505060108--