Received: by 10.213.65.68 with SMTP id h4csp337591imn; Sat, 17 Mar 2018 05:52:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELv+hrzJGlZSjEpgZsr8MoY/GsdWTqusy3P5FbQIpj5LxrjUociwcoxJZnE0RIHh48LE+u6z X-Received: by 10.101.82.203 with SMTP id z11mr4322813pgp.245.1521291161617; Sat, 17 Mar 2018 05:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521291161; cv=none; d=google.com; s=arc-20160816; b=j48x6stcoevwCjFzw7cBkOkFUZHBl8BgMgSLbUkDCXFWyBAjAB2DPvqf9Frxx47E4c X/Vxwyi0+/3RrrrqHcp+I2rCdn8fWeegN/iNsKlmHyfTQorP/oDQN6An0VS3pE4czT2h LH3LT+jBBKOM2dhsu00nVNlA2DbHGkOphfkXjy2zoaFoqp6MQSOVwIWG2LymxnLcs/e8 mcVAs69E32pW4eEoUlW2MVo6HVhzeZ/4yXUa2msSGBT7IZ8ZVdgwMIe/qfF1XPqrIjl2 wy4USoa4TyAyHZuU1fD1wMnIVRL/wW76gkHgTXJQR8yE86S+JhAVDWLsNWclHdYTFbS1 Z2/A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:arc-authentication-results; bh=LuFBGSDhnBfj36rlMa/OVHq9E+o01k8uEkk1ZlK2Llk=; b=Z9YxrlMHDmp5AELLzaxtjgFFncahsarR7q8MpzNM8ncz6uzWpEeqyiwxLNBL4Bioa6 51MJu/tA8YELpK4x6ZfVF7SnFzqXxSszC9/Yx/XEVNpyU7xa6Cz6YHxc0z0+dKGCWIw3 qvrpS7PToWXbxMcl/zXauEPy/2uvVcwamH0eFer1LG3v2UZZclGAr7Xhr9Q+NpQikN+W KCZPUFCw5owi+muSNOzqXxrOYMys5RQ/bOyhYQDlBWrx5gYbX5zXBfHbReWx9iGGRDa8 AojwnrNHUZhL9FI2zfkU4tJgfMFIpNmkq93iMzHajW8HRHjT3nt0tl3HkX65RfIL+6z6 rc0w== 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 g3-v6si8444882pll.290.2018.03.17.05.52.27; Sat, 17 Mar 2018 05:52:41 -0700 (PDT) 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 S1753336AbeCQMvg (ORCPT + 99 others); Sat, 17 Mar 2018 08:51:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:52530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692AbeCQMve (ORCPT ); Sat, 17 Mar 2018 08:51:34 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (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 A038221720; Sat, 17 Mar 2018 12:51:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A038221720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mhiramat@kernel.org From: Masami Hiramatsu To: Steven Rostedt , linux-kernel@vger.kernel.org Cc: mhiramat@kernel.org, Ingo Molnar , Namhyung Kim , Tom Zanussi , Arnaldo Carvalho de Melo , linux-trace-users@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, Ravi Bangoria Subject: [PATCH v6 18/21] selftests: ftrace: Add a testcase for $argN with kprobe_event Date: Sat, 17 Mar 2018 21:50:54 +0900 Message-Id: <152129105459.31874.15978479654038019110.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <152129024033.31874.15800253385376959274.stgit@devbox> References: <152129024033.31874.15800253385376959274.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a testcase for $argN with kprobe event. This tests whether the traced data is correct or not. If the kernel doesn't support $argN (depends on arch), it skips the test as UNSUPPORTED. Signed-off-by: Masami Hiramatsu --- Changes in v5: - Fix description. --- .../ftrace/test.d/kprobe/kprobe_args_argN.tc | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_argN.tc diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_argN.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_argN.tc new file mode 100644 index 000000000000..d5c5c8c3a51e --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_argN.tc @@ -0,0 +1,25 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Kprobe event argN argument + +[ -f kprobe_events ] || exit_unsupported # this is configurable + +grep -q "arg" README || exit_unsupported # version issue + +echo 0 > events/enable +echo > kprobe_events + +: "Test bad pattern : arg0 is not allowed" +! echo 'p:testprobe create_trace_kprobe $arg0' > kprobe_events + +: "Test get argument" +echo 'p:testprobe create_trace_kprobe $arg1' > kprobe_events +echo 1 > events/kprobes/testprobe/enable +! echo test >> kprobe_events +tail -n 1 trace | grep -qe "testprobe.* arg1=0x1" + +! echo test test test >> kprobe_events +tail -n 1 trace | grep -qe "testprobe.* arg1=0x3" + +echo 0 > events/enable +echo > kprobe_events