149 parser = argparse.ArgumentParser()
151 'pdf_path', help=
'test case to measure load and rendering time')
154 default=os.path.join(
'out',
'Release'),
155 help=
'relative path to the build directory with '
159 default=CALLGRIND_PROFILER,
160 help=
'which profiler to use. Supports callgrind, '
161 'perfstat, and none.')
163 '--interesting-section',
165 help=
'whether to measure just the interesting section or '
166 'the whole test harness. The interesting section is '
167 'pdfium reading a pdf from memory and rendering '
168 'it, which omits loading the time to load the file, '
169 'initialize the library, terminate it, etc. '
170 'Limiting to only the interesting section does not '
171 'work on Release since the delimiters are optimized '
172 'out. Callgrind only.')
176 help=
'outputs a png image on the same location as the '
180 help=
'selects some pages to be rendered. Page numbers '
181 'are 0-based. "--pages A" will render only page A. '
182 '"--pages A-B" will render pages A to B '
185 '--output-path', help=
'where to write the profile data output file')
186 args = parser.parse_args()
188 if args.interesting_section
and args.profiler != CALLGRIND_PROFILER:
189 PrintErr(
'--interesting-section requires profiler to be callgrind.')