diff --git a/arch/arm/measuremore/Kconfig b/arch/arm/measuremore/Kconfig index f96895fcaceb2617571e79b456c5d45467a6ffe8..8c18e9e7885e148913fcb6d1061bb418a527fa5f 100644 --- a/arch/arm/measuremore/Kconfig +++ b/arch/arm/measuremore/Kconfig @@ -7,6 +7,10 @@ config MEASUREMORE_TIMESTAMP_TYPE_PMCCNTR depends on MEASUREMORE && ARM bool "Read PMCCNTR register" +config MEASUREMORE_TIMESTAMP_TYPE_BERNHARD + depends on MEASUREMORE + bool "Read bernhards register" + config MEASUREMORE_TIMESTAMP_TYPE_KTIME_MONO_FAST depends on MEASUREMORE bool "Call ktime_get_mono_fast_ns()" diff --git a/arch/arm/measuremore/measure.c b/arch/arm/measuremore/measure.c index f8d79c36a3e27063f20d1433b6275e988a954139..6ee9bcadf67378a49eb6520e8ba8b3c87aee054a 100644 --- a/arch/arm/measuremore/measure.c +++ b/arch/arm/measuremore/measure.c @@ -233,6 +233,14 @@ static void seq_write_nstimeofday_s_csv_field(struct seq_file *seq, } #endif +#ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_BERNHARD +static void seq_write_bernhard_csv_field(struct seq_file *seq, + struct checkpoint_record *cpr) +{ + seq_printf(seq, "%llu", cpr->bernhard); +} +#endif + static void seq_write_name_csv_field(struct seq_file *seq, struct checkpoint_record *cpr) { @@ -248,6 +256,10 @@ static void export_current_bmr_to_csv_results(void) create_csv_file("pmccntr", seq_write_pmccntr_csv_field, csv_results_folder); #endif +#ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_BERNHARD + create_csv_file("bernhard", seq_write_bernhard_csv_field, + csv_results_folder); +#endif #ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_KTIME_MONO_FAST create_csv_file("ktime_mono_fast", seq_write_ktime_mono_fast_csv_field, csv_results_folder); diff --git a/include/linux/measuremore.h b/include/linux/measuremore.h index 18f2a129f0379b0413dbc018924549d024e7c133..3ca70659aa9c786fc1cf8b97bf22af500b83ef2c 100644 --- a/include/linux/measuremore.h +++ b/include/linux/measuremore.h @@ -19,11 +19,25 @@ struct pmccntr_timestamp { #endif /* CONFIG_MEASUREMORE_TIMESTAMP_TYPE_PMCCNTR */ +#ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_BERNHARD + +/* Hier den Code zum auslesen. Wenn du davor noch was einschalten musst / den + * Counter am Anfang jedes Runs resetten willst kannst du das analog zu + * pmccntr_reset() / pmccntr_enable() machen (im measuremore Verzeichnis). */ + +#define bernhard_read(var) \ + do { var = 42; } while (0) + +#endif /* CONFIG_MEASUREMORE_TIMESTAMP_TYPE_BERNHARD */ + struct checkpoint_record { const char *name; #ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_PMCCNTR struct pmccntr_timestamp pmccntr_ts; #endif +#ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_BERNHARD + uint64_t bernhard; +#endif #ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_KTIME_MONO_FAST u64 ktime_mono_fast; /* Alread in ns. */ #endif @@ -51,6 +65,9 @@ static __always_inline void memo_checkpoint(const char *name) { #ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_PMCCNTR pmccntr_read(current_cpr->pmccntr_ts.value); #endif +#ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_BERNHARD + bernhard_read(current_cpr->bernhard); +#endif #ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_KTIME_MONO_FAST current_cpr->ktime_mono_fast = ktime_get_mono_fast_ns(); #endif