From 107ab6e261e5a3b5c828eb0342e3bacac11eafa6 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Mar 12 2019 19:51:30 +0000 Subject: trace_plot: Compute min, max, mean. Tidy up the variables and compute min, max, mean from the allocation data and use that in the plot. --- diff --git a/trace_plot.m b/trace_plot.m index cc98037..b549251 100644 --- a/trace_plot.m +++ b/trace_plot.m @@ -23,20 +23,20 @@ close all; # memory the simulator was using at startup before the simulation was started, # therefore we must subtract this value from the loaded vmsize and vmrss to get # something that we can compare to the idealized RSS. -bias=67071483904; +bias=15556608; # Size of pages, used for converting page count values e.g. vmsize, vmrss. pagesz = 4096; # Downsampling ratio: The number of events that are collapsed into one. # e.g. 1000000:1 means a mllion events are downsampled into one final event # to simplify data analysis. -down_sample_ratio = 1000000; +down_sample_ratio = 100; # Location of all the reuqired data files: -path = "/path/to/trace/"; -allocs_file = [path "uw1_ds1M_allocs.log"]; -ideal_rss_file = [path "uw1_ds1M_ideal_rss.log"]; -vmsize_file = [path "uw1_ds1M_vmsize.log"]; -vmrss_file = [path "uw1_ds1M_vmrss.log"]; -binned_allocs_file = [path "uw1_binned_allocs.log"]; +path = "/home/carlos/support/fluentd2/"; +allocs_file = [path "fdw1_ds100_allocs.log"]; +ideal_rss_file = [path "fdw1_ds100_ideal_RSS.log"]; +vmsize_file = [path "fdw1_ds100_VmSize.log"]; +vmrss_file = [path "fdw1_ds100_VmRSS.log"]; +binned_allocs_file = [path "fdw1_binned_allocs.log"]; # Load data using normal loader into standard names for plotting and processing. data_allocs = load (allocs_file); @@ -53,6 +53,10 @@ idx_max = 2; idx_mean = 3; idx_val = 4; +data_allocs_min = min (data_allocs(:,idx_min)); +data_allocs_max = max (data_allocs(:,idx_max)); +data_allocs_mean = mean (data_allocs(:,idx_mean)); + # Default graphing parameters: plot_line_width=4; tick_line_width=2; @@ -64,6 +68,7 @@ figure_height = 1024; plot1_legend_loc = "northeast"; plot2_legend_loc = "southeast"; +################################################################################ # Plot 1: # Plot the allocation sizes as a function of event tick time (not real time). set(0, 'defaulttextfontsize', font_size) @@ -72,9 +77,6 @@ figure (1, "Position", [figure_x, figure_y, figure_width, figure_height]); plot (data_allocs, 'o', 'linewidth', plot_line_width); h=get(gcf, "currentaxes"); set(h, "fontsize", font_size, "linewidth", plot_line_width); -data_allocs_min = 1; -data_allocs_max = 27378856; -data_allocs_mean = 69; min_str = sprintf ("Min: %lu byte(s)", data_allocs_min); max_str = sprintf ("Max: %lu bytes", data_allocs_max); mean_str = sprintf ("Mean: %lu bytes", data_allocs_mean); @@ -117,10 +119,13 @@ hold on; plot (ax(1), x, data_ideal_rss(:,idx_mean), "color", "black", 'linewidth', plot_line_width); h=get(gcf, "currentaxes"); set(h, "fontsize", font_size, "linewidth", tick_line_width); -legend ("Ideal RSS Size", "RSS Size", "Virtual Address Size", "location", plot2_legend_loc); +# Set the legend for the current plots in the following order: +# ax(1) - RSS and Ideal RSS in that order. +# ax(2) - Virtual address size. +legend ("RSS Size", "Ideal RSS Size", "Virtual Address Size", "location", plot2_legend_loc); # Linear regression of mean Ideal RSS samples. block_start = 1000; -block_end = 24000; +block_end = 600000; y = data_ideal_rss(block_start:block_end,4); m = block_end - block_start + 1; x = linspace (block_start, block_end, m); @@ -131,7 +136,7 @@ plot(X(:,2), X*theta_ideal_rss, '-', "color", "green", 'linewidth', plot_line_wi # Linear regression of mean Real RSS samples. block_start = 1000; -block_end = 24000; +block_end = 600000; y = data_vmrss(block_start:block_end,4) * 4096 - bias; m = block_end - block_start + 1; x = linspace (block_start, block_end, m); @@ -165,9 +170,10 @@ legend ("RSS Size", "Ideal RSS Size", "location", plot2_legend_loc); ################################################################################ endif - hold off; - +################################################################################ +# Plot 3: +# Plot the distribution of sizes. data_binned_allocs_sorted = sortrows (data_binned_allocs); figure (3, "Position", [0,0,1024,1024]); loglog (data_binned_allocs_sorted(:,1),data_binned_allocs_sorted(:,2), 'o', "linewidth", plot_line_width); @@ -180,3 +186,4 @@ set(gca, "xticklabel", sprintf ('%1.0e|', xt)); title ("Allocation Size Distribution"); xlabel ("Allocation Size (bytes)"); ylabel ("Number of allocations"); +################################################################################