Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753504AbbF0HzV (ORCPT ); Sat, 27 Jun 2015 03:55:21 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:32777 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967AbbF0HzN (ORCPT ); Sat, 27 Jun 2015 03:55:13 -0400 Message-ID: <558E56DE.4070006@plumgrid.com> Date: Sat, 27 Jun 2015 00:55:10 -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: He Kuang , rostedt@goodmis.org, masami.hiramatsu.pt@hitachi.com, mingo@redhat.com, acme@redhat.com CC: wangnan0@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bpf: Put perf_events check ahead of bpf prog References: <1435387495-141813-1-git-send-email-hekuang@huawei.com> In-Reply-To: <1435387495-141813-1-git-send-email-hekuang@huawei.com> 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: 806 Lines: 23 On 6/26/15 11:44 PM, He Kuang wrote: > @@ -1141,13 +1141,13 @@ kprobe_perf_func(struct trace_kprobe *tk, struct pt_regs *regs) > int size, __size, dsize; > int rctx; > > - if (prog && !trace_call_bpf(prog, regs)) > - return; > - > head = this_cpu_ptr(call->perf_events); > if (hlist_empty(head)) > return; > > + if (prog && !trace_call_bpf(prog, regs)) > + return; I considered doing that before placing it where it is now. There were some issues with this approach. Trying to remember. I'm traveling at the moment. Will elaborate next week. -- 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/