def select_and_ignore_config_desc(key: str) -> ConfigDescription: return { Config.group_map(key): { 'group': 'select' }, f'{key}.select': { 'help': f'{key.capitalize()}(s) to process; otherwise all not ignored', 'metavar': 'NAME', 'default': [], 'argparse': { 'alias': [f'--{key}'], }, 'postprocess': postprocess_selections }, f'{key}.select-all': { 'help': f'Select all {key}s', 'default': False, }, key + '.ignore': { 'help': f'{key.capitalize()}(s) to ignore', 'metavar': 'NAME', 'default': [], }, f'{key}.ignore-all': { 'help': f'Ignore all {key}s unless explicitly selected', 'default': False, }, }
'default': [], 'argparse': { 'alias': ['--prefix', '--strip-prefix'], 'action': 'append', } }, } CONFIG: ConfigDescription = { Config.group_def('input'): { 'title': 'input options', }, Config.group_def('tool'): { 'title': 'external tool options', }, Config.group_map('collect'): { 'group': 'input' }, **memdf.collector.bloaty.CONFIG, **memdf.collector.csv.CONFIG, **memdf.collector.elftools.CONFIG, **memdf.collector.readelf.CONFIG, 'collect.method': { 'help': 'Method of input processing', 'metavar': 'METHOD', 'choices': ['elftools', 'readelf', 'bloaty', 'csv', 'tsv', 'su'], 'default': 'elftools', 'argparse': { 'alias': ['-f'], }, },
from typing import (Any, Callable, Dict, List, Mapping, IO, Optional, Protocol, Sequence, Union) import cxxfilt # type: ignore import pandas as pd # type: ignore import memdf.df import memdf.select import memdf.util.pretty from memdf import Config, ConfigDescription, DF, DFs from memdf.util.config import ParseSizeAction REPORT_DEMANGLE_CONFIG: ConfigDescription = { Config.group_map('report'): { 'group': 'output' }, 'report.demangle': { 'help': 'Demangle C++ symbol names', 'default': False, 'argparse': { 'alias': ['--demangle', '-C'], 'action': 'store_true', }, }, } REPORT_LIMIT_CONFIG: ConfigDescription = { Config.group_map('report'): { 'group': 'output'
import datetime import logging import sys from typing import cast, Dict, List, Mapping, Optional, Tuple import pandas as pd # type: ignore import memdf.report import memdf.util.config import memdf.util.sqlite from memdf.sizedb import SizeDatabase from memdf import Config QUERY_CONFIG = { Config.group_map('query'): { 'group': 'output' }, 'report.increases': { 'help': 'Highlight large increases', 'metavar': 'PERCENT', 'default': 0.0, 'argparse': { 'alias': ['--threshold'], 'type': float, }, }, 'query.where': { 'help': 'SQL filter', 'metavar': 'SQL-EXPR', 'default': '',