lkml.org 
[lkml]   [2013]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT PULL 00/21] perf/core improvements and fixes
Em Tue, Dec 10, 2013 at 01:46:58PM +0100, Ingo Molnar escreveu:
> * Ingo Molnar <mingo@kernel.org> wrote:
> > Every time one runs into a crash like this it's a canary signal that
> > cleanliness principles need hardening.
>
> More observations about util/dso.c:
>
> - dso__binary_type_file() should probably pass in 'const struct dso'
>
> - dso__binary_type_file()'s filename string parameter should be named
> 'filename', not 'file' ...
>
> - build_id__sprintf() looks fragile: every single use of it appears
> to follow this pattern:
>
> build_id__sprintf(x, sizeof(x), ...)
>
> this could be simplified (and eliminating the possibility to typo a
> bug) by changing the function to __build_id__snprintf() and adding
> a build_id__sprintf() wrapper macro around it:
>
> build_id__sprintf(x, ...)
>
> that generates the size itself.

Right, like:

int __perf_evlist__add_default_attrs(struct perf_evlist *evlist,
struct perf_event_attr *attrs, size_t nr_attrs);

#define perf_evlist__add_default_attrs(evlist, array) \
__perf_evlist__add_default_attrs(evlist, array, ARRAY_SIZE(array))

This is all a matter of being more dilligent and judicious at employing
these and other good practices.

But don't be shy to point anything (like you did here), as time permits
we can go on doing patchkits to address things people notice.

- Arnaldo


\
 
 \ /
  Last update: 2013-12-10 15:01    [W:0.094 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site