From bf4b4c29c372061293a5e563cd9e3be4a2015691 Mon Sep 17 00:00:00 2001 From: Filipe Rodrigues Date: Thu, 1 Jun 2023 14:43:42 +0100 Subject: [PATCH] Added `point-size` argument for `page-migrations` graph. --- ftmemsim-graphs/src/args.rs | 4 ++++ ftmemsim-graphs/src/main.rs | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ftmemsim-graphs/src/args.rs b/ftmemsim-graphs/src/args.rs index f829386..302cab8 100644 --- a/ftmemsim-graphs/src/args.rs +++ b/ftmemsim-graphs/src/args.rs @@ -36,6 +36,10 @@ pub enum SubCmd { /// Output #[clap(flatten)] output: ArgsOutputFile, + + /// Point size + #[clap(long = "point-size", default_value_t = 0.2)] + point_size: f64, }, /// Creates a histogram of page migrations diff --git a/ftmemsim-graphs/src/main.rs b/ftmemsim-graphs/src/main.rs index 58abe58..e1819ec 100644 --- a/ftmemsim-graphs/src/main.rs +++ b/ftmemsim-graphs/src/main.rs @@ -33,7 +33,11 @@ fn main() -> Result<(), anyhow::Error> { // Then check the sub-command match args.sub_cmd { - args::SubCmd::PageMigrations { input_file, output } => { + args::SubCmd::PageMigrations { + input_file, + output, + point_size, + } => { // Parse the input file let data = self::read_data(&input_file)?; @@ -100,7 +104,7 @@ fn main() -> Result<(), anyhow::Error> { PlotOption::Caption("Page migrations (Allocation)"), PlotOption::Color("black"), PlotOption::PointSymbol('O'), - PlotOption::PointSize(0.2), + PlotOption::PointSize(point_size), ]) .points( points_migration_to_faster.iter().map(|p| p.x), @@ -109,7 +113,7 @@ fn main() -> Result<(), anyhow::Error> { PlotOption::Caption("Page migrations (Migrations to faster)"), PlotOption::Color("green"), PlotOption::PointSymbol('O'), - PlotOption::PointSize(0.2), + PlotOption::PointSize(point_size), ], ) .points( @@ -119,7 +123,7 @@ fn main() -> Result<(), anyhow::Error> { PlotOption::Caption("Page migrations (Migrations to slower)"), PlotOption::Color("red"), PlotOption::PointSymbol('O'), - PlotOption::PointSize(0.2), + PlotOption::PointSize(point_size), ], ) .set_x_label("Time (normalized)", &[])