From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EE25C28EB3 for ; Thu, 6 Jun 2019 18:29:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5EAA12089E for ; Thu, 6 Jun 2019 18:29:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AAlI2KM0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730663AbfFFS3y (ORCPT ); Thu, 6 Jun 2019 14:29:54 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:44423 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729165AbfFFS3x (ORCPT ); Thu, 6 Jun 2019 14:29:53 -0400 Received: by mail-qt1-f193.google.com with SMTP id x47so3804314qtk.11; Thu, 06 Jun 2019 11:29:52 -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=VDyWzmRCEFjiSNNaRnKgaThnkb6qt5FoNhaBpkNRo4o=; b=AAlI2KM0uk4kE32HxvkLoOpHYXsGwTmmS3guDD0J9itTCOT6EA1N308hWHCK6p1paf hXwv9mzUL7eVRRjl9LVk2FPptt5QYiUu6AmVQyXYVNYYZnsP2Q7nk6fhdiFK3E0YtFOF hDSsyKUbrWsQ/w+amz1hTw34jj+O3oSjUy7CMFCRs2NKPxM/ZBOViJFwcsAHTSCJrmIp ZcV1xsGbC39xQYk0EcD7iG2S1vRg61MUF/PnpRP/0Fo/W9tDLRi/gyfnyN7koKIYsUkL ZJrvGlnj6+fYdGO9e2EHTA3xFR3QM7er5dSgLvkfIUDMqBQ3vGFvBxdnUPcD6LQBkurK nrXQ== 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=VDyWzmRCEFjiSNNaRnKgaThnkb6qt5FoNhaBpkNRo4o=; b=OstfW8VTnnlEVel9NlPNLnzcHCADNxwYvBQ44TDhDaPWS450hjNGvCNO8K3YyLxzJ/ gLZVHqlzcp3uNRVFnhrmbnLjAkctH4+y5F+NNYJJ+PbhvaOENmTQijQB5yRwosK34DjJ 7UtMF0tw3/ejaRM6TKFC4afFpHh3HmiSBPtxMPwSJ3jmMFFM+SBzNr+nDJaAciw0lg/v J/g9hJ+J1urldyM/SlJGrOtmrhYcOLxU7DiS7OY3HL+WbCEUPi3vkG1DBlqYf8CzYqXx fk9p3GIWLeDipiXhxnua7mkzjdHtPVMSzHZd7fWJ+epIbxV6nX7K5pRqwNHCXH//WiV7 uNOA== X-Gm-Message-State: APjAAAW7M3nNBG71QMSDWQyMN9z9YR034LU4CCh4Ub2fMLktid0tcqGo kAwrURwAm82evJtJjpEBslE= X-Google-Smtp-Source: APXvYqxSQs6DlT2QSTIZfamR7F6e/5KiLWc1qKb6vFB+/5MPiN3QfN7IcRBzokNHwN+mLuffT0AfyQ== X-Received: by 2002:ac8:1855:: with SMTP id n21mr38568496qtk.311.1559845791966; Thu, 06 Jun 2019 11:29:51 -0700 (PDT) Received: from quaco.ghostprotocols.net ([177.195.209.167]) by smtp.gmail.com with ESMTPSA id x7sm1581941qth.37.2019.06.06.11.29.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 06 Jun 2019 11:29:51 -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 36B6341149; Thu, 6 Jun 2019 15:29:41 -0300 (-03) Date: Thu, 6 Jun 2019 15:29:41 -0300 To: Leo Yan Cc: Arnaldo Carvalho de Melo , 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: <20190606182941.GE21245@kernel.org> References: <20190606094845.4800-1-leo.yan@linaro.org> <20190606094845.4800-5-leo.yan@linaro.org> <20190606140800.GF30166@kernel.org> <20190606143532.GD5970@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190606143532.GD5970@leoy-ThinkPad-X240s> 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 10:35:32PM +0800, Leo Yan escreveu: > 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? Sure, if you fell like doing this, please update and also please figure out when the this changed and add a Fixes: that cset, Its great that you're going thru the docs and making sure the differences are noted so that we update the docs, thanks a lot! - Arnaldo