Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1342318rwb; Fri, 28 Jul 2023 08:08:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlGEQ7RQ0clOe8Vtvn/Moqdlvk57rPIldK7CkAxSR0+EQahQ72Zlq5/USNJQo6kxbeSNvwRo X-Received: by 2002:a05:6a20:4289:b0:12b:6898:2986 with SMTP id o9-20020a056a20428900b0012b68982986mr2932964pzj.1.1690556890989; Fri, 28 Jul 2023 08:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690556890; cv=none; d=google.com; s=arc-20160816; b=wEz55Squ8/QYJaPgc9htLRHolndNUHfo/IObhuzGiOdg8Efo+DEP1YhjY5HHrkOZ26 CD80FkEu071iFCvK3rYaMELNJRwJtb33PRmzSIuviOSfn/ss2+cSFgeoV8pnP6XlIvIF OQuYbp1jK5yickki7lp8Wk+Nzjn9Hf/Dc/o8DL79jKkLNvQevKeFsqgllK8TdEApxyZv 1OrdDoCFrXvpffrqmCaV3RX1fOUlTzmUAYSEsc5Bz18N0spAaI6QiNs6KAoR5MYXbk8w xbty73WkwrSBIN+SeJ2LMf+CoIfue+Gx9uW5DM1nACHGLqLYakHS94R3uE3ixZ8npw8U QZxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X060RThujeToWMJ9QWr7t4iMM9X6+YlmjUV1rsXeTbM=; fh=0RfLIIWWTYbX0XmzI+ddHmpyL3wj85tdO17cmG2Ac6E=; b=PILI4yoxVRV47PriEZqVMuiyHXLJq5TACBasQKmyIeC3DEqYymSU/RYzsR34NdrLxy yj9MjJGGAz5GI4tMvfL5AIvb+MSHu4QtoIhO80Hs3l3FfFS9+iEZopCwUuSofAz4v4fM dce0gl9aXzjS/Xb98H6VfHE6xE1+ClJl0zxDu4/MskeZOhPP+NcFya7gE4NH8oHVc8eD cxsdK9U8/fw8JA9bWk+6pdBVHnt2mumJ+c6y1ApDsqchkwwcNH3QHc34XYEsolmeBqd7 CiINbo7cMRhn5eLMyMHIaLO6OZMi8cb7JVk2aOnJWON6DbKlJxw0toWgZ2g+g65pDFN1 XHtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qAbPllgi; 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 a7-20020a636607000000b0053f32b910c1si1679841pgc.700.2023.07.28.08.07.57; Fri, 28 Jul 2023 08:08:10 -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=@kernel.org header.s=k20201202 header.b=qAbPllgi; 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 S237275AbjG1OyR (ORCPT + 99 others); Fri, 28 Jul 2023 10:54:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjG1OyQ (ORCPT ); Fri, 28 Jul 2023 10:54:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9334F12D; Fri, 28 Jul 2023 07:54:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 303056217F; Fri, 28 Jul 2023 14:54:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C5C3C433C7; Fri, 28 Jul 2023 14:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690556054; bh=R9op8pPpmsKkCoqmTa7kyILBaKx3qjkB+WKspxSkx40=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qAbPllgiag0JHhACI1BZnqart2OdDDXqYcHTpHOQj3SCt1iDM8OLCW0nwB1ETdBkY mW4lutGWRjORuLx3M+L1to6wA7cZb3hFtA8P3imJIxuxoiYWD1EKhT9aKv43fuSIPK o9EHbV6ZlTb5PfxS9hKxjTB5Tzqy9t7zMjtSix6d0bypSRygrmgCb1pGt3eCvpIrDV 4mSJqVgH8fsBaSrjPG6aqCpFdZOLzyoEOjF2zu7I0Wa76+MEzXXRwfesGoRfvDcbUt DprSrK41ByXxrMZIP8f4v9PEshuQMvVePtiXGcjhsOxTZNPwiBfUjh9N8pS5ibdM78 B8Dx0laG5GL4Q== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id BBCF640096; Fri, 28 Jul 2023 11:54:11 -0300 (-03) Date: Fri, 28 Jul 2023 11:54:11 -0300 From: Arnaldo Carvalho de Melo To: Aditya Gupta Cc: jolsa@kernel.org, irogers@google.com, namhyung@kernel.org, linux-perf-users@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, maddy@linux.ibm.com, atrajeev@linux.vnet.ibm.com, kjain@linux.ibm.com, disgoel@linux.vnet.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] perf tests task_analyzer: Check perf build options for libtraceevent support Message-ID: References: <20230725061649.34937-1-adityag@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230725061649.34937-1-adityag@linux.ibm.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Em Tue, Jul 25, 2023 at 11:46:49AM +0530, Aditya Gupta escreveu: > Currently we depend on output of 'perf record -e "sched:sched_switch"', to > check whether perf was built with libtraceevent support. > > Instead, a more straightforward approach can be to check the build options, > using 'perf version --build-options', to check for libtraceevent support. > > When perf is compiled WITHOUT libtraceevent ('make NO_LIBTRACEEVENT=1'), > 'perf version --build-options' outputs (output trimmed): > > ... > libtraceevent: [ OFF ] # HAVE_LIBTRACEEVENT > ... > > While, when perf is compiled WITH libtraceevent, > > 'perf version --build-options' outputs: > > ... > libtraceevent: [ on ] # HAVE_LIBTRACEEVENT > ... > > Suggested-by: Ian Rogers > Signed-off-by: Aditya Gupta > --- > > tools/perf/tests/shell/test_task_analyzer.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/tests/shell/test_task_analyzer.sh b/tools/perf/tests/shell/test_task_analyzer.sh > index 0095abbe20ca..a28d784987b4 100755 > --- a/tools/perf/tests/shell/test_task_analyzer.sh > +++ b/tools/perf/tests/shell/test_task_analyzer.sh > @@ -52,7 +52,7 @@ find_str_or_fail() { > > # check if perf is compiled with libtraceevent support > skip_no_probe_record_support() { > - perf record -e "sched:sched_switch" -a -- sleep 1 2>&1 | grep "libtraceevent is necessary for tracepoint support" && return 2 > + perf version --build-options | grep HAVE_LIBTRACEEVENT | grep -q OFF && return 2 > return 0 I'll apply this, but please consider adding a: perf build --has libtraceevent subcommand to have that query made more compact and to avoid the two extra grep. BTW, I'll change that to: [acme@quaco perf-tools-next]$ perf version --build-options | grep " on .* HAVE_LIBTRACEEVENT" libtraceevent: [ on ] # HAVE_LIBTRACEEVENT [acme@quaco perf-tools-next]$ replacing "on" with OFF, so that we have just one grep. Thanks, - Arnaldo > } > > -- > 2.41.0 > -- - Arnaldo