diff mbox

[v2,08/11] timekeeper: add a couple of the core timekeeper reading helpers

Message ID 1500651918-14156-9-git-send-email-dplotnikov@virtuozzo.com (mailing list archive)
State New, archived
Headers show

Commit Message

Denis Plotnikov July 21, 2017, 3:45 p.m. UTC
Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com>
---
 include/linux/timekeeping.h |  3 +++
 kernel/time/timekeeping.c   | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

Comments

kernel test robot July 23, 2017, 4:02 a.m. UTC | #1
Hi Denis,

[auto build test ERROR on tip/x86/core]
[cannot apply to v4.13-rc1 next-20170721]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Denis-Plotnikov/make-L2-s-kvm-clock-stable-get-rid-of-pvclock_gtod/20170723-113103
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   kernel/time/timekeeping.c: In function 'get_tk_mono_clock_mode':
>> kernel/time/timekeeping.c:2396:42: error: 'struct clocksource' has no member named 'archdata'
     return tk_core.timekeeper.tkr_mono.clock->archdata.vclock_mode;
                                             ^
   kernel/time/timekeeping.c:2397:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +2396 kernel/time/timekeeping.c

  2393	
  2394	int get_tk_mono_clock_mode(void)
  2395	{
> 2396		return tk_core.timekeeper.tkr_mono.clock->archdata.vclock_mode;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot July 23, 2017, 4:02 a.m. UTC | #2
Hi Denis,

[auto build test ERROR on tip/x86/core]
[cannot apply to v4.13-rc1 next-20170721]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Denis-Plotnikov/make-L2-s-kvm-clock-stable-get-rid-of-pvclock_gtod/20170723-113103
config: ia64-allyesconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

All errors (new ones prefixed by >>):

   kernel/time/timekeeping.c: In function 'get_tk_mono_clock_mode':
>> kernel/time/timekeeping.c:2396:52: error: 'struct arch_clocksource_data' has no member named 'vclock_mode'
     return tk_core.timekeeper.tkr_mono.clock->archdata.vclock_mode;
                                                       ^
   kernel/time/timekeeping.c:2397:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +2396 kernel/time/timekeeping.c

  2393	
  2394	int get_tk_mono_clock_mode(void)
  2395	{
> 2396		return tk_core.timekeeper.tkr_mono.clock->archdata.vclock_mode;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index edffe82..092bf5f 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -372,3 +372,6 @@  extern int update_persistent_clock64(struct timespec64 now);
 
 
 #endif
+
+extern const seqcount_t *get_tk_seq(void);
+extern int get_tk_mono_clock_mode(void);
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 1cef214..3f35e52 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -2381,3 +2381,18 @@  void xtime_update(unsigned long ticks)
 	write_sequnlock(&jiffies_lock);
 	update_wall_time();
 }
+
+/*
+ * Helpers forthe core timekeeper reading
+ */
+const seqcount_t *get_tk_seq(void)
+{
+	return &tk_core.seq;
+}
+EXPORT_SYMBOL(get_tk_seq);
+
+int get_tk_mono_clock_mode(void)
+{
+	return tk_core.timekeeper.tkr_mono.clock->archdata.vclock_mode;
+}
+EXPORT_SYMBOL(get_tk_mono_clock_mode);