Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select runs to plot in reprounzip-graph #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions reprounzip/reprounzip/unpackers/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def parse_levels(level_pkgs, level_processes, level_other_files):
return level_pkgs, level_processes, level_other_files, file_depth


def read_events(database, all_forks, has_thread_flag):
def read_events(database, all_forks, selected_runs, has_thread_flag):
# In here, a file is any file on the filesystem. A binary is a file, that
# gets executed. A process is a system-level task, identified by its pid
# (pids don't get reused in the database).
Expand Down Expand Up @@ -421,7 +421,8 @@ def format_argv(argv):
return "%s ..." % argv[0]


def generate(target, configfile, database, all_forks=False, graph_format='dot',
def generate(target, configfile, database, selected_runs=None,
all_forks=False, graph_format='dot',
level_pkgs='file', level_processes='thread',
level_other_files='all',
regex_filters=None, regex_replaces=None, aggregates=None):
Expand Down Expand Up @@ -449,7 +450,7 @@ def generate(target, configfile, database, all_forks=False, graph_format='dot',
for n, f in iteritems(config.inputs_outputs))
has_thread_flag = config.format_version >= LooseVersion('0.7')

runs, files, edges = read_events(database, all_forks,
runs, files, edges = read_events(database, all_forks, selected_runs,
has_thread_flag)

# Label the runs
Expand Down Expand Up @@ -680,9 +681,10 @@ def graph(args):
format or JSON.
"""
def call_generate(args, config, trace):
generate(Path(args.target[0]), config, trace, args.all_forks,
args.format, args.packages, args.processes, args.otherfiles,
args.regex_filter, args.regex_replace, args.aggregate)
generate(Path(args.target[0]), config, trace, args.runs,
args.all_forks, args.format, args.packages, args.processes,
args.otherfiles, args.regex_filter, args.regex_replace,
args.aggregate)

if args.pack is not None:
rpz_pack = RPZPack(args.pack)
Expand Down Expand Up @@ -737,6 +739,7 @@ def setup(parser, **kwargs):
const='dot', default='dot',
help="Set the output format to DOT (this is the "
"default)")
parser.add_argument('--runs', help="Which runs to plot")
parser.add_argument('--json', action='store_const', dest='format',
const='json', help="Set the output format to JSON")
parser.add_argument(
Expand Down