Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4732901rwb; Tue, 6 Sep 2022 11:46:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR5QGU9T+oyZ1/wUea9JCQ/7mDXKfSBJrOaMm+D2CBRzcmzoc+un7zlBGQKcz6m84XGZIA6R X-Received: by 2002:a05:6402:1211:b0:44e:b250:633d with SMTP id c17-20020a056402121100b0044eb250633dmr31662edw.2.1662489998260; Tue, 06 Sep 2022 11:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662489998; cv=none; d=google.com; s=arc-20160816; b=jPWezgPJaPRhYni3M8i/n4UsXjHL3rG+/JdHn7feu0o5aePopFnoz0cS05nYbdyp3C MCr7lxh2lGdeMqMDY3jvRqRF6zvgqxHaSLW9JxBHJoyPkH7rsnJPvLe1/2RuN8Pr17BZ WfrYinJvu8JnphFt91+NJLCMutwb6aLNZW1gymZvx6bHwkdMoerRxBSODNaoEcZR+N6M SI4G8daOyCwiTHayhLp7OFsTy5fiZ0bA/1zbX6WOp45TJruNjNPhparOAYXDrvrJGIH2 YyfZqaz10Y5yK4JA+uCfnVtW69JW8cQn0vJD1lQnUUebmi78qurPFKlUjWLrIyhx8KM3 ezVw== 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=KTMC4sgGs4iMTIRHGtHX14ygc35A9XeknD+0EJXhRfs=; b=rAJnv6HcESqNwhvqmz0oHzW8owvVIOjm2fDfeo+RgcGnmMlCrZBuaQZCJK7PvxyUVc xVdOtamkKH+R3QLBxSr8WsKkTSDbRoFp1T1iu3ifekg6ZkaFBJdCsnh5t0CawQTh0wDw Y/iiYB8BYiRU337C+eXsb1MeHEiFuX2mNv94xTx/ePOi6Mv2KFsSNTrVn8oi/N+jjOKJ AfQTFnvi9IWin9PYiX/aC6pk7VeuMRyAZdmTS1DNEdTWt4L/gEMTpylDCQ/1YDp1QWCe 0/zZhNTgcFoxJYrKxjMgmhRLUYy4NxdS3VT3YyGP1+BCntUDoKfJrw8fIi574eM+2CfV Q9PA== 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 gn4-20020a1709070d0400b0073d8663d88csi10585901ejc.685.2022.09.06.11.46.10; Tue, 06 Sep 2022 11:46:38 -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 S229738AbiIFSbS (ORCPT + 99 others); Tue, 6 Sep 2022 14:31:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiIFSbR (ORCPT ); Tue, 6 Sep 2022 14:31:17 -0400 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEBE232056; Tue, 6 Sep 2022 11:31:16 -0700 (PDT) Received: by mail-ot1-f43.google.com with SMTP id l5-20020a05683004a500b0063707ff8244so8618724otd.12; Tue, 06 Sep 2022 11:31:16 -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=KTMC4sgGs4iMTIRHGtHX14ygc35A9XeknD+0EJXhRfs=; b=tuB3YEpGuU0bj3K2vM2zYY5zKFkkLbBkhtKfkzXAO8IgevDSoE5OF9CdNAB0Szt71A Mv68yu3e/cBo2gkqWQiLg+M2ApFFRvKDjImDOh+zOwqyAvFyJmJ/aXWi5Vv89E/gsS6P x/t08t1kOP26ooHXQfGrpY2U2F0yXz8Poyo36ySe1x0PTip9nHKasEmCwFQ8kgykc8Mr dSaqlBOr42/cJW+xxlxoO2YLbhxf5L/4n4voJ0q0JOh6uubhWh7dU/dLdRYtX0jckHLA wZqSNr20zPGN5X2Fkn+Mu+IiMke1UpWQUG3rFWGSm0ry/ppsbNRNHvGccnffJGPFi8B/ PGjQ== X-Gm-Message-State: ACgBeo12Qg6KBeIiXGSTskVNAkSjDyGOhYgrXM6p/D/fEijPXwy/kc/o ng0kSFNOjux/y4Mxm+FiItuLp7l9DVHkyGbEYR4ZUdO2 X-Received: by 2002:a9d:6f18:0:b0:638:b4aa:a546 with SMTP id n24-20020a9d6f18000000b00638b4aaa546mr21388276otq.124.1662489075965; Tue, 06 Sep 2022 11:31:15 -0700 (PDT) MIME-Version: 1.0 References: <20220903000210.1112014-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Tue, 6 Sep 2022 11:31:04 -0700 Message-ID: Subject: Re: [PATCH] perf test: Skip sigtrap test on old kernels To: Arnaldo Carvalho de Melo Cc: Marco Elver , 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,T_SCC_BODY_TEXT_LINE 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 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? Thanks, Namhyung