Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp11097rbb; Fri, 23 Feb 2024 10:03:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW3HeyWqntDO3Xuy0JbLO9FSSjx9k2qYMmh5BzpGGiP2DzqP6NmrMX22Aqq8D895YbXjc9eAjZEbHG7Ue2MpA0R0kZf9YrcnS26kVw0jA== X-Google-Smtp-Source: AGHT+IECZC0NMoeVO1HRWdosLGtAQI7Fgwo6XMs14JAzrmKZuzudkjxEQcdVMfbpUj/TdR6217wP X-Received: by 2002:a05:6a00:1813:b0:6e2:f52b:6c8e with SMTP id y19-20020a056a00181300b006e2f52b6c8emr664765pfa.14.1708711434263; Fri, 23 Feb 2024 10:03:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708711434; cv=pass; d=google.com; s=arc-20160816; b=TO5T84QiMWktp4r3Utz7JEznwnOZYX7XJl5W0XpQ+hNxY7xCvYhwzao8uGt1SKo8Mu lNeqTOiHfzKX7fuRKJHbdkPD27ABhctbcQ50BOfoHchIKwqWlPobRS9uqUTKxQnAaGle 3DbnphLbIP7oFQ8e3ehiTUh3jBLkVTpXAafNyw5v3qaCBk+9cqeFd+HdMlaruAR65hJL /8Df6RxvEg5jqkd4mvYzI57M7YFOkygyuG0fH2dID6rbFdOaiOB2s8hp74TmudLmlcq1 ncJie6AjWUCEnsFpz4rgSyvhwncpPLzJQBifos2DVgaqdPIkXz/VV6pNEcWW5jwdHDii Kdag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pUdU4XbW+oII5UNfgs+cvUvTnCipdPOJAMY6xPtkAa8=; fh=d2nItRZ+ox+BaRku405fPXXE2I27oDoWyYvuhcaf6B8=; b=iQwQjsXtTNuZtj6TmcD9GQccHpHRtvTOclf9Jtjk7MMX/fWYMwZZbJOrlEBX239d08 BEF/W1Vh+mWCEee7sdjjJt+AiA0AQ2r/L3ugAW04SMv71KhX079izTaJ+OFU/PMjf4b7 WFgNI8OgjXQYDMfIW5HNErDeMFwRwJhh83jGrkpvgPhWUUlz9gqF0vxqIqMpUg13N5aC QQonnjb/yXASkb1yPaiOKvQkt6p4xxQJmuXFlYhxTGSzlDeNrEuOdZvCPpNoA9HH3xGs CRl6iYrJ8JW7Ste4Cuh06HQgcphmaz9aoDF8IkzXN3CJZWbOvusWVIQMUUaaEwN2h9Au eX7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S5FYjqyC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-78937-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78937-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jc37-20020a056a006ca500b006e4f1a45aabsi110010pfb.366.2024.02.23.10.03.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 10:03:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78937-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S5FYjqyC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-78937-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78937-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BBDD4B2119B for ; Fri, 23 Feb 2024 17:59:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C11AC1420D8; Fri, 23 Feb 2024 17:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S5FYjqyC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E54C612AAD7; Fri, 23 Feb 2024 17:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708711174; cv=none; b=rDBjKP+W5iQfL91RotT3zu23AGUvKPf9v02+25imnTZCxxXnXnkA2lgNIi8rdBZevddEXxuMP0uU5DPNzVGla+1bfXO4Mju0MJ/vaYZHxF/9qqTOX6k6g/bxuGMQQ3zm0eC8Sm+H+91ZowvxcDO4AH+PFmD8e4HwiME7ZTUV9vc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708711174; c=relaxed/simple; bh=gTzPvov1pysXpbl26Na1x4ZDLy1bbNoAUuYg5g+g3FM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R6+R5bKMfPA0OPP7NwMLDNLpjG1d5tbxu0zSvByXoxpECzO1DzEqE3cNbINrGtqgODA9I/FQLt8OvTXOXqvsEKQiPK8ezDsgeYbjWw5AWWAg+vA7Sy35Xt2/VqQzc7kOu/JPaNQTUawhrXylZF2L++fAVJnqevi+6rOKkzGa/z0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S5FYjqyC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A0D7C433F1; Fri, 23 Feb 2024 17:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708711173; bh=gTzPvov1pysXpbl26Na1x4ZDLy1bbNoAUuYg5g+g3FM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S5FYjqyCTQVqnb/2O35S6LdSKdQ4lCjDyuMfRmmKmXwo32Z8lBPAgLGJulNOiVvLn cKPT5ZXr88aAwmPvkE6ZzgEEB3Hi7cnRFF/azwL3KPcOpvw4VpDZzyo3quRFaYE9oU Jj5SdxpJxfHlbgDqss+f5aP7kkKWGhshHg3/0lnDOTq5vRPuKDmkpGChdFVlAQW7Px QczJPnwsDq9L4MdWG9uhvdEqA1Q8mbWVvZjC5utB1+acfhy8SejCLOIThqZ+FnBRDn fY/cxXpClZCSVjFhre9vstTJMrmA9HgYbOBmpm89YPc0YegmJQt3R4oU4Cjt2UMkwu v1PZkTR2ubOvQ== Date: Fri, 23 Feb 2024 14:59:28 -0300 From: Arnaldo Carvalho de Melo To: Kyle Huey Cc: Ian Rogers , Kyle Huey , Robert O'Callahan , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] perf test: Test FASYNC with watermark wakeups. Message-ID: References: <20240221175210.19936-1-khuey@kylehuey.com> <20240221175210.19936-2-khuey@kylehuey.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Feb 23, 2024 at 09:35:29AM -0800, Kyle Huey wrote: > On Thu, Feb 22, 2024 at 11:54 AM Arnaldo Carvalho de Melo wrote: > > fd = sys_perf_event_open(&attr, 0, -1, -1, perf_event_open_cloexec_flag()); > > if (fd < 0) { > > if (attr_has_sigtrap()) { > > pr_debug("FAILED sys_perf_event_open(): %s\n", > > str_error_r(errno, sbuf, sizeof(sbuf))); > > } else { > > pr_debug("perf_event_attr doesn't have sigtrap\n"); > > ret = TEST_SKIP; > > } > > goto out_restore_sigaction; > I think perhaps I'm barking up the wrong tree here. This seems like a > ton of work just to write a regression test. Maybe I should be doing > this in tools/testing/selftests instead? Well, if it tests a perf feature, then yeah, that would be better placed in 'perf test'. Maybe you can just assume this will run just on modern kernels where this feature is expected to be present and then add some pr_debug() stating that maybe this feature is not present in the kernel. For the vast majority of cases this will be enough, so that is what I encourage you to do now. Its possible that distros, like Red Hat, end up backporting first the perf tools with this test and not the feature it is being tested, if that happens, then it will eventually come to my attention and I will be able to do the BTF treatment, as in that case even a test based on the kernel version would be insufficient. - Arnaldo