From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756729AbbJVGVz (ORCPT ); Thu, 22 Oct 2015 02:21:55 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34040 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756692AbbJVGVv (ORCPT ); Thu, 22 Oct 2015 02:21:51 -0400 Subject: Re: [PATCH v2 net-next] bpf: fix bpf_perf_event_read() helper To: "Wangnan (F)" , "David S. Miller" References: <1445468283-4592-1-git-send-email-ast@kernel.org> <562874A5.1050307@huawei.com> Cc: Ingo Molnar , Peter Zijlstra , He Kuang , Kaixu Xia , Daniel Borkmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org From: Alexei Starovoitov Message-ID: <5628807C.3040305@plumgrid.com> Date: Wed, 21 Oct 2015 23:21:48 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562874A5.1050307@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/21/15 10:31 PM, Wangnan (F) wrote: >> + if ((attr->type != PERF_TYPE_RAW && >> + !(attr->type == PERF_TYPE_SOFTWARE && >> + attr->config == PERF_COUNT_SW_BPF_OUTPUT) && >> + attr->type != PERF_TYPE_HARDWARE) || >> + attr->inherit) { > > This 'if' statement is so complex. What about using a inline function > instead? hmm. don't see how inline function will help readability.