Re: [RFC PATCH v3 30/37] perf bpf: Add bpf-loader and open ELF object files

2015-05-25 Thread Arnaldo Carvalho de Melo
> On Sun, May 17, 2015 at 10:56:55AM +, Wang Nan wrote: SNIP > +static bool libbpf_inited = false; libbpf_initialized? [acme@zoo linux]$ find . -name "*.[ch]" | xargs grep initialized | wc -l 5134 [acme@zoo linux]$ find . -name "*.[ch]" | xargs grep inited | wc -l 226 - Arnaldo -- To uns

Re: [RFC PATCH v3 30/37] perf bpf: Add bpf-loader and open ELF object files

2015-05-25 Thread Wangnan (F)
On 2015/5/23 1:24, Jiri Olsa wrote: On Sun, May 17, 2015 at 10:56:55AM +, Wang Nan wrote: SNIP +#define DEFINE_PRINT_FN(name, level) \ +static int libbpf_##name(const char *fmt, ...) \ +{ \ + va_list args; \ +

Re: [RFC PATCH v3 30/37] perf bpf: Add bpf-loader and open ELF object files

2015-05-22 Thread Jiri Olsa
On Sun, May 17, 2015 at 10:56:55AM +, Wang Nan wrote: SNIP > +#define DEFINE_PRINT_FN(name, level) \ > +static int libbpf_##name(const char *fmt, ...) \ > +{\ > + va_list args; \ > + int ret;

[RFC PATCH v3 30/37] perf bpf: Add bpf-loader and open ELF object files

2015-05-17 Thread Wang Nan
bpf_prepare_laod() is used to open each eBPF object files. The returned handlers are stored into an array. A corresponding bpf_clear() is introduced to free all resources. For the propose of logging, 3 printing functions are defined using DEFINE_PRINT_FN, which require a veprintf to process va_lis