Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8157795ybi; Thu, 6 Jun 2019 07:38:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxnMhEZxrz17sxdnHRh/z7bRZcB9PhJBBPbPWLo8yDYdmSh6UUaYuS6ncoJdjh0183f8M0 X-Received: by 2002:a17:90a:aa0d:: with SMTP id k13mr191004pjq.53.1559831902991; Thu, 06 Jun 2019 07:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559831902; cv=none; d=google.com; s=arc-20160816; b=ygDLv1B2EfBTk9n0vJk67BsptN54pdxUgKoGCH20RS0Tfj+YcErAAbvVFywjQSfoU3 zs0wGu6cMxbkdGTti4Tv8CGGXfcW+TsQ7syRhCAASeBblKdvSKMf0Q0Njs65xlrb+D+V 8lLmnJPDyi69jEmLdwgg1uCZitVaKRsm90n5WYO1F7gqnYXkwhR4jZ4rkzJbzuI+wxqd 2QeKaWER2g9Z+jCIsFHf5syMaUthGSDD+2w4nd1Y7DCq5FSsoSMLOFw9LYWRBzQj+ScM WRgkcOiC8RHHPXI40iTmsIpAV0edQZtXjlp/Qq0UPWNd+k81w72VAuvORHWj+c8/nUPH eCJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HgJ0GZY//Len7veYiP6CvMdfuN08GbgxjLHnvQVRuds=; b=GX6x7/qBTP1Oo4zvkEEc/HFRQDyrlMYE2JIb3deSYwZPQrBj/C5LV5ugObxPrYEA1y 9BpzJuxLXXamDg/U4VnJe87t/BzMTSrYTOmB5FmL7A7Cz484J9s9R9ZpNjHeOWvCfJLm oLLvV7qA/y3/S0hi7Eb7o7gJ2r6UwPqfGkUHsp0sjCweqyT15Eh3gTLe5nP8ydZKNCRp ded5BnGn6C3xIqYrBCKczIyO9nLZ572l8HyB0ng86Q7NePfZOnlyl/K0tKxbbyzlnv5N ln8bUG/MA0cbqJxCAB+xP4nKl4J/3UV7tLn4+MKaiKj5acPyUxGdr6Dbw5BfzBI+Y8JB Bqeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ej65huN6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k33si1994997pld.359.2019.06.06.07.38.05; Thu, 06 Jun 2019 07:38:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ej65huN6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728945AbfFFOfp (ORCPT + 99 others); Thu, 6 Jun 2019 10:35:45 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:37483 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728768AbfFFOfp (ORCPT ); Thu, 6 Jun 2019 10:35:45 -0400 Received: by mail-yb1-f196.google.com with SMTP id l66so1012559ybf.4 for ; Thu, 06 Jun 2019 07:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HgJ0GZY//Len7veYiP6CvMdfuN08GbgxjLHnvQVRuds=; b=Ej65huN6br/BvsJL6NdryRgqMaigzdNrEh0yptxU6ktxfkOVfnGB8JhlcnDFegwM39 1+xf+2IbGCkZB2jitqE7MsxKe30xIxv6oUIFZb6dZojIaggD1y9e4wkzFf6KEnZXQAqs Dka83U7UotuhVF2sxPWPJXwFEBL/RGPvmp+iW3hO/pbvvqr2hWVkwHI4hCcz1H+v8zVs OwjZQY6FfB4+yJ4wASjdtBBchHyOGI2lsAZ1758+/CfmAKb7zdYttFR66+IXUdJkua8n 8l5PehvXi2ROk4xfrf1yIV+PuPc2tzcfIIjxZyYe149/ZfI5TuYzV25HnKl5aAl6A0yT kF2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HgJ0GZY//Len7veYiP6CvMdfuN08GbgxjLHnvQVRuds=; b=aZHDpCJN3bPssPZRZdsiTyKU/tpwIRrz8fWrrt47t3x31zVnsuw/GI7AtbPkeNsCRA nDtqKEtLumlwHO+Cpb6wUTgXVpg0nyi8z1PS6Mht+mHpmh2CVOXDJ09VDKXDfw/jL0fI sCFhzfmighORdfOAY0TSARYRvsSEvfgU21qycU4jOJLAP3M3vS8nYV9ToUkj/YWYLevb zP2x09WZppRWDIDDGG9l6/zdj8UL5qh4/ZPeesKQ+HuGL34BvL7NpxAfUe3lcCILQBjs UBY3MEBHlzzeghhywUU15g/iUwg6t34+I+x54IxUqVvN/2pisxbZ021v/xUUE38UsnLC eQqQ== X-Gm-Message-State: APjAAAWcf51Rtu1fTpQbxm/w8dXS9SPJsz6Y3uz8C7hkYrvHvLPmC78B PK1S4r9CQujRY9o6iNsqqNCrEg== X-Received: by 2002:a5b:a90:: with SMTP id h16mr21558068ybq.341.1559831744170; Thu, 06 Jun 2019 07:35:44 -0700 (PDT) Received: from leoy-ThinkPad-X240s (li1322-146.members.linode.com. [45.79.223.146]) by smtp.gmail.com with ESMTPSA id v70sm515376ywc.78.2019.06.06.07.35.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jun 2019 07:35:43 -0700 (PDT) Date: Thu, 6 Jun 2019 22:35:32 +0800 From: Leo Yan To: Arnaldo Carvalho de Melo Cc: Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Adrian Hunter , Mathieu Poirier , Mike Leach , Suzuki K Poulose , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH v2 4/4] perf augmented_raw_syscalls: Document clang configuration Message-ID: <20190606143532.GD5970@leoy-ThinkPad-X240s> References: <20190606094845.4800-1-leo.yan@linaro.org> <20190606094845.4800-5-leo.yan@linaro.org> <20190606140800.GF30166@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190606140800.GF30166@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 06, 2019 at 11:08:00AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Jun 06, 2019 at 05:48:45PM +0800, Leo Yan escreveu: > > To build this program successfully with clang, there have three > > compiler options need to be specified: > > > > - Header file path: tools/perf/include/bpf; > > - Specify architecture; > > - Define macro __NR_CPUS__. > > So, this shouldn't be needed, all of this is supposed to be done > automagically, have you done a 'make -C tools/perf install'? I missed the up operation. But after git pulled the lastest code base from perf/core branch and used the command 'make -C tools/perf install', I still saw the eBPF build failure. Just now this issue is fixed after I removed the config 'clang-bpf-cmd-template' from ~/.perfconfig; the reason is I followed up the Documentation/perf-config.txt to set the config as below: clang-bpf-cmd-template = "$CLANG_EXEC -D__KERNEL__ $CLANG_OPTIONS \ $KERNEL_INC_OPTIONS -Wno-unused-value \ -Wno-pointer-sign -working-directory \ $WORKING_DIR -c $CLANG_SOURCE -target bpf \ -O2 -o -" In fact, util/llvm-utils.c has updated the default configuration as below: #define CLANG_BPF_CMD_DEFAULT_TEMPLATE \ "$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\ "-DLINUX_VERSION_CODE=$LINUX_VERSION_CODE " \ "$CLANG_OPTIONS $PERF_BPF_INC_OPTIONS $KERNEL_INC_OPTIONS " \ "-Wno-unused-value -Wno-pointer-sign " \ "-working-directory $WORKING_DIR " \ "-c \"$CLANG_SOURCE\" -target bpf $CLANG_EMIT_LLVM -O2 -o - $LLVM_OPTIONS_PIPE" Maybe should update Documentation/perf-config.txt to tell users the real default value of clang-bpf-cmd-template? Thanks, Leo Yan