From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752156AbbEDTRE (ORCPT ); Mon, 4 May 2015 15:17:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34009 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751627AbbEDTQs (ORCPT ); Mon, 4 May 2015 15:16:48 -0400 Date: Mon, 4 May 2015 21:16:44 +0200 From: Jiri Olsa To: Taeung Song Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, namhyung@kernel.org Subject: Re: [PATCH 3/4] perf tools: Add a option 'all' to perf-config. Message-ID: <20150504191644.GD11223@krava> References: <1430116466-14427-1-git-send-email-treeze.taeung@gmail.com> <1430116466-14427-3-git-send-email-treeze.taeung@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1430116466-14427-3-git-send-email-treeze.taeung@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 27, 2015 at 03:34:25PM +0900, Taeung Song wrote: SNIP > +static int merge_config(const char *var, const char *value, > + void *cb __maybe_unused) > +{ > + const char *section_name, *subkey; > + parse_key(var, §ion_name, &subkey); > + return set_config(section_name, subkey, value); > +} > + > +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)); so we could compile defaultconfig directly into perf via following change maybe the PERFCONFIG-DEFAULT could be in perf root dir also I'm not sure if xxd is common enough to be used, maybe there's some common way used in kernel build already jirka --- diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build index 10df57237a66..888a1d344be2 100644 --- a/tools/build/Makefile.build +++ b/tools/build/Makefile.build @@ -41,6 +41,7 @@ include $(build-file) quiet_cmd_flex = FLEX $@ quiet_cmd_bison = BISON $@ +quiet_cmd_xxd = XXD $@ # Create directory unless it exists quiet_cmd_mkdir = MKDIR $(dir $@) diff --git a/tools/perf/Build b/tools/perf/Build index 3c1f4371c95a..614a9013d401 100644 --- a/tools/perf/Build +++ b/tools/perf/Build @@ -43,3 +43,8 @@ libperf-y += ui/ libperf-y += scripts/ gtk-y += ui/gtk/ + +$(OUTPUT)builtin-config.o: $(OUTPUT)util/PERFCONFIG-DEFAULT.h + +$(OUTPUT)util/PERFCONFIG-DEFAULT.h: $(OUTPUT)util/PERFCONFIG-DEFAULT + @$(call echo-cmd,xxd)xxd -i $< > $@ diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c index a67aea314180..a3678cfca4dd 100644 --- a/tools/perf/builtin-config.c +++ b/tools/perf/builtin-config.c @@ -12,6 +12,7 @@ #include "util/parse-options.h" #include "util/util.h" #include "util/debug.h" +#include "util/PERFCONFIG-DEFAULT.h" static struct { bool list_action;