Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754187AbbGBCsf (ORCPT ); Wed, 1 Jul 2015 22:48:35 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:35721 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753243AbbGBCs2 (ORCPT ); Wed, 1 Jul 2015 22:48:28 -0400 Message-ID: <5594A679.7010108@plumgrid.com> Date: Wed, 01 Jul 2015 19:48:25 -0700 From: Alexei Starovoitov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Peter Zijlstra , "Wangnan (F)" CC: He Kuang , rostedt@goodmis.org, masami.hiramatsu.pt@hitachi.com, mingo@redhat.com, acme@redhat.com, jolsa@kernel.org, namhyung@kernel.org, linux-kernel@vger.kernel.org, pi3orama Subject: Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event References: <1435719455-91155-1-git-send-email-hekuang@huawei.com> <20150701054458.GN19282@twins.programming.kicks-ass.net> <559386D7.1020208@huawei.com> <20150701115825.GV19282@twins.programming.kicks-ass.net> In-Reply-To: <20150701115825.GV19282@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1207 Lines: 38 On 7/1/15 4:58 AM, Peter Zijlstra wrote: > > But why create a separate trace buffer, it should go into the regular > perf buffer. +1 I think +static char __percpu *perf_extra_trace_buf[PERF_NR_CONTEXTS]; is redundant. It adds quite a bit of unnecessary complexity to the whole patch set. Also the call to bpf_output_sample() is not effective unless program returns 1. It's a confusing user interface. Also you cannot ever do: BPF_FUNC_probe_read, + BPF_FUNC_output_sample, BPF_FUNC_ktime_get_ns, new functions must be added to the end. Why not just do: perf_trace_buf_prepare() + perf_trace_buf_submit() from the helper? No changes to current code. No need to call __get_data_size() and other overhead. The helper can be called multiple times from the same program. imo much cleaner. Also how about calling this helper: bpf_trace_buf_submit(void *stack_ptr, int size) ? bpf_output_sample, I think, is odd name. It's not a sample. May be other name? -- 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/