Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1291206

Re: [PATCH v3 10/17] perf: Provide subcmd configuration at runtime

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 10/17] perf: Provide subcmd configuration at runtime
Date 2015-12-14 15:10 +0100
Message-ID <qFBZ8-7d6-11@gated-at.bofh.it> (permalink)
References <qFsMa-14g-3@gated-at.bofh.it> <qFsMa-14g-1@gated-at.bofh.it> <qFyHU-4U5-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Dec 14, 2015 at 11:33:58AM +0100, Jiri Olsa wrote:
> 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 <string.h>
> >  
> >  #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 ;-)

Sure, though if it has the config for the entire library, I'd propose a
broader name like 'subcmd_cfg'.

-- 
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v3 10/17] perf: Provide subcmd configuration at runtime Josh Poimboeuf <jpoimboe@redhat.com> - 2015-12-14 05:20 +0100
  Re: [PATCH v3 10/17] perf: Provide subcmd configuration at runtime Jiri Olsa <jolsa@redhat.com> - 2015-12-14 11:40 +0100
    Re: [PATCH v3 10/17] perf: Provide subcmd configuration at runtime Josh Poimboeuf <jpoimboe@redhat.com> - 2015-12-14 15:10 +0100

csiph-web