Convert sort choice string to SORT_MODE constant.
(sort_choice)
| 547 | |
| 548 | |
| 549 | def _sort_to_mode(sort_choice): |
| 550 | """Convert sort choice string to SORT_MODE constant.""" |
| 551 | sort_map = { |
| 552 | "nsamples": SORT_MODE_NSAMPLES, |
| 553 | "tottime": SORT_MODE_TOTTIME, |
| 554 | "cumtime": SORT_MODE_CUMTIME, |
| 555 | "sample-pct": SORT_MODE_SAMPLE_PCT, |
| 556 | "cumul-pct": SORT_MODE_CUMUL_PCT, |
| 557 | "nsamples-cumul": SORT_MODE_NSAMPLES_CUMUL, |
| 558 | "name": -1, |
| 559 | } |
| 560 | return sort_map.get(sort_choice, SORT_MODE_NSAMPLES) |
| 561 | |
| 562 | def _create_collector(format_type, sample_interval_usec, skip_idle, opcodes=False, |
| 563 | output_file=None, compression='auto', diff_baseline=None): |
no test coverage detected
searching dependent graphs…