Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752000AbbD3KzX (ORCPT ); Thu, 30 Apr 2015 06:55:23 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:1489 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751390AbbD3KzU (ORCPT ); Thu, 30 Apr 2015 06:55:20 -0400 From: Wang Nan To: , , , , , , CC: , , , Subject: [RFC PATCH 21/22] perf bpf: probe at kprobe points. Date: Thu, 30 Apr 2015 10:52:44 +0000 Message-ID: <1430391165-30267-22-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1430391165-30267-1-git-send-email-wangnan0@huawei.com> References: <1430391165-30267-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.197.210] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1041 Lines: 43 --- tools/perf/util/bpf-loader.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index 208f5e8..186a3d0 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -952,8 +952,26 @@ out: return -1; } +static int bpf_probe(void) +{ + int err = add_perf_probe_events(params.event_array, + params.nr_events, + MAX_PROBES, 0); + /* add_perf_probe_events return negative when fail */ + if (err < 0) + pr_err("bpf probe: failed to probe events\n"); + + return err < 0 ? err : 0; +} + int bpf__run(void) { + int err; + + pr_debug("bpf: probing\n"); + if ((err = bpf_probe())) + return err; + pr_info("BPF is running. Use Ctrl-c to stop.\n"); while(1) sleep(1); -- 1.8.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/