Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1596643rwb; Fri, 28 Jul 2023 11:46:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlGSoqxIQMZKXgBQAnfwKtDO7dydRqsyR48pZ+IXipkwPJnt8fWgOMoSjosYktzJyPhtJSGV X-Received: by 2002:a05:6512:6c9:b0:4fb:bef0:948e with SMTP id u9-20020a05651206c900b004fbbef0948emr2318147lff.5.1690570000872; Fri, 28 Jul 2023 11:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690570000; cv=none; d=google.com; s=arc-20160816; b=rNUdtc3DoqknT4eKAJP+JV6lZjJ94yX6SbI8L9nX83xUBs10U2uAdXA81iFTq93/V2 uCvy1pSZI80fN7DQH9x7/6jCqvN2HWJTya+fSEIaILUWYFV2VU4coVW4vmNY7G3M5scU F4kNvVYxip3w+PyqRotkT20mRhbuMXKMxfuew9bMtBrpfgxt4QD0vkUYV2uV4fiNhS6u a0ovArp/JXszGNqjwKuJmM3cFxNhhX5BGUfg7iFSB7KstQrOyCNmWHP1s5fyGMu1Oj6h QuPJQtmwphcy3azBT++DHQiREl5QxVZwMVCF9ru1ORA49E7Gxt0q/l8MbawfFXYHHQ3e ECpg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aAQm/ThYN/+Z4kpc3N3XRZ5fH9NY9WWkeRhlrw4oC0U=; fh=peobY6CVL2+OtQCu/WGAsEtN3LoDSxB0Fhu8uRzm2JI=; b=U8isghgBtpMp+6ubI6sNrLELqTvGJaq6s0jWQ2jl0+dmXGgirJDv2O3SU9Y8+ru2Ii Dima9AWnlqbUIZqG9GJceIBANdhRd6iRnStyFxoPmW0guIapXyiWfRRUCYrg7KiQD2/5 Jumem6OLuH1PF79RuabSmLeTBgDONlipuRzYXjoER4nxbe9zVCXwDDNx1Ffj12DO295P LD8ZqhgMP7KlRG8wVe7wq8lSu4FeO0Kr95xpKBUGPhgPFxYVUlmQleqJ7tdXaGfVwvTw 9Jdua/Cf0FTvZVqBcs6bDgJ634IdrAjg8LTY+jAGMStuQFME4HRWw7JLlOfiMqF8zlXE DRlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N3o+ZD1H; 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 i5-20020aa7c705000000b005223adde41esi2885470edq.92.2023.07.28.11.46.15; Fri, 28 Jul 2023 11:46:40 -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=N3o+ZD1H; 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 S231233AbjG1SbK (ORCPT + 99 others); Fri, 28 Jul 2023 14:31:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjG1SbJ (ORCPT ); Fri, 28 Jul 2023 14:31:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D6034499; Fri, 28 Jul 2023 11:30:46 -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 AA10A621D7; Fri, 28 Jul 2023 18:30:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7718C433C8; Fri, 28 Jul 2023 18:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690569005; bh=uInCDj+mYhyh3EGnNpi/lvXN0Ha9NnDbrne3h8BtL2Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N3o+ZD1Hp89pRzstgK7t37+qptTti4MPp3Y0uEWOAUTQXhTp+IMHBduyVeoYr3yI5 X1GqBd5lyf58CrOqhLveam5CfhkAh777luRJNUugRX0ZijXLWDvcYHrSHVe0a0eBLW /0o0MYskZPQ6CWf80g0OlS6xMG72Ftave4s7c388KW9l56qekafaqtQvZ3Yj8JB7dR pron/RgVWBR0rEs9Yg0Lrc+zUqivLjJOriMN9J3RlLfgxxkrTy01FCkKcN7Ujf8yqn ngZ1bz9FoeUBSEbjV7tj/+zSmofi/wyCh7Jb9+7UIU6WHNAY713TLOiUKAXbUkyLnT YkB6SF+IS9Tcg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 2237E40096; Fri, 28 Jul 2023 15:30:02 -0300 (-03) Date: Fri, 28 Jul 2023 15:30:02 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Aditya Gupta , jolsa@kernel.org, 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Fri, Jul 28, 2023 at 09:01:11AM -0700, Ian Rogers escreveu: > On Fri, Jul 28, 2023 at 7:54 AM Arnaldo Carvalho de Melo > wrote: > > > > 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 > > That's a nice idea. You mean add a script like perf-archive.sh? Nope, I would just add a new builtin-build.c (or some other more suitable name to query what was built into perf) and then it would just do a simple search on the same array that 'perf version --build-options' currently uses (or the array that it would then share with 'perf build', I haven't looked at the source code.). So instead of a series of fork + execs we would just have one. - Arnaldo > Perhaps this flag should be supported by perf version instead. > > Thanks, > Ian > > > 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 -- - Arnaldo