Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3568137ybz; Mon, 4 May 2020 05:38:50 -0700 (PDT) X-Google-Smtp-Source: APiQypJzF7pEmEwk3fa61HHefIGHQV9V+YU4RxAv482/49Guv5KgMcv/rswP2X8CKmSjCBeWGzC4 X-Received: by 2002:a05:6402:1496:: with SMTP id e22mr14507760edv.301.1588595930501; Mon, 04 May 2020 05:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588595930; cv=none; d=google.com; s=arc-20160816; b=atzHPFuUcOUu9bR/N8jmdza0zk4FK1d4bPjA3az+zEtZiXnPy7iyYEAAlPCl1RPHrB kVIrkzp8iiOE2Y8OtZ8HbftrVraypmyVkVXt/2CZnmnRwj4YBDLq5ZDN3Sdm66+m/Ldg UI+YnDy/M8Uc0RWhospg/jD4x/LupFEJgwfgvOms5JpLY89PCwFID/Nj6y7/IavXrosM Om8t+KxRhRkbKby2WpGTUkP0bozTcfuXhMrguMZDXJ/rTyruHov0YmAwy+JKcgtKaBNk d+5Ej+PtzBcoCWYJktLv1imhy309viL/ZxCMNrx2PB0AbodX6kVGIkRpkB00IwPeauiJ VD/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=B6wxkvYlDwcvNl28OAXd66foLiyX2Rf6xw2AGAy8rbg=; b=aTU0siWdTBlWUG3mtMmAtHC7ZZXUue5aeMuzfwrBz+qgR6FAB6iKS6skrSXjK+LbID gC+kl8+x6Llzu/iKfyQSJ/qFkAtw3mSdc/+EXS6wgnNEqfBglj6qzYosGL5zWnHvOBrE 6o5XHDanwEflJnF7CKI5EOx3Z/EqfVE/ACuf8wlFDRyAW1c5LRvtJ7WLxn3wkKbG5Emo nv6RCYRXPFq+nDwcVuoiWP3KOuxYpXEvlCT7nXtLDWgGmNt9ZkIlZpODPPALSpu6g2q1 qqlxcTilXwzAY046YCAg94QrmV5RV1P4SiV/WlSRWutCY4DhXkRe3wHtKVcJkbCnTs34 9CYQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si6686527edv.573.2020.05.04.05.38.27; Mon, 04 May 2020 05:38:50 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728306AbgEDIqK (ORCPT + 99 others); Mon, 4 May 2020 04:46:10 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:57627 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726351AbgEDIqK (ORCPT ); Mon, 4 May 2020 04:46:10 -0400 Received: from mail-lf1-f72.google.com ([209.85.167.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jVWj7-0002zr-Ni for linux-kernel@vger.kernel.org; Mon, 04 May 2020 08:46:06 +0000 Received: by mail-lf1-f72.google.com with SMTP id 85so5391706lfa.7 for ; Mon, 04 May 2020 01:45:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B6wxkvYlDwcvNl28OAXd66foLiyX2Rf6xw2AGAy8rbg=; b=PmRqfIsy6mk4Nh+quO89ohbI77kVKz3tEiSXyQJpVj6VhBmuolOtESOWx5VoOTlrW6 1p7eGngG4XveHaVtm2KcphlCAKFMuWO2MyUv1pUchXgQkUJBSPNu0o6FSoCw/8ooicj2 /4RIXpOVkdNVUS/DkEYX1K+TmaFOmgxixQihxjxims2+/t9iSv3I3h6SLtsSuYxK0K/V xZGD54XrOr9+rOnwi71ZARSLHrkEFr7hUJJcI+x7t7EkqFqzRKopAwKJreyr4RXIjDnb LU6aYtU00XfkyO2qNXm+CkTYQtzC7KQUpPLButDOycKly3OU9oEg29Cgj5DZcwaYgiBz QPWA== X-Gm-Message-State: AGi0PuYSDeL5N1/Ay69Jn+80t69OgsaeHo3or7gks4sdgVC827so0ZFd HFhPsTEMBoEsql33iAHu+gv/Gv2IMsYRMUeKCNECqjJ5xBDkrkTguXxvo0GQQYBYnu3iM8zu/gl jxPo+c9JQhAq7f5GfUi+f2FsXwS4MFtPfuwPMUkH+mme9oFPJW1YWLE4/ X-Received: by 2002:ac2:43c6:: with SMTP id u6mr11091157lfl.170.1588581925048; Mon, 04 May 2020 01:45:25 -0700 (PDT) X-Received: by 2002:ac2:43c6:: with SMTP id u6mr11091134lfl.170.1588581924658; Mon, 04 May 2020 01:45:24 -0700 (PDT) MIME-Version: 1.0 References: <20200429095044.24625-1-po-hsu.lin@canonical.com> <20200501105933.8ebf317da9be19884c7cd33e@kernel.org> In-Reply-To: <20200501105933.8ebf317da9be19884c7cd33e@kernel.org> From: Po-Hsu Lin Date: Mon, 4 May 2020 16:45:13 +0800 Message-ID: Subject: Re: [PATCH] selftests/ftrace: treat module requirement unmet situation as unsupported To: Masami Hiramatsu Cc: linux-kselftest@vger.kernel.org, "Steven Rostedt (VMware)" , mingo@redhat.com, shuah , Colin King , Xiao Yang , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 1, 2020 at 9:59 AM Masami Hiramatsu wrote: > > Hi, > > On Wed, 29 Apr 2020 17:50:44 +0800 > Po-Hsu Lin wrote: > > > When the required module for the test does not exist, use > > exit_unsupported instead of exit_unresolved to indicate this test is > > not supported. > > Hmm, this doesn't mean "the function is not supported" but > "we can not resolve this because of the environmental issue". > For example, if you forgot to install the modules, but the > function itself is enabled, that can not be tested, but the > system supports that feature. > > > > > By doing this we can make test behaviour in sync with the > > irqsoff_tracer.tc test in preemptirq, which is also treating module > > existence in this way. Moreover, the test won't exit with a non-zero > > return value if the module does not exist. > > It is OK to return zero even if the result is "unresolved", but > I don't want to change the result of each test cases, because > it clarify that you must install modules correctly, instead of > enabling the feature. Hello Masami, With Alan Maguire's recent commit b730d668138c ("ftrace/selftest: make unresolved cases cause failure if --fail-unresolved set") landed on the tree. I think this unresolved return value issue is all good here. It is indeed a good question to brainstorm with about how to distinguish a not enabled / enabled but not working feature. I will fix the irqsoff_tracer.tc test here to make them consistent first. Thank you for your feedback. Po-Hsu > > And OK, I found irqsoff_tracer.tc IS incorrect. It should be fixed to > return UNRESOLVED if there is no test module. > > If you still think UNRESOLVED is unneeded, please propose the patch > which removes all UNRESOLVED related code. That can start another > discussion. > > Thank you, > > > > > > Fixes: 646f01ccdd59 ("ftrace/selftest: Add tests to test register_ftrace_direct()") > > Fixes: 4d23e9b4fd2e ("selftests/ftrace: Add trace_printk sample module test") > > Fixes: 7bc026d6c032 ("selftests/ftrace: Add function filter on module testcase") > > Fixes: af2a0750f374 ("selftests/ftrace: Improve kprobe on module testcase to load/unload module") > > Signed-off-by: Po-Hsu Lin > > --- > > tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc | 2 +- > > tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc | 2 +- > > tools/testing/selftests/ftrace/test.d/event/trace_printk.tc | 2 +- > > tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc | 2 +- > > tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc | 2 +- > > 5 files changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc b/tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc > > index d75a869..3d6189e 100644 > > --- a/tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc > > +++ b/tools/testing/selftests/ftrace/test.d/direct/ftrace-direct.tc > > @@ -5,7 +5,7 @@ > > rmmod ftrace-direct ||: > > if ! modprobe ftrace-direct ; then > > echo "No ftrace-direct sample module - please make CONFIG_SAMPLE_FTRACE_DIRECT=m" > > - exit_unresolved; > > + exit_unsupported; > > fi > > > > echo "Let the module run a little" > > diff --git a/tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc b/tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc > > index 801ecb6..3d0e3ca 100644 > > --- a/tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc > > +++ b/tools/testing/selftests/ftrace/test.d/direct/kprobe-direct.tc > > @@ -5,7 +5,7 @@ > > rmmod ftrace-direct ||: > > if ! modprobe ftrace-direct ; then > > echo "No ftrace-direct sample module - please build with CONFIG_SAMPLE_FTRACE_DIRECT=m" > > - exit_unresolved; > > + exit_unsupported; > > fi > > > > if [ ! -f kprobe_events ]; then > > diff --git a/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc b/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc > > index b02550b..dd8b10d 100644 > > --- a/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc > > +++ b/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc > > @@ -5,7 +5,7 @@ > > rmmod trace-printk ||: > > if ! modprobe trace-printk ; then > > echo "No trace-printk sample module - please make CONFIG_SAMPLE_TRACE_PRINTK=m" > > - exit_unresolved; > > + exit_unsupported; > > fi > > > > echo "Waiting for irq work" > > diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc > > index 1a4b4a4..26dc06a 100644 > > --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc > > +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc > > @@ -13,7 +13,7 @@ echo '*:mod:trace_printk' > set_ftrace_filter > > if ! modprobe trace-printk ; then > > echo "No trace-printk sample module - please make CONFIG_SAMPLE_TRACE_PRINTK= > > m" > > - exit_unresolved; > > + exit_unsupported; > > fi > > > > : "Wildcard should be resolved after loading module" > > diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc > > index d861bd7..4e07c69 100644 > > --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc > > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc > > @@ -8,7 +8,7 @@ rmmod trace-printk ||: > > if ! modprobe trace-printk ; then > > echo "No trace-printk sample module - please make CONFIG_SAMPLE_TRACE_PRINTK= > > m" > > - exit_unresolved; > > + exit_unsupported; > > fi > > > > MOD=trace_printk > > -- > > 2.7.4 > > > > > -- > Masami Hiramatsu