From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932250AbbLNKeD (ORCPT ); Mon, 14 Dec 2015 05:34:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33692 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932162AbbLNKeB (ORCPT ); Mon, 14 Dec 2015 05:34:01 -0500 Date: Mon, 14 Dec 2015 11:33:58 +0100 From: Jiri Olsa To: Josh Poimboeuf Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Namhyung Kim Subject: Re: [PATCH v3 10/17] perf: Provide subcmd configuration at runtime Message-ID: <20151214103358.GC9449@krava.brq.redhat.com> References: <54974ed6fae6bb7f4091714cb90251ef6985be9d.1449965119.git.jpoimboe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54974ed6fae6bb7f4091714cb90251ef6985be9d.1449965119.git.jpoimboe@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 13, 2015 at 10:18:10PM -0600, Josh Poimboeuf wrote: SNIP > > typedef int (*config_fn_t)(const char *, const char *, void *); > extern int perf_default_config(const char *, const char *, void *); > diff --git a/tools/perf/util/exec_cmd.c b/tools/perf/util/exec_cmd.c > index 1099e92..84f9dc5 100644 > --- a/tools/perf/util/exec_cmd.c > +++ b/tools/perf/util/exec_cmd.c > @@ -5,19 +5,33 @@ > #include > > #define MAX_ARGS 32 > +#define UNDEFINED "UNDEFINED" > > static const char *argv_exec_path; > static const char *argv0_path; > > +static const char *cfg_exec_name = UNDEFINED; > +static const char *cfg_prefix = UNDEFINED; > +static const char *cfg_exec_path = UNDEFINED; > +static const char *cfg_exec_path_env = UNDEFINED; so instead of forcing each object to hold some subset of cfg_* configuration, why not create global cfg object that would carry this data.. cfg_path or so ;-) jirka