[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150522172435.GH6609@krava.redhat.com>
Date: Fri, 22 May 2015 19:24:35 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Wang Nan <wangnan0@...wei.com>
Cc: paulus@...ba.org, a.p.zijlstra@...llo.nl, mingo@...hat.com,
acme@...nel.org, namhyung@...nel.org, jolsa@...nel.org,
dsahern@...il.com, ast@...mgrid.com, daniel@...earbox.net,
brendan.d.gregg@...il.com, masami.hiramatsu.pt@...achi.com,
lizefan@...wei.com, linux-kernel@...r.kernel.org, pi3orama@....com
Subject: Re: [RFC PATCH v3 30/37] perf bpf: Add bpf-loader and open ELF
object files
On Sun, May 17, 2015 at 10:56:55AM +0000, Wang Nan wrote:
SNIP
> +#define DEFINE_PRINT_FN(name, level) \
> +static int libbpf_##name(const char *fmt, ...) \
> +{ \
> + va_list args; \
> + int ret; \
> + \
> + va_start(args, fmt); \
> + ret = veprintf(level, verbose, pr_fmt(fmt), args);\
> + va_end(args); \
> + return ret; \
> +}
> +
> +DEFINE_PRINT_FN(warning, 0)
> +DEFINE_PRINT_FN(info, 0)
> +DEFINE_PRINT_FN(debug, 1)
> +
> +static bool libbpf_inited = false;
> +
> +#define MAX_OBJECTS 128
> +
> +struct {
> + struct bpf_object *objects[MAX_OBJECTS];
> + size_t nr_objects;
> +} params;
apart from that we dont like this kind of static stuff, this seems like
nice case for having simple handler like 'struct bpf_objects' carrying
the above data.. what do I miss?
also params should actually be static right?
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists