Ejemplo n.º 1
0
def main():
    parser = argparse.ArgumentParser(description=__doc__,
        formatter_class=argparse.RawDescriptionHelpFormatter)

    parser.add_argument('--minimize', '-m', dest='minimize_memory_usage',
        action='store_true', default=False,
        help='Minimize memory usage before collecting the memory reports.')

    parser.add_argument('--directory', '-d', dest='output_directory',
        action='store', metavar='DIR',
        help=textwrap.dedent('''\
            The directory to store the reports in.  By default, we'll store the
            reports in the directory about-memory-N, for some N.'''))

    parser.add_argument('--leave-on-device', '-l', dest='leave_on_device',
        action='store_true', default=False,
        help='Leave the reports on the device after pulling them.')

    parser.add_argument('--no-auto-open', '-o', dest='open_in_firefox',
        action='store_false', default=True,
        help=textwrap.dedent("""\
            By default, we try to open the memory report we fetch in Firefox.
            Specify this option prevent this."""))

    parser.add_argument('--keep-individual-reports',
        dest='keep_individual_reports',
        action='store_true', default=False,
        help=textwrap.dedent('''\
            Don't delete the individual memory reports which we merge to create
            the memory-reports file.  You shouldn't need to pass this parameter
            except for debugging.'''))

    gc_log_group = parser.add_mutually_exclusive_group()

    gc_log_group.add_argument('--no-gc-cc-log',
        dest='get_gc_cc_logs',
        action='store_false',
        default=True,
        help="Don't get a gc/cc log.")

    gc_log_group.add_argument('--abbreviated-gc-cc-log',
        dest='abbreviated_gc_cc_log',
        action='store_true',
        default=False,
        help='Get an abbreviated GC/CC log, instead of a full one.')

    parser.add_argument('--no-dmd', action='store_true', default=False,
        help='''Don't process DMD logs, even if they're available.''')

    dmd_group = parser.add_argument_group('optional DMD args (passed to fix_b2g_stack)',
        textwrap.dedent('''\
            You only need to worry about these options if you're running DMD on
            your device.  These options get passed to fix_b2g_stack.'''))
    fix_b2g_stack.add_argparse_arguments(dmd_group)

    args = parser.parse_args()
    get_and_show_info(args)
Ejemplo n.º 2
0
        default=False,
        help='Leave the reports on the device after pulling them.')

    parser.add_argument('--no-auto-open',
                        '-o',
                        dest='open_in_firefox',
                        action='store_false',
                        default=True,
                        help=textwrap.dedent("""\
            By default, we try to open the memory report we fetch in Firefox.
            Specify this option prevent this."""))

    parser.add_argument('--keep-individual-reports',
                        dest='keep_individual_reports',
                        action='store_true',
                        default=False,
                        help=textwrap.dedent('''\
            Don't delete the individual memory reports which we merge to create
            the memory-reports file.  You shouldn't need to pass this parameter
            except for debugging.'''))

    dmd_group = parser.add_argument_group(
        'optional DMD args (passed to fix_b2g_stack)',
        textwrap.dedent('''\
            You only need to worry about these options if you're running DMD on
            your device.  These options get passed to fix_b2g_stack.'''))
    fix_b2g_stack.add_argparse_arguments(dmd_group)

    args = parser.parse_args()
    get_and_show_dump(args)
Ejemplo n.º 3
0
    gc_log_group = parser.add_mutually_exclusive_group()

    gc_log_group.add_argument(
        "--no-gc-cc-log", dest="get_gc_cc_logs", action="store_false", default=True, help="Don't get a gc/cc log."
    )

    gc_log_group.add_argument(
        "--abbreviated-gc-cc-log",
        dest="abbreviated_gc_cc_log",
        action="store_true",
        default=False,
        help="Get an abbreviated GC/CC log, instead of a full one.",
    )

    parser.add_argument(
        "--no-dmd", action="store_true", default=False, help="""Don't process DMD logs, even if they're available."""
    )

    dmd_group = parser.add_argument_group(
        "optional DMD args (passed to fix_b2g_stack)",
        textwrap.dedent(
            """\
            You only need to worry about these options if you're running DMD on
            your device.  These options get passed to fix_b2g_stack."""
        ),
    )
    fix_b2g_stack.add_argparse_arguments(dmd_group)

    args = parser.parse_args()
    get_and_show_info(args)