Exemple #1
0
 def error_check(self, options):
     StatMergerArgs.error_check(self, options)
     if options["high"] != -1:
         options["high"] += 1
         high_rank = options["high"]  # use this for all tasks we can't find the rank of
     new_loglevel = init_logging(options["loglevel"], options["logfile"])  # Initialize the logging module
     options["loglevel"] = new_loglevel
Exemple #2
0
 def error_check(self, options):
     StatMergerArgs.error_check(self, options)
     if options["high"] != -1:
         options["high"] += 1
         high_rank = options["high"] # use this for all tasks we can't find the rank of
     new_loglevel = init_logging(options["loglevel"], options["logfile"])    #Initialize the logging module
     options["loglevel"] = new_loglevel
Exemple #3
0
 def error_check(self, options):
     if options["exe"] == "NULL":
         sys.stderr.write('\nYou must specify an executable with the -x or --exe= options\n')
         self.print_usage()
     if not os.path.exists(options["exe"]):
         sys.stderr.write('\nFailed to find executable "%s".\n' % options["exe"])
         self.print_usage()
     StatMergerArgs.error_check(self, options)
Exemple #4
0
 def error_check(self, options):
     if options["exe"] == "NULL":
         sys.stderr.write('\nYou must specify an executable with the -x or --exe= options\n')
         self.print_usage()
     if not os.path.exists(options["exe"]):
         sys.stderr.write('\nFailed to find executable "%s".\n' % options["exe"])
         self.print_usage()
     StatMergerArgs.error_check(self, options)
Exemple #5
0
    def __init__(self):
        StatMergerArgs.__init__(self)

        self.arg_map["output"] = StatMergerArgs.StatMergerArgElement(
            "o", True, str, "coredump.dot", "the output filename"
        )
        self.arg_map["pattern"] = StatMergerArgs.StatMergerArgElement(
            "p", True, str, "^core.[0-9]+$", "the core file regex pattern"
        )
        self.arg_map["directory"] = StatMergerArgs.StatMergerArgElement(
            "d", True, str, os.getcwd(), "the output directory"
        )
        self.arg_map["coredir"] = StatMergerArgs.StatMergerArgElement(
            "D", True, str, os.getcwd(), "the core file directory"
        )
        self.arg_map["exedir"] = StatMergerArgs.StatMergerArgElement(
            "e", True, str, os.getcwd(), "the exe file directory"
        )
        self.arg_map["sourcepath"] = StatMergerArgs.StatMergerArgElement(
            "s", True, str, os.getcwd(), "the source file directory"
        )
        self.arg_map["objectpath"] = StatMergerArgs.StatMergerArgElement(
            "O", True, str, os.getcwd(), "the object file directory"
        )
        self.arg_map["loglevel"] = StatMergerArgs.StatMergerArgElement(
            "L", True, str, "error", "the verbosity level (critical|error|warning|info|verbose|debug|insane)"
        )
        self.arg_map["logfile"] = StatMergerArgs.StatMergerArgElement(
            "F", True, str, "stdout", "the log file name (defaults to stdout)"
        )
        self.arg_map["withline"] = StatMergerArgs.StatMergerArgElement(
            "i", False, int, 0, "whether to gather source line number"
        )
        self.arg_map["force"] = StatMergerArgs.StatMergerArgElement(
            "r", False, int, 0, "whether to force parsing on warnings and errors"
        )
        self.arg_map["threads"] = StatMergerArgs.StatMergerArgElement("T", False, int, 1, "max number of threads")

        self.arg_map["jobid"] = self.StatMergerArgElement(
            "j", False, None, None, "[LW] delineate traces based on Job ID in the core file"
        )
        self.arg_map["exe"] = StatMergerArgs.StatMergerArgElement("x", True, str, "NULL", "[LW] the executable path")
        self.arg_map["addr2line"] = StatMergerArgs.StatMergerArgElement(
            "a", True, str, "NULL", "[LW] the path to addr2line"
        )

        self.usage_msg_synopsis = '\nThis tool will merge the stack traces from the user-specified core files and output 2 .dot files, one with just function names, the other with function names + line number information\n\nNOTE: for lightweight core files, the -x option is required and the -x option is ignored for full core files.  Options marked with "[LW]" are for lightweight core files\n'
        self.usage_msg_command = (
            "\nUSAGE:\n\t(LW only) python %s [options] -x <exe_path> -c <corefile>*\n\t(LW only) python %s [options] -x <exe_path> -c <core_files_dir>\n\tpython %s [options] -c <corefile>*\n"
            % (sys.argv[0], sys.argv[0], sys.argv[0])
        )
        self.usage_msg_examples = (
            "\nEXAMPLES:\n\t(LW only) python %s -x a.out -c core.0 core.1\n\t(LW only) python %s -x a.out -c core.*\n\t(LW only) python %s -x a.out -c ./\n\t(LW only) python %s -x a.out -c core_dir\n\tpython %s -c *.core\n"
            % (sys.argv[0], sys.argv[0], sys.argv[0], sys.argv[0], sys.argv[0])
        )
Exemple #6
0
    def __init__(self):
        StatMergerArgs.__init__(self)

        # add the -j --jobid option to prefix traces with job ID
        self.arg_map["jobid"] = self.StatMergerArgElement("j", False, None, None, "delineate traces based on Job ID in the core file")

        # add an agrument type to take the application executable path
        self.arg_map["exe"] = StatMergerArgs.StatMergerArgElement("x", True, str, "NULL", "the executable path")

        # add an agrument type to take the application executable path
        self.arg_map["addr2line"] = StatMergerArgs.StatMergerArgElement("a", True, str, "NULL", "the path to addr2line")

        # override the usage messages:
        self.usage_msg_synopsis = '\nThis tool will merge the stack traces from the user specified lightweight core files and output 2 .dot files, one with just function names, the other with function names + line number information\n'
        self.usage_msg_command = '\nUSAGE:\n\tpython %s [options] -x <exe_path> -c <corefile>*\n\tpython tracer_merge.py [options] -x <exe_path> -c <core_files_dir>\n' % (sys.argv[0])
        self.usage_msg_examples = '\nEXAMPLES:\n\tpython %s -x a.out -c core.0 core.1\n\tpython %s -x a.out -c core.*\n\tpython %s -x a.out -c ./\n\tpython %s -x a.out -c core_dir\n' % (sys.argv[0], sys.argv[0], sys.argv[0], sys.argv[0])
Exemple #7
0
    def __init__(self):
        StatMergerArgs.__init__(self)

        # add the -j --jobid option to prefix traces with job ID
        self.arg_map["jobid"] = self.StatMergerArgElement("j", False, None, None, "delineate traces based on Job ID in the core file")

        # add an agrument type to take the application executable path
        self.arg_map["exe"] = StatMergerArgs.StatMergerArgElement("x", True, str, "NULL", "the executable path")

        # add an agrument type to take the application executable path
        self.arg_map["addr2line"] = StatMergerArgs.StatMergerArgElement("a", True, str, "NULL", "the path to addr2line")

        # override the usage messages:
        self.usage_msg_synopsis = '\nThis tool will merge the stack traces from the user-specified lightweight core files and output 2 .dot files, one with just function names, the other with function names + line number information\n'
        self.usage_msg_command = '\nUSAGE:\n\tpython %s [options] -x <exe_path> -c <corefile>*\n\tpython tracer_merge.py [options] -x <exe_path> -c <core_files_dir>\n' % (sys.argv[0])
        self.usage_msg_examples = '\nEXAMPLES:\n\tpython %s -x a.out -c core.0 core.1\n\tpython %s -x a.out -c core.*\n\tpython %s -x a.out -c ./\n\tpython %s -x a.out -c core_dir\n' % (sys.argv[0], sys.argv[0], sys.argv[0], sys.argv[0])
Exemple #8
0
    def __init__(self):
        StatMergerArgs.__init__(self)

        self.arg_map["output"] = StatMergerArgs.StatMergerArgElement(
            "o", True, str, "coredump.dot", "the output filename")
        self.arg_map["pattern"] = StatMergerArgs.StatMergerArgElement(
            "p", True, str, "^core.[0-9]+$", "the core file regex pattern")
        self.arg_map["directory"] = StatMergerArgs.StatMergerArgElement(
            "d", True, str, os.getcwd(), "the output directory")
        self.arg_map["coredir"] = StatMergerArgs.StatMergerArgElement(
            "D", True, str, os.getcwd(), "the core file directory")
        self.arg_map["exedir"] = StatMergerArgs.StatMergerArgElement(
            "e", True, str, os.getcwd(), "the exe file directory")
        self.arg_map["sourcepath"] = StatMergerArgs.StatMergerArgElement(
            "s", True, str, os.getcwd(), "the source file directory")
        self.arg_map["objectpath"] = StatMergerArgs.StatMergerArgElement(
            "O", True, str, os.getcwd(), "the object file directory")
        self.arg_map["loglevel"] = StatMergerArgs.StatMergerArgElement(
            "L", True, str, "error",
            "the verbosity level (critical|error|warning|info|verbose|debug|insane)"
        )
        self.arg_map["logfile"] = StatMergerArgs.StatMergerArgElement(
            "F", True, str, "stdout", "the log file name (defaults to stdout)")
        self.arg_map["withline"] = StatMergerArgs.StatMergerArgElement(
            "i", False, int, 0, "whether to gather source line number")
        self.arg_map["force"] = StatMergerArgs.StatMergerArgElement(
            "r", False, int, 0,
            "whether to force parsing on warnings and errors")
        self.arg_map["threads"] = StatMergerArgs.StatMergerArgElement(
            "T", False, int, 1, "max number of threads")

        self.arg_map["jobid"] = self.StatMergerArgElement(
            "j", False, None, None,
            "[LW] delineate traces based on Job ID in the core file")
        self.arg_map["exe"] = StatMergerArgs.StatMergerArgElement(
            "x", True, str, "NULL", "[LW] the executable path")
        self.arg_map["addr2line"] = StatMergerArgs.StatMergerArgElement(
            "a", True, str, "NULL", "[LW] the path to addr2line")

        self.usage_msg_synopsis = '\nThis tool will merge the stack traces from the user-specified core files and output 2 .dot files, one with just function names, the other with function names + line number information\n\nNOTE: for lightweight core files, the -x option is required and the -x option is ignored for full core files.  Options marked with "[LW]" are for lightweight core files\n'
        self.usage_msg_command = '\nUSAGE:\n\t(LW only) python %s [options] -x <exe_path> -c <corefile>*\n\t(LW only) python %s [options] -x <exe_path> -c <core_files_dir>\n\tpython %s [options] -c <corefile>*\n' % (
            sys.argv[0], sys.argv[0], sys.argv[0])
        self.usage_msg_examples = '\nEXAMPLES:\n\t(LW only) python %s -x a.out -c core.0 core.1\n\t(LW only) python %s -x a.out -c core.*\n\t(LW only) python %s -x a.out -c ./\n\t(LW only) python %s -x a.out -c core_dir\n\tpython %s -c *.core\n' % (
            sys.argv[0], sys.argv[0], sys.argv[0], sys.argv[0], sys.argv[0])