Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a35b349 authored by Taeung Song's avatar Taeung Song Committed by Arnaldo Carvalho de Melo
Browse files

perf config: Reimplement show_config() using config_set__for_each



Recently config_set__for_each got added.  In order to let show_config()
be short and clear, rewrite this function using it.

Signed-off-by: default avatarTaeung Song <treeze.taeung@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1466691272-24117-4-git-send-email-treeze.taeung@gmail.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 8a0a9c7e
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -37,24 +37,17 @@ static int show_config(struct perf_config_set *set)
{
	struct perf_config_section *section;
	struct perf_config_item *item;
	struct list_head *sections;

	if (set == NULL)
		return -1;

	sections = &set->sections;
	if (list_empty(sections))
		return -1;

	list_for_each_entry(section, sections, node) {
		list_for_each_entry(item, &section->items, node) {
	perf_config_set__for_each_entry(set, section, item) {
		char *value = item->value;

		if (value)
			printf("%s.%s=%s\n", section->name,
			       item->name, value);
	}
	}

	return 0;
}