aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/pm_common.h3
-rwxr-xr-xpm_data_analysis/pm_data_analyzer.py6
-rw-r--r--pm_test/pm_common.c17
-rw-r--r--pm_test/pmmodule.c8
4 files changed, 20 insertions, 14 deletions
diff --git a/include/pm_common.h b/include/pm_common.h
index ac11345..f2fcb87 100644
--- a/include/pm_common.h
+++ b/include/pm_common.h
@@ -121,7 +121,8 @@ int serialize_data_entry(char *filename, struct data_entry *samples, int num);
121int read_sdata_entry(const char *filename, struct saved_data_entry **samples); 121int read_sdata_entry(const char *filename, struct saved_data_entry **samples);
122 122
123/* get valid overhead from trace file */ 123/* get valid overhead from trace file */
124int get_valid_ovd(const char *filename, struct full_ovd_plen **full_costs); 124int get_valid_ovd(const char *filename, struct full_ovd_plen **full_costs,
125 int wss, int tss);
125 126
126/* get ovd and pm length for different cores configurations (on uma xeon) */ 127/* get ovd and pm length for different cores configurations (on uma xeon) */
127void get_ovd_plen_umaxeon(struct full_ovd_plen *full_costs, int num_samples, 128void get_ovd_plen_umaxeon(struct full_ovd_plen *full_costs, int num_samples,
diff --git a/pm_data_analysis/pm_data_analyzer.py b/pm_data_analysis/pm_data_analyzer.py
index 02c5098..f6730de 100755
--- a/pm_data_analysis/pm_data_analyzer.py
+++ b/pm_data_analysis/pm_data_analyzer.py
@@ -133,11 +133,11 @@ class Analyzer(defapp.App):
133 print "Reading '%s'" % nf 133 print "Reading '%s'" % nf
134 self.valid_ovds.add(pms.unpickl_it(nf), 'l2cache') 134 self.valid_ovds.add(pms.unpickl_it(nf), 'l2cache')
135 135
136 def process_raw_data(self, datafile): 136 def process_raw_data(self, datafile, conf):
137 coresL2 = self.options.coresL2 137 coresL2 = self.options.coresL2
138 pcpu = self.options.pcpu 138 pcpu = self.options.pcpu
139 # initialize pmmodule 139 # initialize pmmodule
140 pm.load(datafile, coresL2, pcpu) 140 pm.load(datafile, coresL2, pcpu, int(conf['wss']), int(conf['tss']))
141 ovds = Overhead() 141 ovds = Overhead()
142 # get overheads 142 # get overheads
143 ovds.add(pm.getPreemption(), 'preemption') 143 ovds.add(pm.getPreemption(), 'preemption')
@@ -273,7 +273,7 @@ class Analyzer(defapp.App):
273 readf = dname + '/' + fname 273 readf = dname + '/' + fname
274 self.read_valid_data(readf) 274 self.read_valid_data(readf)
275 else: 275 else:
276 self.process_raw_data(datafile) 276 self.process_raw_data(datafile, conf)
277 277
278 self.analyze_data(dname, conf) 278 self.analyze_data(dname, conf)
279 del self.valid_ovds 279 del self.valid_ovds
diff --git a/pm_test/pm_common.c b/pm_test/pm_common.c
index a612b20..04bb756 100644
--- a/pm_test/pm_common.c
+++ b/pm_test/pm_common.c
@@ -179,7 +179,8 @@ int read_sdata_entry(const char *filename, struct saved_data_entry **samples)
179 * samples is the size of the population 179 * samples is the size of the population
180 * cpufreq is in MHz 180 * cpufreq is in MHz
181 */ 181 */
182void print_rough_stats(unsigned long long *vector, int samples, double cpufreq) 182void print_rough_stats(unsigned long long *vector, int samples, double cpufreq,
183 int wss, int tss)
183{ 184{
184 unsigned long long min, max; 185 unsigned long long min, max;
185 long double mi, qi, num_diff; 186 long double mi, qi, num_diff;
@@ -211,8 +212,9 @@ void print_rough_stats(unsigned long long *vector, int samples, double cpufreq)
211 fprintf(stderr, "max = %llu\nmin = %llu\nmean = %Lf\nstddev = %Lf\n", 212 fprintf(stderr, "max = %llu\nmin = %llu\nmean = %Lf\nstddev = %Lf\n",
212 max, min, mi, sqrtl(qi / (samples - 2))); 213 max, min, mi, sqrtl(qi / (samples - 2)));
213 */ 214 */
214 fprintf(stderr, "# max, min, avg, stddev\n"); 215 fprintf(stderr, "# wss, tss, max, min, avg, stddev\n");
215 fprintf(stderr, "%.5f, %.5f, %.5Lf, %.5Lf\n", 216 fprintf(stderr, "%d, %d, %.5f, %.5f, %.5Lf, %.5Lf\n",
217 wss, tss,
216 max / cpufreq, min / cpufreq, mi / cpufreq, 218 max / cpufreq, min / cpufreq, mi / cpufreq,
217 sqrtl(qi / (samples - 2)) / cpufreq); 219 sqrtl(qi / (samples - 2)) / cpufreq);
218} 220}
@@ -235,7 +237,8 @@ void print_rough_stats(unsigned long long *vector, int samples, double cpufreq)
235 * output array.) 237 * output array.)
236 * If error return < 0 238 * If error return < 0
237 */ 239 */
238int get_valid_ovd(const char *filename, struct full_ovd_plen **full_costs) 240int get_valid_ovd(const char *filename, struct full_ovd_plen **full_costs,
241 int wss, int tss)
239{ 242{
240 struct saved_data_entry *samples; 243 struct saved_data_entry *samples;
241 /* total number of samples */ 244 /* total number of samples */
@@ -411,11 +414,11 @@ int get_valid_ovd(const char *filename, struct full_ovd_plen **full_costs)
411 dprintf("End of valid entries\n"); 414 dprintf("End of valid entries\n");
412#ifdef WANT_STATISTICS 415#ifdef WANT_STATISTICS
413 fprintf(stderr, "# Cold cache\n"); 416 fprintf(stderr, "# Cold cache\n");
414 print_rough_stats(valid_c_samples, c_count, CFREQ); 417 print_rough_stats(valid_c_samples, c_count, CFREQ, wss, tss);
415 fprintf(stderr, "# Hot cache\n"); 418 fprintf(stderr, "# Hot cache\n");
416 print_rough_stats(valid_h_samples, h_count, CFREQ); 419 print_rough_stats(valid_h_samples, h_count, CFREQ, wss, tss);
417 fprintf(stderr, "# After preemption\n"); 420 fprintf(stderr, "# After preemption\n");
418 print_rough_stats(valid_p_samples, p_count, CFREQ); 421 print_rough_stats(valid_p_samples, p_count, CFREQ, wss, tss);
419 422
420 free(valid_p_samples); 423 free(valid_p_samples);
421 free(valid_h_samples); 424 free(valid_h_samples);
diff --git a/pm_test/pmmodule.c b/pm_test/pmmodule.c
index 12c42c7..82aecb9 100644
--- a/pm_test/pmmodule.c
+++ b/pm_test/pmmodule.c
@@ -59,16 +59,18 @@ static PyObject* pm_load(PyObject *self, PyObject *args)
59 const char *filename; 59 const char *filename;
60 unsigned int cores_per_l2; 60 unsigned int cores_per_l2;
61 unsigned int num_phys_cpu; 61 unsigned int num_phys_cpu;
62 int wss;
63 int tss;
62 64
63 struct full_ovd_plen *full_costs = NULL; 65 struct full_ovd_plen *full_costs = NULL;
64 int num_samples; 66 int num_samples;
65 67
66 if (!PyArg_ParseTuple(args, "sII", &filename, &cores_per_l2, 68 if (!PyArg_ParseTuple(args, "sIIii", &filename, &cores_per_l2,
67 &num_phys_cpu)) 69 &num_phys_cpu, &wss, &tss))
68 return NULL; 70 return NULL;
69 71
70 /* get valid overheads from raw file */ 72 /* get valid overheads from raw file */
71 if ((num_samples = get_valid_ovd(filename, &full_costs)) < 0) 73 if ((num_samples = get_valid_ovd(filename, &full_costs, wss, tss)) < 0)
72 goto err; 74 goto err;
73 75
74 if ((preempt = malloc(num_samples * sizeof(struct ovd_plen))) < 0) 76 if ((preempt = malloc(num_samples * sizeof(struct ovd_plen))) < 0)