Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp223455rwb; Mon, 26 Sep 2022 11:24:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM587Yeh2NANHRP8r1JwUqeNy9R3PSAGOfj7LC5EawhBFvNaOl8OiP51igG2wOFKDCrQAesP X-Received: by 2002:a17:907:7632:b0:76f:f6e7:36cf with SMTP id jy18-20020a170907763200b0076ff6e736cfmr19987098ejc.442.1664216695454; Mon, 26 Sep 2022 11:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664216695; cv=none; d=google.com; s=arc-20160816; b=IULHkgyLa2YS4pn2vDb4ZiFSisGW3Q9gs8AkYmkcPhd6c7Qa5E+kY6jbvIzmoJ4bdw zc/deSPkGgF9z73TfvihpoDQnfhAZfrhQM2DGt9ll/S9IeBA6BBGb90Bhp7265jOoFIy sYAP5HA174YMdqDn611ZYDnN53J5/7omhECwdBG698OU4RrWHdQhkM/51dkq7CFMAzYN /UQJtzsW1D1kF71fjNEmH6IooJjktfVzh+Q0bQ/DMoPfrrgv2OjA6YzoHeVEIr2ffpd7 4GqH1FJ8VfC+I/2MT118zBN5VNkDA3J+bj36jlKUtDYrFzcHyMC1Nngm6pUWrAEjxcyi iJ9A== 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; bh=Kv0hAbAuMDhiwxda9Nahgcb504NbJJsHBppTCWLGHHk=; b=FOgV6zLhp3ZA8WJwT42QHBGEtbU2gsQ9kYP69etI5ZyJrJtzy0l8KS/+wigN6hu4ZY /hI9d3h6t9t0gnKoWkqYqcSl0XGX4gVJvLb8q7GHDt/AKmIyexXv4sA/SnBv9bN+IjmB j3QIZRFybsj8G8t5JgwFbnsaNJ0rjgc2uhoeserTYXctB0Mj/mvL1UryRX8KnZdbY2yd +3h+9+2zSIoryeSNw9vNLqhKxgPdnqZ3i6qdFHAU2qSAkM09f3dchzQ78TwtUAYzc/R/ DkXG9ql2BjlZIkR+dFs9ciTO6ehRVhP315Tk2a/2y0ipPxEniJXIDnYVccmtDpBPI/uJ 2ONw== ARC-Authentication-Results: i=1; mx.google.com; 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 y5-20020a50e605000000b0044e762b8d4bsi15271073edm.480.2022.09.26.11.24.28; Mon, 26 Sep 2022 11:24:55 -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; 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 S229900AbiIZRLj (ORCPT + 99 others); Mon, 26 Sep 2022 13:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229825AbiIZRLL (ORCPT ); Mon, 26 Sep 2022 13:11:11 -0400 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D05CF422FC; Mon, 26 Sep 2022 09:20:09 -0700 (PDT) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-1279948d93dso9862666fac.10; Mon, 26 Sep 2022 09:20:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Kv0hAbAuMDhiwxda9Nahgcb504NbJJsHBppTCWLGHHk=; b=SpoOKxBMaiTuhWXtVbUqEjpWyrv7n+qAaH/V+5IVnZgVAWLgE2IWmZ+ZHBfz6fXxhf WzsbVFUZRbRGwEIEOo7ep+zdDzDLQJ3cHLfI7s9Uqoaxey8wDYcFyz18+YI1kPeghl5i FXE1Gp6uoo2b9C1sqITlN67QObndrIVo47E5TyA6nCDI+wiL9MIr66zKVDVt46Iqx54e FMOAmcOfz2kmk6hgmi3FDbY1A9apNxxL4gwKj4h70Wcyp9tOoj+qPo1IKntxlgueqlst DgW6kBZPO6LifE/pihwrxw/eGmiYX7o0WCoM867m7EkKfpb3KG8WQjO4bFqOUpZ2diWA 2MZA== X-Gm-Message-State: ACrzQf0HaEGcVcylP2MzTVRlYH8se2yrhKUQzz5xgc/NxUgLVuvW+Twp nRGXf2BwdAVj+JYX8J1FzWpA+QOAvu/Olwk2gJY= X-Received: by 2002:a05:6870:524b:b0:12c:cfd2:81c0 with SMTP id o11-20020a056870524b00b0012ccfd281c0mr12345018oai.209.1664209208682; Mon, 26 Sep 2022 09:20:08 -0700 (PDT) MIME-Version: 1.0 References: <20220903000210.1112014-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Mon, 26 Sep 2022 09:19:59 -0700 Message-ID: Subject: Re: [PATCH] perf test: Skip sigtrap test on old kernels To: James Clark Cc: Marco Elver , Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , linux-perf-users Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no 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 Hello, On Mon, Sep 26, 2022 at 8:06 AM James Clark wrote: > > > > On 03/09/2022 07:52, Marco Elver wrote: > > On Sat, 3 Sept 2022 at 02:02, Namhyung Kim wrote: > >> > >> If it runs on an old kernel, perf_event_open would fail because of the > >> new fields sigtrap and sig_data. Just skip the test if it failed. > >> > >> Cc: Marco Elver > >> Signed-off-by: Namhyung Kim > >> --- > >> tools/perf/tests/sigtrap.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c > >> index e32ece90e164..7057566e6ae4 100644 > >> --- a/tools/perf/tests/sigtrap.c > >> +++ b/tools/perf/tests/sigtrap.c > >> @@ -140,6 +140,7 @@ static int test__sigtrap(struct test_suite *test __maybe_unused, int subtest __m > >> fd = sys_perf_event_open(&attr, 0, -1, -1, perf_event_open_cloexec_flag()); > >> if (fd < 0) { > >> pr_debug("FAILED sys_perf_event_open(): %s\n", str_error_r(errno, sbuf, sizeof(sbuf))); > >> + ret = TEST_SKIP; > > > > Wouldn't we be interested if perf_event_open() fails because it could > > actually be a bug? By skipping we'll be more likely to miss the fact > > there's a real problem. > > > > That's my naive thinking at least - what do other perf tests usually > > do in this case? > > I missed this discussion but I just submitted a patch with a similar > issue [1]. To me, it doesn't make sense to have the tests pass on older > kernels if this lowers the value of the tests by accepting possibly > invalid values. If you want to test older kernels then just use older > tests, but maybe there is some use case that I'm not aware of. Thanks for your opinion. But my test environment is running the tests on random machines which may run some old kernel. I agree that it should not skip the real problems but I think we can find a good way to detect old, unsupported kernels reliably like using BTF. Thanks, Namhyung