Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8128114ybi; Thu, 6 Jun 2019 07:11:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7JjdNbRK9jHs0kAWsD5A+Dq5DX7z636J1SChuEi6W+8bfPdkytuMGizEEHSIYMArS7RXl X-Received: by 2002:a17:902:9004:: with SMTP id a4mr37450009plp.109.1559830263358; Thu, 06 Jun 2019 07:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559830263; cv=none; d=google.com; s=arc-20160816; b=zxl2SHOBCZOOAX3n9NVjvJr3lMh0riCyYOhL1tAVUJ1AU6MIplMVfrwYPBD+xFMCnK wKEIaMiKHh4w2qbafAFVq+EKJFgOlZ6yL49usmh7+B6w+wXztpdS3T9eNxtFp42BTf5e hWrZgrQM0QZHapd7TgZ6MXcimhjzi5IBFKg0tXe0nYgWjlOemKlN6oe6l72w/AS0kx8w 6AKUjs2zluZCoWAE2vLqdln/Dj8ex5xvkrifAqsV4t2UoC+k58CvfSwvTcZZA3o2I2LB btFmk7s2BMosfVUrxbsE7GeDrjshaIUq9WzA/dJOKJaZZZAhIK9NMtO0+1z+Vbwi91bn ZzFQ== 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:date:from:dkim-signature; bh=CmErKybZK9oamn84qU6DwZUq6+OBsy6EtQxggq/g/80=; b=Yxv+dGROfQgxHwBHZIg6HVO+YTxkrHuljwJ4Wx75v/lIYasiYLVc2tpFpQjgOGdBDO AgHb+4jhF8KhXYXkZwhX3hbiijQUZFGdNLV//Gitq7PfFAoTT7dh5FD2fn6daG7gUKaz bF8wfMI3J0cY9aHKDckq3RDbiHaBDDsgqnO/VWu7I4BBqAQ5ZSmInP+zHv6/Lb3JvXov ZN447OaTn2On7eHWSUT/wyTTljQVc4S6IiIXfkY8C/nI7Yt6B1GSFy+lnUbQ3jQVLqOd 9A1u5AKtD3MSQhm6QJHsyA+uRj9EnXxv9gesoRzIuqm9EVlFVyzUfM9AI5jV+g6t1gWz nqYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AiEYYW3X; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z30si2155496pga.363.2019.06.06.07.10.44; Thu, 06 Jun 2019 07:11:03 -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=@gmail.com header.s=20161025 header.b=AiEYYW3X; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728504AbfFFOIG (ORCPT + 99 others); Thu, 6 Jun 2019 10:08:06 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:43243 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726924AbfFFOIG (ORCPT ); Thu, 6 Jun 2019 10:08:06 -0400 Received: by mail-qt1-f193.google.com with SMTP id z24so2736083qtj.10; Thu, 06 Jun 2019 07:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CmErKybZK9oamn84qU6DwZUq6+OBsy6EtQxggq/g/80=; b=AiEYYW3XqpeoY5c0wV5Uyhnr/E8rmKlWZkSHRIYSzqor2bNuEjoMvI1vc1IfNzSVEn Cr+bZX7+ddkuGZe+Nvkb33xwLlAJe6OoZxCOduU7WVA3UiW0C4RJJYiY21bi3+vfY7dD Wct+qDw1b35oT4V9nDXfbdeQ4gAO664ICNBMfJ4/2tAOmgucTUtLWtFOBOCTzXeOSVUQ okgR/JTF+jOl61auvY67c4TxbHbTwgbcjGlb/1DNY1kjLImNYiukcHdL7jBbCy/VnJ/3 8klm0nkfkC6D2ievFwtyJz27RusClnI/CNosB/eZNKMPeZr7/5oe8mrhIiW1/vtY3yif nrjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=CmErKybZK9oamn84qU6DwZUq6+OBsy6EtQxggq/g/80=; b=uHMp0tNMlkRtoGmOLse8FPNFWss5/1QhudQNrWIktw7gTzAL2pdlgPtVRcxX9DpH7M 0cMfCyLzHYif1Zi+/RTNmPVW6WTiPTjONPqlLvZttUxk+qH27Ma8LM+pXhcntPnyUn8G jKaGvOg/SS46yLheKx6phxErmYlbZC8k0/8vdvTolBTAzXOtzW6cRVQHIe+4ZKskJyBB D+NbSzunFAYpE9w2fV3PEnsXSe5g7Jr8GlID2+BCrIJp3AQicIqyVdQhIvuXRbw5cZNO EJdss+qOX01F0KSDDKQp5oQFaboMvt9Bil/ZLJN1/5iSz/OCI/PeaATPclDW1gQtPp4a qm0g== X-Gm-Message-State: APjAAAV3noZugDjiQP8JuOLSE4I/gqjPYq4ehvVz7iy1C/8dNfd1JYiK RNVSfd3iR6c4uUBGWtiwRL4= X-Received: by 2002:ac8:2535:: with SMTP id 50mr2545452qtm.373.1559830085068; Thu, 06 Jun 2019 07:08:05 -0700 (PDT) Received: from quaco.ghostprotocols.net ([177.195.208.82]) by smtp.gmail.com with ESMTPSA id n188sm901808qkc.74.2019.06.06.07.08.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 06 Jun 2019 07:08:04 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id BD44841149; Thu, 6 Jun 2019 11:08:00 -0300 (-03) Date: Thu, 6 Jun 2019 11:08:00 -0300 To: Leo Yan 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: <20190606140800.GF30166@kernel.org> References: <20190606094845.4800-1-leo.yan@linaro.org> <20190606094845.4800-5-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190606094845.4800-5-leo.yan@linaro.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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'? - Arnaldo > This patch add comments to explain the reasons for building failure and > give two examples for llvm.clang-opt variable, one is for x86_64 > architecture and another is for aarch64 architecture. > > Signed-off-by: Leo Yan > --- > .../examples/bpf/augmented_raw_syscalls.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/tools/perf/examples/bpf/augmented_raw_syscalls.c b/tools/perf/examples/bpf/augmented_raw_syscalls.c > index a3701a4daf2e..fb6987edab2c 100644 > --- a/tools/perf/examples/bpf/augmented_raw_syscalls.c > +++ b/tools/perf/examples/bpf/augmented_raw_syscalls.c > @@ -6,6 +6,25 @@ > * > * perf trace -e tools/perf/examples/bpf/augmented_raw_syscalls.c cat /etc/passwd > /dev/null > * > + * This program include two header files 'unistd.h' and 'pid_filter.h', which > + * are placed in the folder tools/perf/include/bpf, but this folder is not > + * included in env $KERNEL_INC_OPTIONS and it leads to compilation failure. > + * For building this code, we also need to specify architecture and define macro > + * __NR_CPUS__. To resolve these issues, variable llvm.clang-opt can be set in > + * the file ~/.perfconfig: > + * > + * E.g. Test on a platform with 8 CPUs with x86_64 architecture: > + * > + * [llvm] > + * clang-opt = "-D__NR_CPUS__=8 -D__x86_64__ \ > + * -I./tools/perf/include/bpf" > + * > + * E.g. Test on a platform with 5 CPUs with aarch64 architecture: > + * > + * [llvm] > + * clang-opt = "-D__NR_CPUS__=5 -D__aarch64__ \ > + * -I./tools/perf/include/bpf" > + > * This exactly matches what is marshalled into the raw_syscall:sys_enter > * payload expected by the 'perf trace' beautifiers. > * > -- > 2.17.1 -- - Arnaldo