Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp334748pxb; Thu, 2 Sep 2021 05:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydSNGziMADdPMjSHT3pRul5i+JSBw/y7oIUb37sr4vLvjfxhNJPdGDdh6SHoDMPVKKNYcR X-Received: by 2002:a92:ce86:: with SMTP id r6mr2158949ilo.170.1630585534815; Thu, 02 Sep 2021 05:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630585534; cv=none; d=google.com; s=arc-20160816; b=avMJjdjkGYMH8DhaQW9Ri7ftoqpbEjjLRdPXt0TcZG8wPnkpJhcHfpI2Ah0KSZqk4X Tk4AymfUGXUQ2fZooZjwBeFQEAqVPPmBZmR8xsiErdmg+4+ogKeH2iBpPCIkLneAlLIj grbuV2bq2spshjVjaxFV0UC72I4PoZUhXevMKLMHKnYM0UkZdHZ4E4Fqlfk8cH8srRHl YYL0y1K3X//l0k+sBuirAUwtm3eMnc3uMupeENkJJjPFAZbKAQNwCWBp2feAFTl4jpp7 qy+ScjXjSpRUEVAcCC2K+fRe1sRaGQ1xAxHOv9L4+3B2OwCzjG/kRA4QQL9FSrt8hh2K eeTQ== 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=sBQ9jpC/lzv+sYyli6U+QN8e5gozGo2d21+FoLNdnu8=; b=Oi4qohUGiSLPMDZw0HndN9pTaL56BHkNk2nXHq3iTIcYu/yMQ4wvVdWF5Xz5yO2HiY yb8kuOZGZJmqrOiiYyGDVmLn0Yk1JoPpsWs+/eIxUbDofvLjgcxzhAvDeYVm4Te+F1Wv 5lr8ujAmBpehYp1sKtqdE1WbYqBwI7aaL5sSKgglQC8cka9nRIyINVOVH9M+zQbmjfvL wtLCzpfiNr3mfB6pGLd9WvNm3RLjizV8xvSCl6irS+GEEWya2UpfROQC3XpB5PWZv1LA D50eCBrEYuIC76ACAeKxsfxBFGhu7EkojpUN9AOJrhmBORVZPAU1deWpH8/78swDe9FO u6uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i+arjeBt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t10si2374005iof.42.2021.09.02.05.25.20; Thu, 02 Sep 2021 05:25:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i+arjeBt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1343952AbhIBMXY (ORCPT + 99 others); Thu, 2 Sep 2021 08:23:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:38588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234098AbhIBMXX (ORCPT ); Thu, 2 Sep 2021 08:23:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9018F6054E; Thu, 2 Sep 2021 12:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630585345; bh=LtO9so53QFcq+GSVqeOS9+q6OqRT7pG2sQXE1iTcrqo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i+arjeBtP60Jc0aWJJ3X8l1UHnzxL6ArOqmFjNAFMJkA2xQHDAyurmji05dmCS0AX ASrFCM88WJSxodnXXqw+ddL39T9QoJigLw9bzaWIRNlB7i2Pirod+wARCRJpLS5P4N AeVxCMM1EKx1ewf9T8Vye/Gmza39Mg3b8VCu10W+jJ0zkG98iK0vIMMEj4REPVhg4O 27wIWarQJD2ZWL9Etr2pnkCBKT1Mz/JjmIcql9GVL7bPRVqKAy9XSbypJEDq7CsOwt brn4AjNL6ruUIx2V8PdrY1ek9izEaa3/YTQnwO3NZ7xWiL0sJqWXfSqtYpHgZjIBwC RizJuqgWYfreg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 5708F4007E; Thu, 2 Sep 2021 09:22:21 -0300 (-03) Date: Thu, 2 Sep 2021 09:22:21 -0300 From: Arnaldo Carvalho de Melo To: Leo Yan Cc: James Clark , mathieu.poirier@linaro.org, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, mike.leach@linaro.org, suzuki.poulose@arm.com, Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] perf build: Report failure for testing feature libopencsd Message-ID: References: <20210902081800.550016-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210902081800.550016-1-leo.yan@linaro.org> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Sep 02, 2021 at 04:18:00PM +0800, Leo Yan escreveu: > When build perf tool with passing option 'CORESIGHT=1' explicitly, if > the feature test fails for library libopencsd, the build doesn't > complain the feature failure and continue to build the tool with > disabling the CoreSight feature insteadly. > > This patch changes the building behaviour, when build perf tool with the > option 'CORESIGHT=1' and detect the failure for testing feature > libopencsd, the build process will be aborted and it shows the complaint > info. Thanks, added some committer notes to show that it now works: commit 8fb36b1f54873870262810d3db10526559e1d6c2 Author: Leo Yan Date: Thu Sep 2 16:18:00 2021 +0800 perf build: Report failure for testing feature libopencsd When build perf tool with passing option 'CORESIGHT=1' explicitly, if the feature test fails for library libopencsd, the build doesn't complain the feature failure and continue to build the tool with disabling the CoreSight feature insteadly. This patch changes the building behaviour, when build perf tool with the option 'CORESIGHT=1' and detect the failure for testing feature libopencsd, the build process will be aborted and it shows the complaint info. Committer testing: First make sure there is no opencsd library installed: $ rpm -qa | grep -i csd $ sudo rm -rf `find /usr/local -name "*csd*"` $ find /usr/local -name "*csd*" $ Then cleanup the perf build output directory: $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; $ And try to build explicitely asking for coresight: $ make O=/tmp/build/perf CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin make: Entering directory '/var/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j24' parallel build HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep Makefile.config:493: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1. Stop. make[1]: *** [Makefile.perf:238: sub-make] Error 2 make: *** [Makefile:113: install-bin] Error 2 make: Leaving directory '/var/home/acme/git/perf/tools/perf' $ Now install the opencsd library present in Fedora 34: $ sudo dnf install opencsd-devel Installed: opencsd-1.0.0-1.fc34.x86_64 opencsd-devel-1.0.0-1.fc34.x86_64 Complete! $ Try again building with coresight: $ make O=/tmp/build/perf CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin make: Entering directory '/var/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j24' parallel build Makefile.config:493: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1. Stop. make[1]: *** [Makefile.perf:238: sub-make] Error 2 make: *** [Makefile:113: install-bin] Error 2 make: Leaving directory '/var/home/acme/git/perf/tools/perf' $ Since Fedora 34 is pretty recent, one assumes we need to get it from its upstream git repository, use rpm to find where that is: $ rpm -q --qf "%{URL}\n" opencsd https://github.com/Linaro/OpenCSD $ Go there, clone the repo, build it and install into /usr/local, then try again: $ cd ~acme/git/perf $ make O=/tmp/build/perf VF=1 CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin | grep -i opencsd ... libopencsd: [ on ] PERF_VERSION = 5.14.g454719f67a3d $ export LD_LIBRARY_PATH=/usr/local/lib $ ldd ~/bin/perf | grep opencsd libopencsd_c_api.so.1 => /usr/local/lib/libopencsd_c_api.so.1 (0x00007f28f78a4000) libopencsd.so.1 => /usr/local/lib/libopencsd.so.1 (0x00007f28f6a2e000) $ Now it works. Requested-by: Arnaldo Carvalho de Melo Signed-off-by: Leo Yan Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: http://lore.kernel.org/lkml/20210902081800.550016-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index b051c0c312c5243a..b66cf128cbc76d07 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -489,6 +489,8 @@ ifdef CORESIGHT CFLAGS += -DCS_RAW_PACKED endif endif + else + dummy := $(error Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1) endif endif