[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160417115229.GB31336@krava.brq.redhat.com>
Date: Sun, 17 Apr 2016 13:52:29 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Wang Nan <wangnan0@...wei.com>
Cc: acme@...nel.org, linux-kernel@...r.kernel.org, pi3orama@....com,
Adrian Hunter <adrian.hunter@...el.com>,
He Kuang <hekuang@...wei.com>, Jiri Olsa <jolsa@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Zefan Li <lizefan@...wei.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: Re: [PATCH v3 1/6] perf tools: Derive trigger class from
auxtrace_snapshot
On Fri, Apr 15, 2016 at 06:20:15PM +0000, Wang Nan wrote:
SNIP
> +
> +#define __TRIGGER_VAR(n) n##_state
> +#define __DEF_TRIGGER_VOID_FUNC(n, op) \
> +static inline void n##_##op(void) {trigger_##op(&__TRIGGER_VAR(n)); }
> +
> +#define __DEF_TRIGGER_FUNC(n, type, op) \
> +static inline type n##_##op(void) {return trigger_##op(&__TRIGGER_VAR(n)); }
> +
> +#define DEFINE_TRIGGER(n, def) \
> +struct trigger n##_state = {.state = TRIGGER_##def, .error = false,};\
> +__DEF_TRIGGER_VOID_FUNC(n, on) \
> +__DEF_TRIGGER_VOID_FUNC(n, release) \
> +__DEF_TRIGGER_VOID_FUNC(n, toggle) \
> +__DEF_TRIGGER_VOID_FUNC(n, colddown) \
> +__DEF_TRIGGER_VOID_FUNC(n, off) \
> +__DEF_TRIGGER_VOID_FUNC(n, error) \
> +__DEF_TRIGGER_FUNC(n, bool, is_released) \
> +__DEF_TRIGGER_FUNC(n, bool, is_toggled) \
> +__DEF_TRIGGER_FUNC(n, bool, is_error)
hum, it gets the impression that __DEF_TRIGGER_FUNC is generic
but it's not, right? __DEF_TRIGGER_BOOL_FUNC might suit better
without the bool type as an argument
thanks,
jirka
Powered by blists - more mailing lists