From patchwork Wed Oct 14 12:41:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 54928 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 7C13023012 for ; Wed, 14 Oct 2015 12:44:48 +0000 (UTC) Received: by lbwr8 with SMTP id r8sf25332659lbw.0 for ; Wed, 14 Oct 2015 05:44:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=3b1crPPuHwEfj0goqLxMB8Z8hq8ReK8lIsX6LB2fBwc=; b=dVJsOYjc2Uu3zbF/+O/fqJ5Mt7NPr5ptHgvY6WWtzbuJsAu0FR5qzKnFjl+TX1xMZI V8RXNdCCEJhP+3LcDCXBhlZQmTDJqfrXx2nfTfpA6LLxsZyFPiWzgSKUXq/fQV6/DYTG ZpXWyztkzbQSNnhDIogdzEb/mbH1bj3DCo7Wfg6XOPV5mWU8yki3dSY+wt+E5Hi3Q+EH q0GVs1iUyfeOBQRaBAs1oUzs7kGr3Ze77JfCAqfHsesrlcd6Wj+ynFTMTTb6hFHAt9cJ +pAiTTlEQv6Zfo6D0lxpLOP+w/n8rUJo4mxARBH70dKukc+Sz+KN7RTUX8kLZ7i8Lg2N +v7A== X-Gm-Message-State: ALoCoQlV6seLz004Q4rPLKz9GV0UUTb5x75x8nYgnSQ7hP9McvjmG4/OBOhotgPgCMQ1M8iIs6Uo X-Received: by 10.112.63.165 with SMTP id h5mr743854lbs.18.1444826687471; Wed, 14 Oct 2015 05:44:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.16.40 with SMTP id f40ls35180lfi.59.gmail; Wed, 14 Oct 2015 05:44:47 -0700 (PDT) X-Received: by 10.25.83.82 with SMTP id h79mr991328lfb.89.1444826687309; Wed, 14 Oct 2015 05:44:47 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id j7si5432154lbd.92.2015.10.14.05.44.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 05:44:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbpp2 with SMTP id pp2so15986729lbb.0 for ; Wed, 14 Oct 2015 05:44:47 -0700 (PDT) X-Received: by 10.112.146.104 with SMTP id tb8mr1508784lbb.35.1444826687129; Wed, 14 Oct 2015 05:44:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2710606lbq; Wed, 14 Oct 2015 05:44:46 -0700 (PDT) X-Received: by 10.67.4.230 with SMTP id ch6mr3655968pad.11.1444826685591; Wed, 14 Oct 2015 05:44:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si13076528pbq.64.2015.10.14.05.44.45; Wed, 14 Oct 2015 05:44:45 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932328AbbJNMok (ORCPT + 30 others); Wed, 14 Oct 2015 08:44:40 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:50450 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753661AbbJNMnF (ORCPT ); Wed, 14 Oct 2015 08:43:05 -0400 Received: from 172.24.1.49 (EHLO szxeml425-hub.china.huawei.com) ([172.24.1.49]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CWT05977; Wed, 14 Oct 2015 20:42:47 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml425-hub.china.huawei.com (10.82.67.180) with Microsoft SMTP Server id 14.3.235.1; Wed, 14 Oct 2015 20:42:39 +0800 From: Wang Nan To: , , CC: , , , , , , , , , , , , Wang Nan , Arnaldo Carvalho de Melo Subject: [PATCH 30/31] perf record: Apply config to BPF objects before recording Date: Wed, 14 Oct 2015 12:41:41 +0000 Message-ID: <1444826502-49291-31-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1444826502-49291-1-git-send-email-wangnan0@huawei.com> References: <1444826502-49291-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: wangnan0@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: He Kuang In perf record, before start recording, call bpf__apply_config() to turn on all BPF config options. Signed-off-by: Wang Nan Signed-off-by: He Kuang Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Brendan Gregg Cc: Daniel Borkmann Cc: David Ahern Cc: He Kuang Cc: Jiri Olsa Cc: Kaixu Xia Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Zefan Li Cc: pi3orama@163.com Link: http://lkml.kernel.org/n/ebpf-ziazd5s4t9j96d01t5bdbtat@git.kernel.org --- tools/perf/builtin-record.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 200f221..a47ce9e 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -32,6 +32,7 @@ #include "util/parse-branch-options.h" #include "util/parse-regs-options.h" #include "util/llvm-utils.h" +#include "util/bpf-loader.h" #include #include @@ -524,6 +525,15 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) goto out_child; } + err = bpf__apply_config(); + if (err) { + char errbuf[BUFSIZ]; + + bpf__strerror_apply_config(err, errbuf, sizeof(errbuf)); + pr_warning("WARNING: Apply config to BPF failed: %s\n", + errbuf); + } + /* * Normally perf_session__new would do this, but it doesn't have the * evlist.