diff --git a/mprof b/mprof index adfe6d4..c70eb68 100755 --- a/mprof +++ b/mprof @@ -188,9 +188,10 @@ def run_action(): parser.add_argument("--multiprocess", "-M", dest="multiprocess", action="store_true", help="""Monitors forked processes creating individual plots for each child (disables --python features)""") parser.add_argument("--output", "-o", dest="filename", - default="mprofile_.dat", - help="""File to store results in, defaults to 'mprofile_.dat', -(where is the date-time of the program start)""") + default="mprofile_%s.dat" % time.strftime("%Y%m%d%H%M%S", time.localtime()), + help="""File to store results in, defaults to 'mprofile_.dat' in the current directory, +(where is the date-time of the program start). +This file contains the process memory consumption, in Mb (one value per line).""") parser.add_argument("program", nargs=REMAINDER, help='Option 1: " ..." - profile executable\n' 'Option 2: " ..." - profile python script\n' @@ -206,16 +207,7 @@ def run_action(): print("{1}: Sampling memory every {0}s".format( args.interval, osp.basename(sys.argv[0]))) - if args.filename is None: - ## Output results in a file called "mprofile_.dat" (where - ## is the date-time of the program start) in the current - ## directory. This file contains the process memory consumption, in Mb (one - ## value per line). Memory is sampled twice each second.""" - - suffix = time.strftime("%Y%m%d%H%M%S", time.localtime()) - mprofile_output = "mprofile_%s.dat" % suffix - else: - mprofile_output = args.filename + mprofile_output = args.filename # .. TODO: more than one script as argument ? .. program = args.program