Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp358671pxj; Fri, 28 May 2021 05:49:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKLvAF4peM1OnjLzxEbnZAYqFIXTs9PRuR/J8azk490Eh6zUGSJV/YFL4lZp+aBLJZYUWt X-Received: by 2002:a05:6e02:ec3:: with SMTP id i3mr1304442ilk.120.1622206185753; Fri, 28 May 2021 05:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622206185; cv=none; d=google.com; s=arc-20160816; b=ORiJYfVLTrUrYAmomnZ3ufmqLHmmA6CKgAZa4V+UbMVoSkybaX3dORMiA6vpR6lUez z2bbtcTDaCcUS8+UxwJCdj81ykgQkhPBeTX2RRrfEkqjK0OYxRBdsUyca6LeE8Rz+cyl WriGWUkOCNi/HWpNGCdgZad/QqKvkdV53/Yy6sHtcYVmBR6JkhGwZb+7oXoa7oN2vT9/ fgFMJrABGfLD6FxnBP1usd/rPptvkhD9XrnlF9tvhm2DkziNAo58a/0YUJiQpVkrRrfi 9hzZoD/48myndivSn6Pk1sQsFPEPQkSVMJeex2UQjv3vWrHt9O84vXIk7ZdlVB/bE1v2 C1XA== 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=enUFMp+0sI/obD4I99OoGjQ+zCxJLqgjuOx/iUM3fq0=; b=z0GfAWbXHfpKGySkrYQelhhATUfXZCXvG6jVRdrrNyaL6/z6BfZ5QXRQSmjASgniIX mL74AMe1UAG8DuDBppe5tYo0Apwbi1Pvgw3Ox1kjuU3A0sMVnOjvl2YyGKMl1vx3QiZR 2oFciY91LrX2iz2XafF6fcWhss4TAzFgRFjA+OG81uuy+TbcdROhDg4sVtt+waNP1/Oj LqWqogzIKm8RD871/rmyCC3I70EuXF/LpzSl/xzevMl+N3fOu8c1nnc7OtAPh7mRnlCV IlRtlJcYtg098l9EeAD8qeCo37cfydtqxSWnusJUYL/EElQCXy31f2u7GVlFupKaJaTT uWWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CbNeLnUE; 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 r9si2551896ill.162.2021.05.28.05.49.31; Fri, 28 May 2021 05:49:45 -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=CbNeLnUE; 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 S234224AbhE1MuB (ORCPT + 99 others); Fri, 28 May 2021 08:50:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:40202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233711AbhE1Mt5 (ORCPT ); Fri, 28 May 2021 08:49:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D01CE6113D; Fri, 28 May 2021 12:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622206103; bh=yvzFgcOrunxu+8nn/nhsR/4J2pWfHyKsDlqm8ycutCU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CbNeLnUECT5SJyf33QG1iacxDN6B/OLjocELhjbDn9wVlD5HRPP826sJwBR+F+n3M SbALTAm3997VJNbcyiYT03SB2S5SqTzMGLRey3XUONOmRiuMQl81qUkAnoNjwIK1Ba sG5uVmDXbIvrfUHspiQkFxEn055ymJ2wLZlInued4Rt21qwgjI12zG3jIpIzLW42o2 87rJZegWX4KcHp8q43gGmY5E9020NeT0DYTOWRIbvUZ8cu2ivuhL0UWJdQjMf7aNlu gfIrIFh15YgMDDbEVMXmlsth3ZSoEKGZnhdyV4FUH34lRNNjc+D0BLmpTGN4f1a/G7 K4DFq1nmC5EaA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E9C904011C; Fri, 28 May 2021 09:48:19 -0300 (-03) Date: Fri, 28 May 2021 09:48:19 -0300 From: Arnaldo Carvalho de Melo To: "Denys Zagorui -X (dzagorui - GLOBALLOGIC INC at Cisco)" Cc: "jolsa@redhat.com" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "mingo@redhat.com" , "mark.rutland@arm.com" , "alexander.shishkin@linux.intel.com" , "namhyung@kernel.org" Subject: Re: [PATCH v8 2/3] perf tests: avoid storing an absolute path in perf binary Message-ID: References: <20210524111514.65713-1-dzagorui@cisco.com> <20210524111514.65713-2-dzagorui@cisco.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, May 28, 2021 at 11:13:09AM +0000, Denys Zagorui -X (dzagorui - GLOBALLOGIC INC at Cisco) escreveu: > > > I noticed this is failing the test, nothing is being appended. I'll > > investigate later. Can you try to reproduce this? I build perf with: > > Maybe this test should fail. I don't think so :-) > Path is being appended only if perf is invoked from the build > directory (basically if there is python dir near perf binary this path > will be added to sys.path) And that is ok for a developer, but I agree with you, we shouldn't have such hardcoded build directories in a production binary. > I'm not sure if install-bin task installs perf.so to system i mean > before this patch python binary contains an absolute path to its build > directory and if this build dir is deleted this test also will fail. That is what is happening, yes. > Maybe we should use export PYTHONPATH=/python for such test Agreed, can you cook up a patch that does that in the Makefile that runs the 'perf python' in tools/perf/tests/? One other suggestion: When the test fails, say when we run 'perf test python' directly, it could check if PYTHONPATH is set and if not, warn the user, something like: ⬢[acme@toolbox perf]$ perf test python 19: 'import perf' in python : FAILED! (Please set the PYTHONPATH env variable) > Thanks, > Denys > > > alias m='perf stat -e cycles:u,instructions:u make -k CORESIGHT=1 BUILD_BPF_SKEL=1 PYTHON=python3 O=/tmp/build/perf -C tools/perf install-bin && perf test python' > > > > > > ⬢[acme@toolbox perf]$ perf test python > > 19: 'import perf' in python : FAILED! > > ⬢[acme@toolbox perf]$ perf test -v python > > Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc > > 19: 'import perf' in python : -- - Arnaldo