lkml.org 
[lkml]   [2015]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2015-05-22 20:01    [W:0.482 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site