Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4893027rwb; Tue, 6 Sep 2022 14:41:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR6cVp2Fkli01e3uzLyjCUE7NuYiE4YCyk80PHNqDxUsbIlCJwNxGlVDfqP/DRmOADBZ64K7 X-Received: by 2002:a17:906:ef90:b0:730:9d18:17b3 with SMTP id ze16-20020a170906ef9000b007309d1817b3mr320877ejb.141.1662500508510; Tue, 06 Sep 2022 14:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662500508; cv=none; d=google.com; s=arc-20160816; b=UTdV0YvIOcmCGJFd8ma80h2SBRYvRQkG/GO1104LQmdz/7MyJk4q3p+yo242o+m7EJ i21dYF1iWqOnJ1JILLy42m8yQF4ihRSzxNkWcm157MTyhR5RMl+SvfAsihGMsmcHoeI4 YtwHmB88hXrJS+/QdkUG70E9XkvBrxn96JMNXPfyIpC3+gd7WH8x0jZA+KSuvujZ2I6t kYoGAGXMJChb4KYRIpc4K8r81LZ0dGHCLWXzlcT0GQsctJiHj85S5kh2soYMoEUWyOVQ fd9QNFsH/k40WD2qTqvxsDuEJQs41cNbiubdxrkpl71+LNNTmVYC7++UkJCqxmnoUz5I 3kQA== 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=2h+TR+OM3EYWoBqpTcjOAGgQzsk2TDQnX5OQcnEmOAY=; b=Mifws+BWwIJrbIpIJUhhZiX7xYp67FT8590yQ5kdorEmajNoVRor31syyCTatDhgE0 2kta0TIP+YYBCJsgTaOT0mrbGUMLRU51mGwL5BNfJgc+jdZIwiiOTCoOpMFxbcg/Jor1 KwYGpwZV+KPPMAjG8XH9tHLwvOgbTZMsV8oFMAo7r3sWd3he4zTe3pwTjSSfeQFC4Jbg nmFZfRTx/jMuhUpPGGlTVkbk//jiaZz9b4UR9+0AxC5d/heEcCi2llsCO5WE+cizyJeY tEGBYoju9y3Uo7eMGS91CqlE7NDRyGB2zrQOctZfkPekg02cmBpp0wdISu1a0g+Urcnx uhEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="Ho5zZG/u"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h19-20020a05640250d300b004484015a8b6si11679821edb.510.2022.09.06.14.41.21; Tue, 06 Sep 2022 14:41:48 -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=@google.com header.s=20210112 header.b="Ho5zZG/u"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231192AbiIFUur (ORCPT + 99 others); Tue, 6 Sep 2022 16:50:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbiIFUup (ORCPT ); Tue, 6 Sep 2022 16:50:45 -0400 Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E83D1642B for ; Tue, 6 Sep 2022 13:50:42 -0700 (PDT) Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-3378303138bso108887067b3.9 for ; Tue, 06 Sep 2022 13:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=2h+TR+OM3EYWoBqpTcjOAGgQzsk2TDQnX5OQcnEmOAY=; b=Ho5zZG/uahZESDKa+F0uVzl1DcPMJs3pBR3YTFdsYd4TVgIAnglmMYKw7IsipePhlI f7MIPmCHSDpWgsuQZra63QsDQjqJJnh8BiLDuylcwrCVHBAjbq7YZ/6Yj6rT0CGMxjsP TKGfuGHYqcgRA9iHZhCxEFybEyib41uQeH64arO0bB6zhYjQJAVYRfp1UYq4QNLwESMc wCK9YUYbpFIAUePlYovxsNMuvoYbVZp0fdnRP/JD7TInueuN77OD9n3yXUiJ4vIbmeW5 7uJjMlqhUVQgEMCU5sa7tDyC6wSHMUKBQ7Qw9e1J8IME6qq4+frCPoAWPSPVvD/W2PVG U97Q== 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=2h+TR+OM3EYWoBqpTcjOAGgQzsk2TDQnX5OQcnEmOAY=; b=TcRn3VTwzlTD4Y0P3tDWCXxqipHAnQ3TDXPmi93eVK6rPEncPPnDs/HifEcUVkhxEV ln5MBLe42tMIBWEcinJD2d7ILBExKBd4Fb8jjq54I8WkYbHxbj4bu/AcpOlspf42dvW9 MyqdRbyB42PYJb/M/rkkaoHVuPMbJwLIohJX/wlpL/DQit1at1SC2DgVIrtGvdWgDRTY iRRaJh9PwKmAio2yydom23QPwKujrfLxnQn7qOf9cKJbN+DUELZDH60SXtLEw7Xi5xBp C5htFjuQy+RWCKkRL1SXJFh/Wgiqc6IRULlioWWXPAgrUWaPMmCKIhG99vUNxPhX4ZT1 57Rg== X-Gm-Message-State: ACgBeo1er28ZuITuoOPNqr0z93Gu1/ifmOXmb5lfjEUQ3/6fX5xNergU 8+Heh6IiwacuXMgOJETSrRglPs3Ok3+lzUdfKAAUiw== X-Received: by 2002:a81:9c2:0:b0:345:4830:1943 with SMTP id 185-20020a8109c2000000b0034548301943mr446551ywj.86.1662497442006; Tue, 06 Sep 2022 13:50:42 -0700 (PDT) MIME-Version: 1.0 References: <20220903000210.1112014-1-namhyung@kernel.org> In-Reply-To: From: Marco Elver Date: Tue, 6 Sep 2022 22:50:05 +0200 Message-ID: Subject: Re: [PATCH] perf test: Skip sigtrap test on old kernels To: Namhyung Kim Cc: 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=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Tue, 6 Sept 2022 at 20:31, Namhyung Kim wrote: > > On Tue, Sep 6, 2022 at 5:45 AM Arnaldo Carvalho de Melo wrote: > > > > Em Sat, Sep 03, 2022 at 08:52:01AM +0200, Marco Elver escreveu: > > > 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? > > > > Yeah, I was going to try and check if this is the only way that, with > > the given arguments, perf_event_open would fail, but its better to at > > least check errno against -EINVAL or something? > > EINVAL would be too generic and the kernel returns it in many places. > I really wish we could have a better error reporting mechanism. > > Maybe we could retry perf_event_open with sigtrap and sig_data cleared. > If it succeeded, then we can skip the test. If it still failed, then report > the error. But it still couldn't find a bug in the sigtrap code. > What do you think? Yes, that's what I meant, that it could point out an issue with sigtrap perf_event_open(). If there's no clear way to determine if it's just not supported or a bug, it'd be better to leave it as-is. Some other options: 1. Provide a way to disable certain tests, if it's known they will fail for otherwise benign reasons i.e. no support. 2. Provide a command line option to skip instead of fail tests where perf_event_open() returns some particular errnos. The default will be fail, but you can then choose to trust that failure of perf_event_open() means no support, and pass the option.