Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3467658imu; Sun, 11 Nov 2018 15:47:06 -0800 (PST) X-Google-Smtp-Source: AJdET5eTRfja1IcJV6XXLnMkVKlfqw2HR1qtIL5b2l+YrgSp/z1qSpfjWuT5L6LouEbpaNarHdNN X-Received: by 2002:a63:7044:: with SMTP id a4mr15114317pgn.359.1541980026899; Sun, 11 Nov 2018 15:47:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980026; cv=none; d=google.com; s=arc-20160816; b=eGtpW7ZK7BsKJv1zWelN5xaNeIgqbDncTGb5pdlMxLifljirpzRzMWoyWXbDwiODeH 8ZTgc7NxaU0p3b9ckrrWIQW4JU75IwDdgeNdVfayGiuOzTz8vOT+85RaJZ+grQcIFraP zKvpWpca4XFygeUXzzPpObqbYmkHzs3XwZkYw4ixiLPXFF0+ommhwugs21ru/T9VKR3s cz9ZLMf1aqUMmGjIzzyDO4rKObVavLpz7JoGBGlryNgTkXz74QFbo5c/3mJMxNGgnU6L rgrWRQtNAkYM+6I9z7ScFQFsyB6hQq1TnFCMSnyCuwHzt65dAkghRSPDui2i41ZJcLky wHhg== 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:dkim-signature; bh=Vw6XXN+eZUanH4Wc1nZa3JM1Vb5TKv4W8Tbv/O2I13Y=; b=auo/097AIE1coX2fIhJQGBaxrYhevjiCxgtd/4n35RW1EeywhhCW+c+hsJByBda+x8 Ef5WFjqg03sONmLzrVG5+7HPR+qsimuB1YWCPH3p6kbF9scT8vtvPlOrbbkbyb6ZhIKL hOsMNXGJUcA79vwFuKiMAw7tHyAJzWnUynKdgE+UWyuZ7caJk3ygMXdlZ6lJjRbdtCHU DXqEmG79DKOPJeR7/Vbpw+kTTwwYRf/Uz4dSTlQQHCqnbZQq6HWqTO/D3TmcBRJCwKTh TneWJ2VspFU4Ow/BHYVQucqErvZFIBPupQ6QpBg4okRdrJDpX256dfzJw8lp/Q3hu84Q mVTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zSqDBWB2; 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 f3-v6si13383943pgq.536.2018.11.11.15.46.51; Sun, 11 Nov 2018 15:47:06 -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; dkim=pass header.i=@kernel.org header.s=default header.b=zSqDBWB2; 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 S1733255AbeKLITB (ORCPT + 99 others); Mon, 12 Nov 2018 03:19:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:39636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730141AbeKLITA (ORCPT ); Mon, 12 Nov 2018 03:19:00 -0500 Received: from localhost (unknown [206.108.79.134]) (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 CE5B221104; Sun, 11 Nov 2018 22:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975344; bh=1yN4KlMFrxDcpE7I0OTQy/0svzIK/NFZB2v2LZgbJnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zSqDBWB2OTvKW4He3kcGX8HG21+yylg1XCGGTQCayO2BZKOXNdIYvu3sTNJACQEEs 36/OiDfDXgtQ6cOzr1bH4b1nUBHZA+qnkLT+DtJDfoLhL7ylpIBGYXcBiqqdUKVnKg 8MydkfBt11UW7tpKnS2MYZdgFibkAppDTgfdlB/o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shuah Khan , Tom Zanussi , Tom Zanussi , Tom Zanussi , Rajvi Jingar , Masami Hiramatsu , "Steven Rostedt (VMware)" Subject: [PATCH 4.19 323/361] selftests/ftrace: Fix synthetic event test to delete event correctly Date: Sun, 11 Nov 2018 14:21:10 -0800 Message-Id: <20181111221659.241545882@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu commit 0d0352d8b3d6d7ca9a710b40e194cbbaeb841c88 upstream. Fix the synthetic event test case to remove event correctly. If redirecting command to synthetic_event file without append mode, it cleans up all existing events and execute (parse) the command. This means "delete event" always fails to find the target event. Since previous synthetic event has a bug which doesn't return -ENOENT even if it fails to find the deleting event, this test passed. But fixing that bug, this test fails because this test itself has a bug. This fixes that bug by trying to delete event right after adding an event, and use append mode redirection ('>>') instead of normal redirection ('>'). Link: http://lkml.kernel.org/r/154013452832.25576.2305459545429386517.stgit@devbox Acked-by: Shuah Khan Acked-by: Tom Zanussi Tested-by: Tom Zanussi Cc: Tom Zanussi Cc: Tom Zanussi Cc: Rajvi Jingar Cc: Shuah Khan Cc: stable@vger.kernel.org Fixes: f06eec4d0f2c ('selftests: ftrace: Add inter-event hist triggers testcases') Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc | 12 +++++----- 1 file changed, 6 insertions(+), 6 deletions(-) --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc @@ -35,18 +35,18 @@ fi reset_trigger -echo "Test create synthetic event with an error" -echo 'wakeup_latency u64 lat pid_t pid char' > synthetic_events > /dev/null +echo "Test remove synthetic event" +echo '!wakeup_latency u64 lat pid_t pid char comm[16]' >> synthetic_events if [ -d events/synthetic/wakeup_latency ]; then - fail "Created wakeup_latency synthetic event with an invalid format" + fail "Failed to delete wakeup_latency synthetic event" fi reset_trigger -echo "Test remove synthetic event" -echo '!wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events +echo "Test create synthetic event with an error" +echo 'wakeup_latency u64 lat pid_t pid char' > synthetic_events > /dev/null if [ -d events/synthetic/wakeup_latency ]; then - fail "Failed to delete wakeup_latency synthetic event" + fail "Created wakeup_latency synthetic event with an invalid format" fi do_reset