summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/perf_cpum_sf.c
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.ibm.com>2018-07-16 11:08:06 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-07-31 11:02:27 +0200
commit5223c671674c507cc9bcabdfc5a9b449c178330a (patch)
tree1965a82b30d74a6cd1e8d009588e7d294933d9e2 /arch/s390/kernel/perf_cpum_sf.c
parent03760d44b1d12df34422f61fc30846d334e03eac (diff)
downloadlinux-stable-5223c671674c507cc9bcabdfc5a9b449c178330a.tar.gz
linux-stable-5223c671674c507cc9bcabdfc5a9b449c178330a.tar.bz2
linux-stable-5223c671674c507cc9bcabdfc5a9b449c178330a.zip
s390/cpum_sf: save TOD clock base in SDBs for time conversion
Processing the samples in the AUX-area by perf requires the computation of respective time stamps. The time stamps used by perf are based on the monotonic clock. To convert the TOD clock value contained in an SDB to a monotonic clock value, the TOD clock base is required. Hence, also save the TOD clock base in the SDB. Suggested-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/perf_cpum_sf.c')
-rw-r--r--arch/s390/kernel/perf_cpum_sf.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
index 0292d68e7dde..cb198d4a6dca 100644
--- a/arch/s390/kernel/perf_cpum_sf.c
+++ b/arch/s390/kernel/perf_cpum_sf.c
@@ -2,7 +2,7 @@
/*
* Performance event support for the System z CPU-measurement Sampling Facility
*
- * Copyright IBM Corp. 2013
+ * Copyright IBM Corp. 2013, 2018
* Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
*/
#define KMSG_COMPONENT "cpum_sf"
@@ -1587,6 +1587,17 @@ static void aux_buffer_free(void *data)
"%lu SDBTs\n", num_sdbt);
}
+static void aux_sdb_init(unsigned long sdb)
+{
+ struct hws_trailer_entry *te;
+
+ te = (struct hws_trailer_entry *)trailer_entry_ptr(sdb);
+
+ /* Save clock base */
+ te->clock_base = 1;
+ memcpy(&te->progusage2, &tod_clock_base[1], 8);
+}
+
/*
* aux_buffer_setup() - Setup AUX buffer for diagnostic mode sampling
* @cpu: On which to allocate, -1 means current
@@ -1666,6 +1677,7 @@ static void *aux_buffer_setup(int cpu, void **pages, int nr_pages,
/* Tail is the entry in a SDBT */
*tail = (unsigned long)pages[i];
aux->sdb_index[i] = (unsigned long)pages[i];
+ aux_sdb_init((unsigned long)pages[i]);
}
sfb->num_sdb = nr_pages;