Support parallelism on CLI.

This commit is contained in:
Mike Auty
2019-08-07 11:44:29 +01:00
parent 6c23968a11
commit e3057e305d
+16
View File
@@ -98,6 +98,14 @@ class CommandLine(interfaces.plugins.FileConsumerInterface):
parser = argparse.ArgumentParser(prog = 'volatility', description = "An open-source memory forensics framework")
parser.add_argument(
"-c", "--config", help = "Load the configuration from a json file", default = None, type = str)
parser.add_argument(
"--parallelism",
help = "Enables parallelism (defaults to processes if no argument given)",
nargs = '?',
choices = ['processes', 'threads', 'off'],
const = 'processes',
default = None,
type = str)
parser.add_argument(
"-e",
"--extend",
@@ -171,6 +179,14 @@ class CommandLine(interfaces.plugins.FileConsumerInterface):
else:
console.setLevel(10 - (partial_args.verbosity - 2))
# Set the PARALLELISM
if partial_args.parallelism == 'processes':
constants.PARALLELISM = constants.PARALLELISM_MULTIPROCESSING
elif partial_args.parallelism == 'threading':
constants.PARALLELISM = constants.PARALLELISM_THREADING
else:
constants.PARALLELISM = constants.PARALLELISM_OFF
# Do the initialization
ctx = contexts.Context() # Construct a blank context
failures = framework.import_files(volatility.plugins,