Skip to content

Commit e29c51d

Browse files
committed
initviz: add --xscale command line option
Defaults to 5.0, same as interactive mode. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 71b02ea commit e29c51d

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

initviz/batch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ def render(writer, trace, app_options, filename):
3434
writer.error ("Unknown format '%s'." % fmt)
3535
return 10
3636

37+
# Get xscale from options, defaulting to 5.0 to match interactive mode
38+
xscale = getattr(app_options, 'xscale', 5.0)
39+
3740
make_surface, write_surface = handlers[fmt]
3841
options = RenderOptions (app_options)
39-
(w, h) = draw.extents (options, 1.0, trace)
42+
(w, h) = draw.extents (options, xscale, trace)
4043
w = max (w, draw.MIN_IMG_W)
4144
surface = make_surface (w, h)
4245
ctx = cairo.Context (surface)
43-
draw.render (ctx, options, 1.0, trace)
46+
draw.render (ctx, options, xscale, trace)
4447
write_surface (surface)
4548
writer.status ("bootchart written to '%s'" % filename)
4649

initviz/main.py.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def _mk_options_parser():
6464
"To create a single annotation when any one of a set of processes is started, use commas to separate the names")
6565
parser.add_option("--annotate-file", dest="annotate_file", metavar="FILENAME", default=None,
6666
help="filename to write annotation points to")
67+
parser.add_option("--xscale", dest="xscale", type="float", metavar="SCALE", default=5.0,
68+
help="timeline scale factor (default: 5.0, same as interactive mode)")
6769
return parser
6870

6971
class Writer:

0 commit comments

Comments
 (0)