Re: [PATCH 3/4] perf tools: Add a option 'all' to perf-config.

Jiri Olsa
2015-05-04T19:16:50Z

On Mon, Apr 27, 2015 at 03:34:25PM +0900, Taeung Song wrote:

SNIP

> +
> +static int show_all_config(void)
> +{
> + int ret = 0;
> + struct config_section *section_node;
> + struct config_element *element_node;
> + char *pwd, *all_config;
> +
> + pwd = getenv("PWD");
> + all_config = strdup(mkpath("%s/util/PERFCONFIG-DEFAULT", pwd));
> +
> + if (!all_config) {
> + pr_err("%s: strdup failed\n", __func__);
> + return -1;
> + }
> +
> + sections = zalloc(sizeof(*sections));
> + if (!sections)
> + return -1;
> + INIT_LIST_HEAD(sections);

this code pattern is already there, please placeit into function

also, where's the section freed?

jirka