From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v3 3/6] perf: implement pmu perf_kprobe Date: Mon, 4 Dec 2017 15:41:40 +0100 Message-ID: <20171204144140.xdpm6vmtdek4fjzb@hirez.programming.kicks-ass.net> References: <20171130235023.1414663-1-songliubraving@fb.com> <20171130235023.1414663-6-songliubraving@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: rostedt@goodmis.org, mingo@redhat.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, daniel@iogearbox.net, kernel-team@fb.com To: Song Liu Return-path: Content-Disposition: inline In-Reply-To: <20171130235023.1414663-6-songliubraving@fb.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Thu, Nov 30, 2017 at 03:50:20PM -0800, Song Liu wrote: > +static struct pmu perf_kprobe = { > +}; > +static inline bool perf_event_is_tracing(struct perf_event *event) > +{ > + return event->attr.type == PERF_TYPE_TRACEPOINT || > + strncmp(event->pmu->name, "kprobe", 6) == 0; Why a strcmp here? Wouldn't something like: event->pmu == &perf_kprobe work much simpler? > +}