From patchwork Thu Apr 25 05:59:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1090609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44qRNT0NVJz9s5c; Thu, 25 Apr 2019 15:59:52 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hJXQD-000697-8U; Thu, 25 Apr 2019 05:59:49 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hJXQB-00068S-J6 for kernel-team@lists.ubuntu.com; Thu, 25 Apr 2019 05:59:47 +0000 Received: from mail-pg1-f198.google.com ([209.85.215.198]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hJXQB-0000Uz-1m for kernel-team@lists.ubuntu.com; Thu, 25 Apr 2019 05:59:47 +0000 Received: by mail-pg1-f198.google.com with SMTP id x2so13638961pge.16 for ; Wed, 24 Apr 2019 22:59:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=dFT8zF0DvRcrRvQB04qZQB8xY0w0XYtz9ziwU5gCdsc=; b=MOn+Vi1id/invqqJ3CmCsTyt5fDWmWuKGfw+d5bupJUjcQcdmLg1EarBr3gNfU+h7e EDrAu9vl+KX3FApTyhDl3HGeNYrmqXyuLrtzQVcdvnKhw4AT9o0/OKlVCzNfTIflGHU1 wEpUjly+012z8+Gu10FdL0ARVhVmvrkGaA+7E6HuV+A9VsZCufdJCVwGtjJd8oyiEI86 CQYisvQWMzkGbj0P+se15wWwYnJL+5tPc5zDz9r5cG/vxwXC9sHFiKKWDZGq8E/bQCcg yIspy1TuZc32ak4I2lN70CfSMo4nFNQQE2jTHL+ZwYrdHbhsVNKSgqPydtKa4GyQhJVM WAwg== X-Gm-Message-State: APjAAAUsvlwmrXqDqOLd+jEGeVgAM4qeml1K1ZCvlFm5Qf8Xr6jUDRFP /U0BXUintGDLOkFT+aIJmM27yzheDTorT/3Slz5vdN1/MVYWEmuI6U/U8QT3+6nKokSFAroabHc lZbogWuKAnHXfh5REp/7M7X/R6DC4J45FPTh+kKcy X-Received: by 2002:a63:d24d:: with SMTP id t13mr35080783pgi.439.1556171985319; Wed, 24 Apr 2019 22:59:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnrZLiusN67N2xAsbwrG/ibsOZePe+QRQ1WqO6B78ubEnxhtCMy28VtRgOACtU5dogN+JMzQ== X-Received: by 2002:a63:d24d:: with SMTP id t13mr35080765pgi.439.1556171985111; Wed, 24 Apr 2019 22:59:45 -0700 (PDT) Received: from Leggiero.taipei.internal (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id f66sm7539998pfa.5.2019.04.24.22.59.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 22:59:44 -0700 (PDT) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [X][B][C][SRU][PATCHv2 1/1] selftests/ftrace: Fix kprobe string testcase to not probe notrace function Date: Thu, 25 Apr 2019 13:59:38 +0800 Message-Id: <20190425055938.32546-2-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190425055938.32546-1-po-hsu.lin@canonical.com> References: <20190425055938.32546-1-po-hsu.lin@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Masami Hiramatsu BugLink: https://bugs.launchpad.net/bugs/1825780 Fix kprobe string argument testcase to not probe notrace function. Instead, it probes tracefs function which must be available with ftrace. Link: http://lkml.kernel.org/r/153294607107.32740.1664854684396589624.stgit@devbox Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 6fc7c4110cbaff85b1f49fd70b77950384c3a201) Signed-off-by: Po-Hsu Lin --- .../ftrace/test.d/kprobe/kprobe_args_string.tc | 30 +++++++++------------- .../selftests/ftrace/test.d/kprobe/probepoint.tc | 2 +- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc index a000256..1ad70cd 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc @@ -9,28 +9,22 @@ echo > kprobe_events case `uname -m` in x86_64) - ARG2=%si - OFFS=8 + ARG1=%di ;; i[3456]86) - ARG2=%cx - OFFS=4 + ARG1=%ax ;; aarch64) - ARG2=%x1 - OFFS=8 + ARG1=%x0 ;; arm*) - ARG2=%r1 - OFFS=4 + ARG1=%r0 ;; ppc64*) - ARG2=%r4 - OFFS=8 + ARG1=%r3 ;; ppc*) - ARG2=%r4 - OFFS=4 + ARG1=%r3 ;; *) echo "Please implement other architecture here" @@ -38,17 +32,17 @@ ppc*) esac : "Test get argument (1)" -echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string" > kprobe_events +echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string" > kprobe_events echo 1 > events/kprobes/testprobe/enable -! echo test >> kprobe_events -tail -n 1 trace | grep -qe "testprobe.* arg1=\"test\"" +echo "p:test _do_fork" >> kprobe_events +grep -qe "testprobe.* arg1=\"test\"" trace echo 0 > events/kprobes/testprobe/enable : "Test get argument (2)" -echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string arg2=+0(+${OFFS}(${ARG2})):string" > kprobe_events +echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string arg2=+0(${ARG1}):string" > kprobe_events echo 1 > events/kprobes/testprobe/enable -! echo test1 test2 >> kprobe_events -tail -n 1 trace | grep -qe "testprobe.* arg1=\"test1\" arg2=\"test2\"" +echo "p:test _do_fork" >> kprobe_events +grep -qe "testprobe.* arg1=\"test\" arg2=\"test\"" trace echo 0 > events/enable echo > kprobe_events diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc b/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc index 4fda01a..519d276 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc @@ -4,7 +4,7 @@ [ -f kprobe_events ] || exit_unsupported # this is configurable -TARGET_FUNC=create_trace_kprobe +TARGET_FUNC=tracefs_create_dir dec_addr() { # hexaddr printf "%d" "0x"`echo $1 | tail -c 8`