Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1738749imn; Sun, 31 Jul 2022 20:30:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vzdYPO85PlQiTEFqABmZxBOmLuJZ8t6ILIETWrMCvM+tl6P5OaFuOvTtwhJxbp1QHCa6uQ X-Received: by 2002:a05:6402:51ca:b0:43a:df65:d180 with SMTP id r10-20020a05640251ca00b0043adf65d180mr14152972edd.255.1659324622235; Sun, 31 Jul 2022 20:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659324622; cv=none; d=google.com; s=arc-20160816; b=VzuwRvWUclD2COM/zco3hny+/6p5ugFA9E2dpb9IzdVhFapzfXiZTUpakEMsAnoHfB aFYD3v/21f9SK9YTLBI7tiMD1JCqzMTQGwLYZo1RbsszvC/hlnWht3i3PhaQHRbjIkHF 6vkM7BBPpq8skk5JeQbjyWGcRRpTnFQpFXObFIHr5lBaoB6Y+x4QOaUtZzcydlPJWNPJ kEP2dy5Tb3ONOYKWANzE7kmZg6grDHBRWzmSCTV3YEfzYIGM0MOh9/1UIcvX9vbPcoJo Wr9ySzci2fQ05kJ5HSi9i/mWrkwpo4eTP9R5WMUmOgHqOfNxwnvmkfPemxJ1lVCShg1r 59dw== 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=IJHrPUS5vMolrkYpIEQoNDnzA3QDyfgN1Zdc/0DReK8=; b=jc5VfQFzCCeut21yNwqm0TKhO1lCDsVqoVnPGbv2osTK3JGn8jYnVhY3DSYc8aqbx6 jS5k6mG8988kD9Dc+1qE+cl2nYsqkZyDqc3amVpcWapVIEBEZHFxIK2hcjF1hWosBzai abk/o4PtnEQYD0RWeGhq+RorgpgLYU+YoiNKsHTZ84u0p1grhPZz4b/iFoHiF5tHlI63 bQjV5ggS36MT2zWl5LlANbmtgtryDoGAEsT/Xi22ismQbv48YXOA46xPosHaiB1Uy/HF vYEexHruEl5Hw2RQlTUYwfdjVYh1IosRzTgFV+1fCv257Yg5ctflSbZ0eYTLhXsnjnV8 g3PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PolyEiYk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020a170906975000b00730947701dbsi149266ejy.485.2022.07.31.20.29.57; Sun, 31 Jul 2022 20:30:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PolyEiYk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239080AbiHACcy (ORCPT + 99 others); Sun, 31 Jul 2022 22:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239052AbiHACcl (ORCPT ); Sun, 31 Jul 2022 22:32:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A45D13CCF for ; Sun, 31 Jul 2022 19:32:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A4F0F61210 for ; Mon, 1 Aug 2022 02:32:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9932C433D7; Mon, 1 Aug 2022 02:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659321159; bh=ngzqObwtwIp2kbdKF1z/NesmrXUK7HAjk3wY6TqLDeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PolyEiYkekg3yuJn8tKEgRqOGxr2ij/b3czk8uAfmTSN0nhuEunx1nubZ980vdITt qtYwIFV4kMMmND+AC09ZuHnnEky/SdSceqOAf/e3xG1BpCSNbX14psSletYS/ruqqn Bt+CW8Gw+dFtw6D5JtNL551YEVabHXLOrfwYSugmW7xZ59BNaWQUwm87M/rGfMK5Ug Q4ynh9Dql5QCuu1I9VT+Ukpb8Rqi/ZVR7D/AicZ28fPGe3MAWiy8P6FKugQTtDzEfn E6dWDd9Jn4fn4t80pvSZP77soojTYYartt3q8gGAlcyExwBsUn8D6igKCaXURETSt5 7b7jWAhmrPMsA== From: "Masami Hiramatsu (Google)" To: Steven Rostedt Cc: LKML , Tzvetomir Stoyanov , Ingo Molnar , Masami Hiramatsu Subject: [PATCH 3/3] selftests/ftrace: Add eprobe syntax error testcase Date: Mon, 1 Aug 2022 11:32:34 +0900 Message-Id: <165932115471.2850673.8014722990775242727.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <165932112555.2850673.7704483936633223533.stgit@devnote2> References: <165932112555.2850673.7704483936633223533.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masami Hiramatsu (Google) Add a syntax error test case for eprobe as same as kprobes. Signed-off-by: Masami Hiramatsu (Google) --- .../test.d/dynevent/eprobes_syntax_errors.tc | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc new file mode 100644 index 000000000000..fc1daac7f066 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc @@ -0,0 +1,27 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Event probe event parser error log check +# requires: dynamic_events events/syscalls/sys_enter_openat ". []":README error_log + +check_error() { # command-with-error-pos-by-^ + ftrace_errlog_check 'event_probe' "$1" 'dynamic_events' +} + +check_error 'e ^a.' # NO_EVENT_INFO +check_error 'e ^.b' # NO_EVENT_INFO +check_error 'e ^a.b' # BAD_ATTACH_EVENT +check_error 'e syscalls/sys_enter_openat ^foo' # BAD_ATTACH_ARG +check_error 'e:^/bar syscalls/sys_enter_openat' # NO_GROUP_NAME +check_error 'e:^12345678901234567890123456789012345678901234567890123456789012345/bar syscalls/sys_enter_openat' # GROUP_TOO_LONG + +check_error 'e:^foo.1/bar syscalls/sys_enter_openat' # BAD_GROUP_NAME +check_error 'e:^ syscalls/sys_enter_openat' # NO_EVENT_NAME +check_error 'e:foo/^12345678901234567890123456789012345678901234567890123456789012345 syscalls/sys_enter_openat' # EVENT_TOO_LONG +check_error 'e:foo/^bar.1 syscalls/sys_enter_openat' # BAD_EVENT_NAME + +check_error 'e:foo/bar syscalls/sys_enter_openat arg=^dfd' # BAD_FETCH_ARG +check_error 'e:foo/bar syscalls/sys_enter_openat ^arg=$foo' # BAD_ATTACH_ARG + +check_error 'e:foo/bar syscalls/sys_enter_openat if ^' # NO_EP_FILTER + +exit 0