Re: [PATCH v3 3/6] perf: implement pmu perf_kprobe

From: Peter Zijlstra
Date: Mon Dec 04 2017 - 09:42:03 EST


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?

> +}