Add -p option when flush coverage
This is to enable flush coverage from select process on the device by process id: $ acov-llvm.py flush -p [list of process pids] Change-Id: I14cf30c80f6d1f7faa0d23f752994f0172ee3ce5
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
# 3. Flush coverage
|
# 3. Flush coverage
|
||||||
# from select daemons and system processes on the device
|
# from select daemons and system processes on the device
|
||||||
# $ acov-llvm.py flush [list of process names]
|
# $ acov-llvm.py flush [list of process names]
|
||||||
|
# $ acov-llvm.py flush -p [list of process pids]
|
||||||
# or from all processes on the device:
|
# or from all processes on the device:
|
||||||
# $ acov-llvm.py flush
|
# $ acov-llvm.py flush
|
||||||
#
|
#
|
||||||
@@ -156,6 +157,9 @@ def do_flush(args):
|
|||||||
if args.procnames:
|
if args.procnames:
|
||||||
pids = adb_shell(['pidof'] + args.procnames, text=True).split()
|
pids = adb_shell(['pidof'] + args.procnames, text=True).split()
|
||||||
logging.info(f'flushing coverage for pids: {pids}')
|
logging.info(f'flushing coverage for pids: {pids}')
|
||||||
|
elif args.pids:
|
||||||
|
pids = args.pids
|
||||||
|
logging.info(f'flushing coverage for pids: {pids}')
|
||||||
else:
|
else:
|
||||||
pids = None
|
pids = None
|
||||||
logging.info('flushing coverage for all processes on device')
|
logging.info('flushing coverage for all processes on device')
|
||||||
@@ -222,6 +226,13 @@ def parse_args():
|
|||||||
nargs='*',
|
nargs='*',
|
||||||
metavar='PROCNAME',
|
metavar='PROCNAME',
|
||||||
help='flush coverage for one or more processes with name PROCNAME')
|
help='flush coverage for one or more processes with name PROCNAME')
|
||||||
|
flush.add_argument(
|
||||||
|
'-p',
|
||||||
|
'--pids',
|
||||||
|
nargs='+',
|
||||||
|
metavar='PROCID',
|
||||||
|
required=False,
|
||||||
|
help='flush coverage for one or more processes with name PROCID')
|
||||||
flush.set_defaults(func=do_flush)
|
flush.set_defaults(func=do_flush)
|
||||||
|
|
||||||
report = subparsers.add_parser(
|
report = subparsers.add_parser(
|
||||||
|
|||||||
Reference in New Issue
Block a user