From patchwork Sun Sep 6 07:13:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 53186 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 1397822B05 for ; Sun, 6 Sep 2015 07:19:02 +0000 (UTC) Received: by lamp12 with SMTP id p12sf17916539lam.2 for ; Sun, 06 Sep 2015 00:19:01 -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=Jyh1cAXmY6rHJHdxCPpN8HFsYtHinbxqZ8JeYApSycM=; b=dE9QOyeFDNpw00AjBX9SFdT/AcHfTYvdwmcUmbFjUTxo1+IprV1RN5E3LLQeMNe0Dd d9ytcl9yXVrJwbn25tZMpEKp5A6IDO1RtaFVgp3lIS5G7bwb7aC71a6SJiXjqtRrJ98K 3JMlnK3TytiBvYgq63jCZ5SGCJcjU+FmspAe06g6//KiMEs7ZyS/BeqD2MHuM83tbQkk siT/B7VHKS4azm9OE3UFBwbRXdK+5NiFL2S1OVap0GFWB7d0h/cvHdOgc4qImEjXTqer PBzFiVWcqVcnt8jlxJ39PxCa2k78aGrxq/3LXgaZ6JB4VZFumq1q4N6njZ+ILU+6ZEQC 4hPQ== X-Gm-Message-State: ALoCoQm6KBmG0iPO/R3Rz4W2k/FVT3fOkKevMtC0zj+JTBGTXdvlKOo1pnQD9UQykFfhsApVcUde X-Received: by 10.194.19.33 with SMTP id b1mr3337443wje.6.1441523941050; Sun, 06 Sep 2015 00:19:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.70 with SMTP id y6ls460672lay.55.gmail; Sun, 06 Sep 2015 00:19:00 -0700 (PDT) X-Received: by 10.152.25.166 with SMTP id d6mr11708684lag.79.1441523940853; Sun, 06 Sep 2015 00:19:00 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id kz1si7242401lab.19.2015.09.06.00.19.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Sep 2015 00:19:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbpo4 with SMTP id o4so27012949lbp.2 for ; Sun, 06 Sep 2015 00:19:00 -0700 (PDT) X-Received: by 10.152.43.198 with SMTP id y6mr11307688lal.41.1441523940752; Sun, 06 Sep 2015 00:19:00 -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.164.42 with SMTP id yn10csp844707lbb; Sun, 6 Sep 2015 00:18:59 -0700 (PDT) X-Received: by 10.50.66.237 with SMTP id i13mr21254090igt.85.1441523939584; Sun, 06 Sep 2015 00:18:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qe7si13751286pdb.209.2015.09.06.00.18.58; Sun, 06 Sep 2015 00:18:59 -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 S1753140AbbIFHS4 (ORCPT + 28 others); Sun, 6 Sep 2015 03:18:56 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:7769 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751533AbbIFHOs (ORCPT ); Sun, 6 Sep 2015 03:14:48 -0400 Received: from 172.24.1.48 (EHLO SZXEML423-HUB.china.huawei.com) ([172.24.1.48]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUK94081; Sun, 06 Sep 2015 15:14:27 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by SZXEML423-HUB.china.huawei.com (10.82.67.154) with Microsoft SMTP Server id 14.3.235.1; Sun, 6 Sep 2015 15:14:17 +0800 From: Wang Nan To: , , , CC: , , , , , , , , , , , Subject: [PATCH 24/27] perf probe: Init symbol as kprobe Date: Sun, 6 Sep 2015 07:13:40 +0000 Message-ID: <1441523623-152703-25-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1441523623-152703-1-git-send-email-wangnan0@huawei.com> References: <1441523623-152703-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.172 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 Acked-by: Masami Hiramatsu Cc: Alexei Starovoitov Cc: Brendan Gregg Cc: Daniel Borkmann Cc: David Ahern Cc: He Kuang Cc: Jiri Olsa Cc: Kaixu Xia 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 --- 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 5964ecc..7f65197 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -2746,7 +2746,7 @@ int convert_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;