lkml.org 
[lkml]   [2017]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 3/6] perf: implement pmu perf_kprobe
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?

> +}

\
 
 \ /
  Last update: 2017-12-04 15:42    [W:0.066 / U:24.324 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site