Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4891911ybf; Wed, 4 Mar 2020 12:50:58 -0800 (PST) X-Google-Smtp-Source: ADFU+vtNF+tbI0cVWs9pThPzA/stYcDUItovE432PWjbJVIwcPZGnQMMrTs368jW+GBa4RIZqIiR X-Received: by 2002:a05:6830:1144:: with SMTP id x4mr3790891otq.59.1583355058492; Wed, 04 Mar 2020 12:50:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583355058; cv=none; d=google.com; s=arc-20160816; b=Q+rkawdsU1j+yv8IWLt+yxwW4wLDvDQZ9i8tIcgpk2Rwp8S8xIumqYa7XMltiBeT4E Lijz5m2JkHWqAu1edCX0T26So4Ntj1k+CpuAmHG72I4wTPqHGwtwFVa2DQWYZc/47/Ay yoH1QrJOtgz2BEEWKasxxTSosNRZLJ/HinI/L6HGz1FDLYsJ5MFpONPRDJX7KGQaeUz0 m/WeGRpH80EtRGvW9FG3JcMHjuH3Q2m1kJyccNiYcph3FwE9reiaJq7owwYsqFkMCUOm nwJsXlzcUB49TQtquZZRX/4bCPxerttPg9nxbdyBMAgm+6SwchhXUW0IAuckrS7bK3qd 8sWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=WcuzGEY4xsUTlhBET/D0Ak9mmIa3MtpLV1FdRU8V0Nw=; b=wr8LK7+wyJpE1ppFl/OzHpRwKSLKIgMDd78Cz1e2HG07Ql78Ze3wY3kKgqYTc5Yzl5 mkPmi9yEhE7AWdtPyh9lr38gI4xoCGg200hIP+Fwh65747r+2SW9lVm9iOasyvSnZzeH 4nsf2wiRCZYKFaYCSozVBuFsZcTiU+Wv+2F2o3oj5DYWr8svL+4qlRcHmTy9zwLRLEQw ptbXzt3ffmpbR6TVdX78S5mp1K9la3YKebpXA40sAGWzV++ZzJM7H7EGPFXN3T6szZcT BmihYJK5oMpyfoBTaqezBHo8n0hW3COWOM2FbL3OOEP06KzJtzm70+6L2AanictIChut h4LQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si1959463otc.141.2020.03.04.12.50.46; Wed, 04 Mar 2020 12:50:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728955AbgCDUuH (ORCPT + 99 others); Wed, 4 Mar 2020 15:50:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:41576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728482AbgCDUuH (ORCPT ); Wed, 4 Mar 2020 15:50:07 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7112320828; Wed, 4 Mar 2020 20:50:06 +0000 (UTC) Date: Wed, 4 Mar 2020 15:50:04 -0500 From: Steven Rostedt To: Seth Forshee Cc: Ingo Molnar , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests/ftrace: Use printf instead of echo in kprobe syntax error tests Message-ID: <20200304155004.7dd033a3@gandalf.local.home> In-Reply-To: <20200304161435.23019-1-seth.forshee@canonical.com> References: <20200304161435.23019-1-seth.forshee@canonical.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Mar 2020 10:14:35 -0600 Seth Forshee wrote: > --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc > @@ -37,7 +37,7 @@ fi > > check_error 'p vfs_read ^$none_var' # BAD_VAR > > -check_error 'p vfs_read ^%none_reg' # BAD_REG_NAME > +check_error 'p vfs_read ^%%none_reg' # BAD_REG_NAME > check_error 'p vfs_read ^@12345678abcde' # BAD_MEM_ADDR > check_error 'p vfs_read ^@+10' # FILE_ON_KPROBE > > @@ -80,7 +80,7 @@ check_error 'p vfs_read arg1=^' # NO_ARG_BODY > # instruction boundary check is valid on x86 (at this moment) > case $(uname -m) in > x86_64|i[3456]86) > - echo 'p vfs_read' > kprobe_events > + printf 'p vfs_read' > kprobe_events > if grep -q FTRACE ../kprobes/list ; then > check_error 'p ^vfs_read+3' # BAD_INSN_BNDRY (only if function-tracer is enabled) > fi > @@ -89,13 +89,13 @@ esac > > # multiprobe errors > if grep -q "Create/append/" README && grep -q "imm-value" README; then > -echo 'p:kprobes/testevent _do_fork' > kprobe_events > +printf 'p:kprobes/testevent _do_fork' > kprobe_events > check_error '^r:kprobes/testevent do_exit' # DIFF_PROBE_TYPE > -echo 'p:kprobes/testevent _do_fork abcd=\1' > kprobe_events > -check_error 'p:kprobes/testevent _do_fork ^bcd=\1' # DIFF_ARG_TYPE > -check_error 'p:kprobes/testevent _do_fork ^abcd=\1:u8' # DIFF_ARG_TYPE > -check_error 'p:kprobes/testevent _do_fork ^abcd=\"foo"' # DIFF_ARG_TYPE > -check_error '^p:kprobes/testevent _do_fork abcd=\1' # SAME_PROBE > +printf 'p:kprobes/testevent _do_fork abcd=\\1' > kprobe_events > +check_error 'p:kprobes/testevent _do_fork ^bcd=\\1' # DIFF_ARG_TYPE > +check_error 'p:kprobes/testevent _do_fork ^abcd=\\1:u8' # DIFF_ARG_TYPE > +check_error 'p:kprobes/testevent _do_fork ^abcd=\\"foo"'# DIFF_ARG_TYPE > +check_error '^p:kprobes/testevent _do_fork abcd=\\1' # SAME_PROBE > fi > > exit 0 This change causes my tests to fail: ++ echo 'Test command: p vfs_read arg1="abcd' Test command: p vfs_read arg1="abcd ++ echo ++ grep 'trace_kprobe: error:' -A 3 error_log [61913.240093] trace_kprobe: error: Invalid fetch argument Command: p vfs_read arg1="abcd ^ +++ tail -n 1 error_log +++ wc -c ++ N=29 +++ expr 13 + 21 ++ test 34 -eq 29 -- Steve