=head1 NAME B - Enable or disable the trace facilities for xCAT. (Only supports Linux Operating System) B { [B<-f enable|disable> [B<-c configuration file | subroutine list>]] | [ B<-d enable |disable>]} =head1 DESCRIPTION xCAT offers two trace facilities to debug the xCAT: =over 3 =item * B Display the calling trace for subroutine when it is called. The trace message includes: The name of the called subroutine; The arguments which passed to the called subroutine; The calling stack of the subroutine. By default, the trace will be enabled to all the subroutines in the xcatd and plugin modules. The target subroutine can be configured by configuration file or through xcatdebug command line. The flag B<-c> is used to specify the subroutine list for B, it can only work with B<-f>. The value of B<-c> can be a configuration file or a subroutine list. B: a file contains multiple lines of B B: B|B|... B: is the element for the B<-c> to specify the subroutine list. The format of B: [plugin](subroutine1,subroutine2,...) If ignoring the [plugin], the subroutines in the () should be defined in the xcatd. e.g. (daemonize,do_installm_service,do_udp_service) Otherwise, the package name of the plugin should be specified. e.g. xCAT::Utils(isMN,Version) e.g. xCAT_plugin::DBobjectdefs(defls,process_request) The trace log will be written to /var/log/xcat/subcallingtrace. The log file subcallingtrace will be backed up for each running of the B. =item * B The trace log code is presented as comments in the code of xCAT. In general mode, it will be kept as comments. But in debug mode, it will be commented back as common code to display the trace log. NOTE: This facility can be enabled by pass the B global variable when running the xcatd. e.g. ENABLE_TRACE_CODE=1 xcatd -f This facility offers two formats for the trace log code: =over 2 =item * Trace section ## TRACE_BEGIN # print "In the debug\n"; ## TRACE_END =item * Trace in a single line ## TRACE_LINE print "In the trace line\n"; =back The B can be added in xcatd and plugin modules. But following section has been added into the BEGIN {} section of the target plugin module to enable the facility. if (defined $ENV{ENABLE_TRACE_CODE}) { use xCAT::Enabletrace qw(loadtrace filter); loadtrace(); } =back =head1 OPTIONS =over 6 =item B<-f> Enable or disable the B. For B, if ignoring the B<-c> flag, all the subroutines in the xcatd and plugin modules will be enabled. For B, all the subroutines which has been enabled by B<-f enable> will be disabled. B<-c> will be ignored. =item B<-c> Specify the configuration file or subroutine list. =over 2 =item * B: a file contains multiple lines of B e.g. (plugin_command) xCAT_plugin::DBobjectdefs(defls,process_request) xCAT::DBobjUtils(getobjdefs) =item * B: a string like B|B|... e.g. "(plugin_command)|xCAT_plugin::DBobjectdefs(defls,process_request)|xCAT::DBobjUtils(getobjdefs)" =back =item B<-d> Enable or disable the B. Note: The xcatd will be restarted for the performing of B<-d>. =back =head1 EXAMPLES =over 4 =item 1 Enable the B for all the subroutines in the xcatd and plugin modules. B -f enable =item 2 Enable the B for the subroutines configured in the /opt/xcat/share/xcat/tools/tracelevel0 B -f enable -c /opt/xcat/share/xcat/tools/tracelevel0 =item 3 Enable the B for the plugin_command in xcatd and defls,process_request in the xCAT_plugin::DBobjectdefs module. B -f enable -c "xCAT_plugin::DBobjectdefs(defls,process_request)|(plugin_command)" =item 4 Disable the B for all the subroutines which have been enabled by B. B -f disable =item 5 Enable the B B -d enable =item 6 Enable both the B and B B -f enable -c /opt/xcat/share/xcat/tools/tracelevel0 -d enable =back