Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp889678pxb; Wed, 3 Mar 2021 19:52:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxM7ScSKBsN9rUHRMtJCixM032qZ99+LqXwEcbBqiBiIzw3gVtCBYT8p8u21iqOK2qgCoT1 X-Received: by 2002:a05:6402:5194:: with SMTP id q20mr2213967edd.267.1614829970867; Wed, 03 Mar 2021 19:52:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614829970; cv=none; d=google.com; s=arc-20160816; b=Ce02wR/GWn0d2O+9/FU2kOI1Q5hxHMXe0Y8ZwLmL58+z1yCztXS5gE6PTsykBrtsnZ DpObVic4LxiGO7d9DOERTv9HfaOV4CIivA1Nm6K36UsR282Gipu9im2V9d00MBAGARKr sZy+rox1kkmaNBoB2WDXLYlYd01tcx9ZsxgNidXX4LObRk3b4GmLmV/O85OY/C07zrsi qdVrpR2S7E+tanDI0YLicA4lJMYo1wsY4rJH5H0UBWGirRNpXBFVonhaDWPNaMn2lyK5 A92aJSEKaE2GTQK3uuzCOgU/znCSoTDn5BP94r0fmxiw3jmuBjAVl2bNcSVRzjUMvjVn IKrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TdZMEn0/gB6Apn5rnXvSVZEo9KWhV9GzG+0uzTFYDKg=; b=Lm/5/PzGUd6HfswWDaWvc4X9VEnHjAIVD/QRcqWonWCfh2BJeO2J/Kz2F8e9NvKyTG z90inwFlBpYOWPKSyRMDCPy5l/6QdN2UyXOcM8m2Ftj+FMsrxf9Q+x/MCNHNoG4h7A43 DtKtt6KUUtEPYE26PMiNbNnOT43oWc71zgrasjx//1N7bTRaqTLbLzCjDdQFjU/igt5J jPgyIvP7lrDmfY7x9IbHfe9kas/gUbM7gCVCtzxyHp1NFhv4OJ0/ByLzunkfsp8j68c0 P0EQPBWS4aegVQT8WJa6CwaX7gOqXkxU9u2abDy+/FVrhpQOI8alWTurEUJdGUO1zPQm v9pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w6BPsS2C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si5246784edj.481.2021.03.03.19.52.27; Wed, 03 Mar 2021 19:52:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w6BPsS2C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380358AbhCBBuo (ORCPT + 99 others); Mon, 1 Mar 2021 20:50:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:48598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241703AbhCAT2q (ORCPT ); Mon, 1 Mar 2021 14:28:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 687F665054; Mon, 1 Mar 2021 17:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619276; bh=BZ+59cz0G/FJDTov8lOoYT8F7N3HGL/cTj4rCPAqPW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w6BPsS2C9NwEGiZVAhHBph2NcGFNDXziDa5wwYdUJGUPZ/4MbRKsHCPZO1x6syu27 vFAo5P1JnT0b8ksNCUONbsHOa7Tdfk2Y8rnuXXwch8Zps2pgNbFJAb/xKW3lZvJqtt PxIGe9/j52t11oalB1FIhx+TxFDcpYhS92NjY+xc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Tom Zanussi , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 5.10 366/663] selftests/ftrace: Update synthetic event syntax errors Date: Mon, 1 Mar 2021 17:10:14 +0100 Message-Id: <20210301161159.954985356@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Zanussi [ Upstream commit b5734e997e1117afb479ffda500e36fa91aea3e8 ] Some of the synthetic event errors and positions have changed in the code - update those and add several more tests. Also add a runtime check to ensure that the kernel supports dynamic strings in synthetic events, which these tests require. Link: https://lkml.kernel.org/r/51402656433455baead34f068c6e9466b64df9c0.1612208610.git.zanussi@kernel.org Fixes: 81ff92a93d95 (selftests/ftrace: Add test case for synthetic event syntax errors) Reported-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin --- .../trigger-synthetic_event_syntax_errors.tc | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc index ada594fe16cb3..955e3ceea44b5 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc @@ -1,19 +1,38 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # description: event trigger - test synthetic_events syntax parser errors -# requires: synthetic_events error_log +# requires: synthetic_events error_log "char name[]' >> synthetic_events":README check_error() { # command-with-error-pos-by-^ ftrace_errlog_check 'synthetic_events' "$1" 'synthetic_events' } +check_dyn_error() { # command-with-error-pos-by-^ + ftrace_errlog_check 'synthetic_events' "$1" 'dynamic_events' +} + check_error 'myevent ^chr arg' # INVALID_TYPE -check_error 'myevent ^char str[];; int v' # INVALID_TYPE -check_error 'myevent char ^str]; int v' # INVALID_NAME -check_error 'myevent char ^str;[]' # INVALID_NAME -check_error 'myevent ^char str[; int v' # INVALID_TYPE -check_error '^mye;vent char str[]' # BAD_NAME -check_error 'myevent char str[]; ^int' # INVALID_FIELD -check_error '^myevent' # INCOMPLETE_CMD +check_error 'myevent ^unsigned arg' # INCOMPLETE_TYPE + +check_error 'myevent char ^str]; int v' # BAD_NAME +check_error '^mye-vent char str[]' # BAD_NAME +check_error 'myevent char ^st-r[]' # BAD_NAME + +check_error 'myevent char str;^[]' # INVALID_FIELD +check_error 'myevent char str; ^int' # INVALID_FIELD + +check_error 'myevent char ^str[; int v' # INVALID_ARRAY_SPEC +check_error 'myevent char ^str[kdjdk]' # INVALID_ARRAY_SPEC +check_error 'myevent char ^str[257]' # INVALID_ARRAY_SPEC + +check_error '^mye;vent char str[]' # INVALID_CMD +check_error '^myevent ; char str[]' # INVALID_CMD +check_error '^myevent; char str[]' # INVALID_CMD +check_error '^myevent ;char str[]' # INVALID_CMD +check_error '^; char str[]' # INVALID_CMD +check_error '^;myevent char str[]' # INVALID_CMD +check_error '^myevent' # INVALID_CMD + +check_dyn_error '^s:junk/myevent char str[' # INVALID_DYN_CMD exit 0 -- 2.27.0