Commit 29156afc authored by unknown's avatar unknown
Browse files

Support --debug/-# in instance manager.


mysql-test/mysql-test-run.pl:
  Support tracing the instance manager
server-tools/instance-manager/options.cc:
  Handle --debug/-#
server-tools/instance-manager/options.h:
  Handle --debug/-#
parent 2116b5a6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2940,6 +2940,12 @@ sub im_start($$) {
  mtr_add_arg($args, "--defaults-file=%s",
              $instance_manager->{'defaults_file'});

  if ( $opt_debug )
  {
    mtr_add_arg($args, "--debug=d:t:i:A,%s/log/im.trace",
                $opt_vardir_trace);
  }

  foreach my $opt (@{$opts})
  {
    mtr_add_arg($args, $opt);
+16 −1
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@ uint Options::port_number= DEFAULT_PORT;
char **Options::saved_argv= NULL;
/* Remember if the config file was forced */
bool Options::is_forced_default_file= 0;
#ifndef DBUG_OFF
const char *Options::default_dbug_option= "d:t:i:O,im.trace";
#endif

/*
  List of options, accepted by the instance manager.
@@ -88,6 +91,12 @@ static struct my_option my_long_options[] =
  { "help", '?', "Display this help and exit.",
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },

#ifndef DBUG_OFF
  {"debug", '#', "Debug log.",
   (gptr*) &Options::default_dbug_option, (gptr*) &Options::default_dbug_option,
   0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif

  { "log", OPT_LOG, "Path to log file. Used only with --run-as-service.",
    (gptr *) &Options::log_file_name, (gptr *) &Options::log_file_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
@@ -226,7 +235,7 @@ C_MODE_START
static my_bool
get_one_option(int optid,
               const struct my_option *opt __attribute__((unused)),
               char *argument __attribute__((unused)))
               char *argument)
{
  switch(optid) {
  case 'V':
@@ -238,6 +247,12 @@ get_one_option(int optid,
  case '?':
    usage();
    exit(0);
  case '#':
#ifndef DBUG_OFF
    DBUG_SET(argument ? argument : Options::default_dbug_option);
    DBUG_SET_INITIAL(argument ? argument : Options::default_dbug_option);
#endif
    break;
  }
  return 0;
}
+4 −0
Original line number Diff line number Diff line
@@ -51,6 +51,10 @@ struct Options
  /* argv pointer returned by load_defaults() to be used by free_defaults() */
  static char **saved_argv;

#ifndef DBUG_OFF
  static const char *default_dbug_option;
#endif

  int load(int argc, char **argv);
  void cleanup();
#ifdef __WIN__