Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1483642iog; Sat, 25 Jun 2022 10:29:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1unpJhReUieq3+XDQd6vQUeUv6OSKHp28iZuxurwpuESKo+i7KuCFRKg32Dpfi2v/7NJsL3 X-Received: by 2002:a17:902:7686:b0:168:de55:8c45 with SMTP id m6-20020a170902768600b00168de558c45mr5422303pll.129.1656178168122; Sat, 25 Jun 2022 10:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656178168; cv=none; d=google.com; s=arc-20160816; b=r2D2agOC/vaKAuKj5FqYI4/8DIBZMi82Urav2wJPNZsuCVWbcybk043q4dPfYtqZQs fWYQpl5ipz3zM/5VkSV3oNxhIdlQ7yZEIKJO0x8HzQPRjTCvj3pVBoNCp5Y0sMfEz04W fvvubU2QH6X7uchvFGbpTbZJG3lz2TboJpWYulbbZLGOjKxgqN4WdDMIxbnwu1Agm2Rd Ti/TWAXz68hXQ5gZaNu7KxvOaIdM9j+EcE/R5I1bOv8o3Y2ae6fZHA9teDvok+dDLcW2 WgVrH9/+HWahdMkDQsBWHq4l3MVlNu+p+6q0kEVX+Rxles1wARSHapHXdvfDKmPuyJep ImKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7H5SaYzv2eC4qn7QVIEB3Nk4jIz7zk3QKC77y/SmGCc=; b=BXcSCdYK7Ncbxcfb9/foiMutENiD/5rtGWR60Q26GREP7rMoO4Jck/AAWwVOEd0Mco cRVl++nQXMKoPGB8EXyaimztlZZwvxi2iIuEun8EeCu+M5G1jy7MzETg6xdzDzbjpjSG aQgYcPfx5T8rNBds/k3evBpO4QHV7bcEuJ1FgxfPhABP906GVIctknAs6m7wIOE6Yua6 AR7WSFdHnpMvoZNx+fB5crYGefA9hYOvs72+LdVixrB5XmovtxgWxeJGyPWQlT/vVXJc hwLjVMZve2Vry8crH2b1U0j4q+CnP7UFy/pQ36Et+aUaVdgvYCqwCKDfpxPtTgWW4c3t LEeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PFQA8zKE; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a056a00098c00b0051be4655281si7974889pfg.39.2022.06.25.10.29.14; Sat, 25 Jun 2022 10:29:28 -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=@gmail.com header.s=20210112 header.b=PFQA8zKE; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233242AbiFYRFf (ORCPT + 99 others); Sat, 25 Jun 2022 13:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbiFYRFe (ORCPT ); Sat, 25 Jun 2022 13:05:34 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F0D415A1C; Sat, 25 Jun 2022 10:05:33 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id 93-20020a9d02e6000000b0060c252ee7a4so4210221otl.13; Sat, 25 Jun 2022 10:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7H5SaYzv2eC4qn7QVIEB3Nk4jIz7zk3QKC77y/SmGCc=; b=PFQA8zKEBn+igmT4Fu1/pNnWCTfpaSL8OvfqluOElWHkZih788+XHnlr6wVt0uh/N5 eCqSKeGUWbOL+WodDR5s34znFQOjK9V6P2CnHNAT3OuCN/Iytc5IJulpCe26mnrrmIsn gdDZ4Jb2ALLyTMfbZkluEnF306BhT4RRg0o59x+tiGeuw57jmWM9LzuPZRc4WKbDivEI WexCqhrp0MW7o3nq6/+9bV6lGPNUpWJxrJmpFq3qKeshDf8mU7+Pl0JjP2+6KqhNXqMD fFrOQ460vEdd/ThPd4DKofCwCf+aWSt+dhZHqsnEM5wACgQ7SeBEMpgp/1CSqpeXpevt 09YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7H5SaYzv2eC4qn7QVIEB3Nk4jIz7zk3QKC77y/SmGCc=; b=bCQJkYIM2N+kPeIhv7yWyxylZrqH8NjRLtcM4G3HiJmoUVNDit8gkusmjoK6M3E3O6 rAoCJcqp4ri90+jPwydAyuDQXvpF4aDtLgERpPIrmJQNBN29Gu4G/1pc4Mf7EtlcolBI 7oquucBD+UudCY7nEQ7qcKidKkhDvVAXBEl6GZutWIGehmHXCjoAZ7ozdzKwRkBo8DDn i34/l8g1XtMqNYJiqjfFu6DwgNWU1Ham+vTACA7wo1Zeu5Qsvw4ZGxCW2hqLXgsTET/f QECzo61nCmx6prZC5MEB8g5P3s2GZU+ZlExQI3lp3Tpd3wAtHY7BlR/oDtH0OGEhJ4/4 25+Q== X-Gm-Message-State: AJIora9nZwgea9y1/Q8wTAxdiGSscTkxJt4cQ5KkldpM82FGVDRCccsM 0VmXRnF72Q2zoj1OGy1VVtZaMWvJjx4RbGkYb+4= X-Received: by 2002:a9d:4c85:0:b0:616:baf1:4307 with SMTP id m5-20020a9d4c85000000b00616baf14307mr1729295otf.381.1656176732601; Sat, 25 Jun 2022 10:05:32 -0700 (PDT) MIME-Version: 1.0 References: <20220606160943.663180-1-xiehuan09@gmail.com> <20220606160943.663180-4-xiehuan09@gmail.com> <20220626010331.f2be529cfb52706d58bbdc2f@kernel.org> In-Reply-To: <20220626010331.f2be529cfb52706d58bbdc2f@kernel.org> From: Jeff Xie Date: Sun, 26 Jun 2022 01:05:20 +0800 Message-ID: Subject: Re: [PATCH v12 3/4] trace/objtrace: Add testcases for objtrace To: Masami Hiramatsu Cc: Steven Rostedt , mingo@redhat.com, Tom Zanussi , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Hi Masami, On Sun, Jun 26, 2022 at 12:03 AM Masami Hiramatsu wrote: > > Hi, > > This looks good to me (and I tested). > > Tested-by: Masami Hiramatsu (Google) > Acked-by: Masami Hiramatsu (Google) > > BTW, please use 'selftests/ftrace:' tag instead of (or in addition to) > 'trace/objtrace:' for the ftracetest patch. And please Cc to > linux-kselftest@vger.kernel.org and Shuah Khan. Thanks for the reminder, I will do it like this in my next version. > Thank you, > > On Tue, 7 Jun 2022 00:09:42 +0800 > Jeff Xie wrote: > > > Add a series of testcases to illustrate correct and incorrect usage of > > objtrace trigger. > > > > Signed-off-by: Jeff Xie > > --- > > .../ftrace/test.d/trigger/trigger-objtrace.tc | 41 +++++++++++++++++++ > > 1 file changed, 41 insertions(+) > > create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/trigger-objtrace.tc > > > > diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-objtrace.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-objtrace.tc > > new file mode 100644 > > index 000000000000..d894442b6a30 > > --- /dev/null > > +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-objtrace.tc > > @@ -0,0 +1,41 @@ > > +#!/bin/sh > > +# SPDX-License-Identifier: GPL-2.0 > > +# description: event trigger - test objtrace-trigger > > +# requires: kprobe_events "objtrace":README > > + > > +fail() { #msg > > + echo $1 > > + exit_fail > > +} > > + > > +echo 'p bio_add_page arg1=$arg1 arg2=$arg2' > kprobe_events > > + > > +FEATURE=`grep objtrace events/kprobes/p_bio_add_page_0/trigger` > > +if [ -z "$FEATURE" ]; then > > + echo "objtrace trigger is not supported" > > + exit_unsupported > > +fi > > + > > +echo "Test objtrace trigger" > > +echo 'objtrace:add:arg1,0x28:u32:1 if comm == "cat"' > \ > > + events/kprobes/p_bio_add_page_0/trigger > > +if [ -z $? ]; then > > + fail "objtrace trigger syntax error" > > +fi > > + > > +echo "Test objtrace semantic errors" > > + > > +# Being lack of objtrace command > > +! echo 'objtrace:arg1,0x28:u32:1' > events/kprobes/p_bio_add_page_0/trigger > > +# Bad parameter name > > +! echo 'objtrace:add:argx:u32:1' > events/kprobes/p_bio_add_page_0/trigger > > +# The parameter existed on event > > +! echo 'objtrace:add:arg2:u32:1' > events/kprobes/p_bio_add_page_0/trigger > > + > > +echo "reset objtrace trigger" > > + > > +echo '!objtrace:add:arg1,0x28:u32' > \ > > + events/kprobes/p_bio_add_page_0/trigger > > +echo '-:p_bio_add_page_0' >> ./kprobe_events > > + > > +exit 0 > > -- > > 2.25.1 > > > > > -- > Masami Hiramatsu (Google) Thanks, JeffXie