From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2951 invoked by alias); 11 Dec 2015 20:59:59 -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 2928 invoked by uid 89); 11 Dec 2015 20:59:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 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; Fri, 11 Dec 2015 20:59:55 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 5D8F618AEA6; Fri, 11 Dec 2015 20:59:54 +0000 (UTC) Received: from [10.13.129.159] (dhcp129-159.rdu.redhat.com [10.13.129.159]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBBKxrGZ007541; Fri, 11 Dec 2015 15:59:54 -0500 Subject: Re: Recent aarch64 kprobes and uprobes patch systemtap testing To: David Long , systemtap@sourceware.org References: <5669DF98.3030601@redhat.com> <5669EABE.7040507@linaro.org> Cc: Pratyush Anand From: William Cohen Message-ID: <566B3949.2090900@redhat.com> Date: Fri, 11 Dec 2015 20:59:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5669EABE.7040507@linaro.org> Content-Type: multipart/mixed; boundary="------------000801040308000403050806" X-IsSubscribed: yes X-SW-Source: 2015-q4/txt/msg00274.txt.bz2 This is a multi-part message in MIME format. --------------000801040308000403050806 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 4811 On 12/10/2015 04:12 PM, David Long wrote: > On 12/10/2015 03:24 PM, William Cohen wrote: >> The fslatency-nd and fsslower-nd tests need further investigation: >> >> PASS: ./systemtap.examples/lwtools/fslatency-nd build >> meta taglines 'test_installcheck: stap fslatency-nd.stp 1 1' tag 'test_installcheck' value 'stap fslatency-nd.stp 1 1' >> attempting command stap fslatency-nd.stp 1 1 >> OUT ERROR: read fault [man error::fault] at 0x0000000000000034 (addr) near operator '@cast' at fslatency-nd.stp:66:15 >> Tracing FS sync reads and writes... Output every 1 secs. >> WARNING: Number of errors: 1, skipped probes: 1 >> WARNING: /root/systemtap_write/install/bin/staprun exited with status: 1 >> Pass 5: run failed. [man error::pass5] >> child process exited abnormally >> RC 1 >> FAIL: ./systemtap.examples/lwtools/fslatency-nd run >> >> PASS: ./systemtap.examples/lwtools/fsslower-nd build >> meta taglines 'test_installcheck: stap fsslower-nd.stp -c "sleep 1"' tag 'test_installcheck' value 'stap fsslower-nd.stp -c "sleep 1"' >> attempting command stap fsslower-nd.stp -c "sleep 1" >> OUT ERROR: read fault [man error::fault] at 0x0000000000000034 (addr) near operator '@cast' at fsslower-nd.stp:68:15 >> Tracing FS sync reads and writes slower than 10 ms... Hit Ctrl-C to end. >> TIME PID COMM FUNC SIZE LAT(ms) >> WARNING: Number of errors: 1, skipped probes: 1 >> WARNING: /root/systemtap_write/install/bin/staprun exited with status: 1 >> Pass 5: run failed. [man error::pass5] >> child process exited abnormally >> RC 1 >> FAIL: ./systemtap.examples/lwtools/fsslower-nd run > > Cool. Wish I could make sense of systemtap error messages. > > At Will Deacon's suggested I tested probing the instruction in __copy_to_user that can cause a captured kernel exception when an application passes in a bad buffer address. Unfortunately the result was a hang. So copy_to/from user is going to have to be blacklisted for now, unless there turns out to be a simple fix. I'm worried there might be other places in the kernel where an otherwise probeable instruction might be expected to generate an exception. > > -dl > > > Hi Dave and Pratyush, I did some more experimentation with the fslatency-nd and fsslow-nd tests to see what is going on. The problem seems to be related to the return probes. I have a small reproducer attached which runs fine on x86_64 machine. However on aarch64 it has the bogus read because some of the argument registers have changed value # ../install/bin/stap ./aarch64_retkprobe_issue2.stp ERROR: read fault [man error::fault] at 0x0000000000000034 (addr) near operator '@cast' at ./aarch64_retkprobe_issue2.stp:13:7 pc : [] lr : [] pstate: 80000145 sp : fffffe00bad7be30 x29: fffffe00bad7be30 x28: fffffe00bad78000 x27: fffffe0000912000 x26: 000000000000003f x25: 000000000000011d x24: 0000000000000015 x23: 0000000080000000 x22: 000003fff82b9760 x21: fffffe00bad7bec8 x20: 0000000000002004 x19: fffffe01b716e100 x18: 000003fff82b8160 x17: 000003ff849bf0a0 x16: fffffe000021f4a0 x15: 0000000000000004 x14: 000003fff82bb910 x13: 0000000000000001 x12: 000003ff7d75f200 x11: 00000000003d0f00 x10: 000003ff849b7af4 x9 : 0000000000000028 x8 : 0000000000000020 x7 : fffffe00bc5c3600 x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000000 x3 : fffffe00bad7bec8 x2 : 0000000000002004 x1 : 000003fff82b9760 x0 : fffffe01b716e100 pc : [] lr : [] pstate: 60000145 sp : fffffe00bad7be30 x29: fffffe00bad7be30 x28: fffffe00bad78000 x27: fffffe0000912000 x26: 000000000000003f x25: 000000000000011d x24: 0000000000000015 x23: 0000000080000000 x22: 000003fff82b9760 x21: fffffe00bad7bec8 x20: 0000000000002004 x19: fffffe01b716e100 x18: 000003fff82b8160 x17: 000003ff849bf0a0 x16: fffffe000021f4a0 x15: 0000000000000004 x14: 000003fff82bb910 x13: 0000000000000001 x12: 000003ff7d75f200 x11: 00000000003d0f00 x10: 000003ff849b7af4 x9 : 0000000000000028 x8 : 0000000000000020 x7 : fffffe00bc5c3600 x6 : 000003fff82b976c x5 : 000003fff82b976c x4 : 0000000000000000 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : 000000000000000c WARNING: Number of errors: 1, skipped probes: 1 WARNING: /root/systemtap_write/install/bin/staprun exited with status: 1 Pass 5: run failed. [man error::pass5] Comment the return probe with a '#' at the beginning of the line with "kprobe.function("__vfs_read").return," and the script runs fine. The systemtap pointer_arg() doesn't take into account that the register might be used as a scratch register and the value changed after entry into the function. This is an issue with the systemtap scripts. I have patched the systemtap scripts to addresss this issue.. -Will --------------000801040308000403050806 Content-Type: text/plain; charset=UTF-8; name="aarch64_retkprobe_issue2.stp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="aarch64_retkprobe_issue2.stp" Content-length: 643 IyBUaGUgcmV0dXJuIHByb2JlIGFwcGVhcnMgdG8gY2F1c2UgdGhpcyByZXBy b2R1Y2VyIHRvIGNyYXNoCiMga3Byb2JlLmZ1bmN0aW9uKCJfX3Zmc19yZWFk IikucmV0dXJuIGNhdXNlcyBhIHJlYWQgZmF1bHQKIyBjb21tZW50IG91dCB0 aGUga3Byb2JlLmZ1bmN0aW9uKCJfX3Zmc19yZWFkIikucmV0dXJuIGFuZCB0 aGUKIyBzY3JpcHQgcnVucyB3aXRob3V0IGVycm9yCnByb2JlCiAgICAgIGtw cm9iZS5mdW5jdGlvbigiX192ZnNfcmVhZCIpLnJldHVybiwKICAgICAga3By b2JlLmZ1bmN0aW9uKCJfX3Zmc19yZWFkIikKewoJIyBTa2lwIHRoZSBjYWxs IGlmIG5ld19zeW5jX3JlYWQoKSB3b3VsZG4ndCBiZSBjYWxsZWQuCglmaWxl ID0gcG9pbnRlcl9hcmcoMSkKCWlmIChmaWxlKSB7CgkJcHJpbnRfcmVncygp OwogCQlpZihAY2FzdChmaWxlLCAiZmlsZSIpLT5mX29wLT5yZWFkKSB7CgkJ CW5leHQKCQl9Cgl9CglleGl0KCkKfQo= --------------000801040308000403050806--