Re: [RFC PATCH v3 09/37] bpf tools: Open eBPF object file and do basic validation

Arnaldo Carvalho de Melo
2015-05-26T00:41:21Z

Em Tue, May 26, 2015 at 08:05:28AM +0800, Wangnan (F) escreveu:
> On 2015/5/25 21:30, Arnaldo Carvalho de Melo wrote:
> >Well, there are many styles to pick, the fact that perf uses __ to
> >separate class name from class method doesn't mean that you should as
> >well, as you may find it inconvenient or useless to you, you may prefer
> >CamelCase notation, for instance ;-)

> >In the same fashion the fact that libtraceevent doesn't doesn't mean you
> >shouldn't use what the perf tooling uses.

> I'll try OO style naming and see the results in my next version.

> However, I'm not very sure whether such naming make sense, since we
> have only 2 classes in libbpf: 'bpf_object, bpf_program', 'bpf_map'
> has potential to become a class but currently not.

> In addition, the internal functions are hidden to user, so the only
> meaning to user of such API is an additional '_' in each function.

> Anyway, let's see the result then decide whether it is good enough.

Well, perhaps the number of classes in libbpf is really small, haven't
looked in detail, but over time, if perf's track record is to be taken
into accound, many more may appear :-)

Time permitting I'll try to look at the current codebase again, to try
to provide more comments,

Thanks,

- Arnaldo