diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2017-04-30 07:12:26 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2017-04-30 07:12:26 -0400 |
| commit | 0a9701c7be2ef0256bb434d01a9261d9b345bdc6 (patch) | |
| tree | 82c03f87cfd919dc0f2f7b5f6f326868594a1526 | |
| parent | 94524ed4ce3560d765fb8b4e6d3a2ebec69dfbc2 (diff) | |
st_draw: add -q (start on quantum) support
| -rwxr-xr-x | st-draw | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -50,6 +50,10 @@ def parse_args(): | |||
| 50 | parser.add_argument('-r', '--relative', action='store_true', | 50 | parser.add_argument('-r', '--relative', action='store_true', |
| 51 | help='interpret -f/-u options relative to system release') | 51 | help='interpret -f/-u options relative to system release') |
| 52 | 52 | ||
| 53 | parser.add_argument('-q', '--start-on-multiple', metavar='QUANTUM', | ||
| 54 | type=float, default=None, dest='quantum', | ||
| 55 | help='let the schedule start on an integer multiple of QUANTUM') | ||
| 56 | |||
| 53 | parser.add_argument('-v', '--verbose', action='store_true', default=False, | 57 | parser.add_argument('-v', '--verbose', action='store_true', default=False, |
| 54 | help='output some information while drawing') | 58 | help='output some information while drawing') |
| 55 | 59 | ||
| @@ -114,6 +118,10 @@ def main(args=sys.argv[1:]): | |||
| 114 | else: | 118 | else: |
| 115 | opts.start = trace.earliest_event_time | 119 | opts.start = trace.earliest_event_time |
| 116 | 120 | ||
| 121 | if opts.quantum: | ||
| 122 | q = ms2ns(opts.quantum) | ||
| 123 | opts.start = (int(opts.start) // int(q)) * q | ||
| 124 | |||
| 117 | if not opts.end: | 125 | if not opts.end: |
| 118 | if opts.start and opts.length: | 126 | if opts.start and opts.length: |
| 119 | opts.end = opts.start + ms2ns(opts.length) | 127 | opts.end = opts.start + ms2ns(opts.length) |
