mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-07 02:07:39 +02:00
Support parallelism on CLI.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user