From patchwork Sat Aug 29 04:22:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 52837 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 6CCD320503 for ; Sat, 29 Aug 2015 04:27:46 +0000 (UTC) Received: by labth1 with SMTP id th1sf24039162lab.2 for ; Fri, 28 Aug 2015 21:27:45 -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=uP24I8rugjL3sAX4fYH/FIau0vs8SDYdGknV5cBYqGs=; b=WAGceZmRjSZfLPhClEz+N7ji60inkEPqUv5Fu1mgj4WfqNiZWTrNTGAGCHbKADWG+G kxRVSOqMOrUYObTqHHTrGMG4fivVx3DYNdZMYOYJuFkNzHRUYdcsj7+fmQkrI06bzN/S DOEH+/b8xI0XLxsnni4323ZGIChn2Lq40q5UL1/f8h3YUWK0j5dMoEuqO9De6pdhv56K +leTbc+hsAJ1bEJrTRVTnqp4dIbflBC6JVV9BqKEutdFqkNbRE8u+bA9brJvBWaH7PMG IzEgtEDIMjthoiThXyb7WsK7wvyMNvljZmuuPbO23LXltmHihnExzrJw4g7fZOpV7GMe zlmw== X-Gm-Message-State: ALoCoQk9E/jDXOgleG40b+eozLxJlArGdf8/w43ToMQzLvwCOa2j6kJV0G04VQO5nwSUblMqVS0H X-Received: by 10.152.29.36 with SMTP id g4mr3540445lah.3.1440822465433; Fri, 28 Aug 2015 21:27:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.1 with SMTP id g1ls243832lag.46.gmail; Fri, 28 Aug 2015 21:27:45 -0700 (PDT) X-Received: by 10.152.27.10 with SMTP id p10mr6256857lag.89.1440822465273; Fri, 28 Aug 2015 21:27:45 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id cq12si7664783lad.97.2015.08.28.21.27.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2015 21:27:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by laba3 with SMTP id a3so43317496lab.1 for ; Fri, 28 Aug 2015 21:27:45 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr6258962lbb.56.1440822465118; Fri, 28 Aug 2015 21:27:45 -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.151.194 with SMTP id us2csp268604lbb; Fri, 28 Aug 2015 21:27:44 -0700 (PDT) X-Received: by 10.66.145.195 with SMTP id sw3mr20581177pab.72.1440822464078; Fri, 28 Aug 2015 21:27:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pf2si13338764pdb.253.2015.08.28.21.27.42; Fri, 28 Aug 2015 21:27:44 -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 S1753275AbbH2E1Z (ORCPT + 28 others); Sat, 29 Aug 2015 00:27:25 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:7098 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbbH2E1V (ORCPT ); Sat, 29 Aug 2015 00:27:21 -0400 Received: from 172.24.1.51 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.51]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CRK01391; Sat, 29 Aug 2015 12:23:27 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.235.1; Sat, 29 Aug 2015 12:23:21 +0800 From: Wang Nan To: , , CC: , , , Wang Nan , Brendan Gregg , Daniel Borkmann , David Ahern , "He Kuang" , Jiri Olsa , Kaixu Xia , Masami Hiramatsu , Namhyung Kim , Paul Mackerras , Peter Zijlstra Subject: [PATCH 28/31] perf probe: Init symbol as kprobe Date: Sat, 29 Aug 2015 04:22:02 +0000 Message-ID: <1440822125-52691-29-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1440822125-52691-1-git-send-email-wangnan0@huawei.com> References: <1440822125-52691-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.215.48 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: , Before this patch, add_perf_probe_events() init symbol maps only for uprobe if the first 'struct perf_probe_event' passed to it is a uprobe event. This is a trick because 'perf probe''s command line syntax constrains the first elements of the probe_event arrays must be kprobes if there is one kprobe there. However, with the incoming BPF uprobe support, that constrain is not hold since 'perf record' will also probe on k/u probes through BPF object, and is possible to pass an array with kprobe but the first element is uprobe. This patch init symbol maps for kprobes even if all of events are uprobes, because the extra cost should be small enough. Signed-off-by: Wang Nan 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 Cc: Arnaldo Carvalho de Melo Link: http://lkml.kernel.org/n/1436445342-1402-39-git-send-email-wangnan0@huawei.com Acked-by: Masami Hiramatsu --- tools/perf/util/probe-event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index e720913..b94a8d7 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -2789,7 +2789,7 @@ int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, { int i, ret; - ret = init_symbol_maps(pevs->uprobes); + ret = init_symbol_maps(false); if (ret < 0) return ret;