aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaeung Song <[email protected]>2016-06-23 23:14:32 +0900
committerArnaldo Carvalho de Melo <[email protected]>2016-06-23 17:23:00 -0300
commit4a35b3497c413de8b409f9d75700eeb4772b21b8 (patch)
treeaad3076b4ccaeea4b7d9a2213282e24c36ac60d4
parent8a0a9c7e9146781defc96f6743e7ee14ccc9ab23 (diff)
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: Taeung Song <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/builtin-config.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c
index cfd1036b1d24..e4207a23b52c 100644
--- a/tools/perf/builtin-config.c
+++ b/tools/perf/builtin-config.c
@@ -37,23 +37,16 @@ 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) {
- char *value = item->value;
+ 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);
- }
+ if (value)
+ printf("%s.%s=%s\n", section->name,
+ item->name, value);
}
return 0;