Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758322AbcDHPHr (ORCPT ); Fri, 8 Apr 2016 11:07:47 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:46495 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754281AbcDHPHp (ORCPT ); Fri, 8 Apr 2016 11:07:45 -0400 From: Wang Nan To: CC: , , , Subject: [PATCH 0/4] perf bpf: Add __bpf_stdout__ support Date: Fri, 8 Apr 2016 15:07:21 +0000 Message-ID: <1460128045-97310-1-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.5707C93B.0043,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 2b6147032cd800916477de71f59ed2aa Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1548 Lines: 35 Hi Arnaldo, Following your suggestion, patch 3-4 in this patch set add __bpf_stdout__ support. If a map is called __bpf_stdout__, perf will create a bpf-output event and attach to it automatically. Don't need to setup bpf output event in cmdline explicitly. # perf record -e ./test_bpf_trace.c usleep 100000 # ~/perf script usleep 25656 [003] 264724.900051: 0 __bpf_stdout__: ffffffff810eb9a1 sys_nanosleep (/lib/modules BPF output: 0000: 52 61 69 73 65 20 61 20 Raise a 0008: 42 50 46 20 65 76 65 6e BPF even 0010: 74 21 00 00 t!.. BPF string: "Raise a BPF event!" usleep 25656 [003] 264725.000112: 0 __bpf_stdout__: ffffffff8105d609 kretprobe_trampoline_holder BPF output: 0000: 52 61 69 73 65 20 61 20 Raise a 0008: 42 50 46 20 65 76 65 6e BPF even 0010: 74 21 00 00 t!.. BPF string: "Raise a BPF event!" Wang Nan (4): perf trace: Improve error message when receive non-tracepoint events perf trace: Print content of bpf-output event perf bpf: Clone bpf stdout events in multiple bpf scripts perf bpf: Automatically create bpf-output event __bpf_stdout__ tools/perf/builtin-record.c | 8 +++ tools/perf/builtin-trace.c | 33 +++++++++- tools/perf/util/bpf-loader.c | 143 +++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/bpf-loader.h | 19 ++++++ 4 files changed, 202 insertions(+), 1 deletion(-) -- 1.8.3.4