Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1468182

[RFC v4 18/22] timer_list: print_tickdevice(): calculate ->*_delta_ns dynamically

From Nicolai Stange <nicstange@gmail.com>
Newsgroups linux.kernel
Subject [RFC v4 18/22] timer_list: print_tickdevice(): calculate ->*_delta_ns dynamically
Date 2016-08-23 01:40 +0200
Message-ID <s96YX-4v1-63@gated-at.bofh.it> (permalink)
References <s96YV-4v1-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


print_tickdevice(), assembling the per-tick device sections in
/proc/timer_list, is the last user of struct clock_event_device's
->min_delta_ns and ->max_delta_ns members.

In order to make these fully obsolete while retaining userspace ABI,
calculate the displayed values of 'min_delta_ns' and 'max_delta_ns'
on the fly from ->min_delta_ticks_adjusted and ->max_delta_ticks
respectively.

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
 kernel/time/timer_list.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index ba7d8b2..5fba4f3 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -206,6 +206,10 @@ static void
 print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
 {
 	struct clock_event_device *dev = td->evtdev;
+	unsigned long long min_delta_ns =
+		clockevent_delta2ns(dev->min_delta_ticks_adjusted, dev);
+	unsigned long long max_delta_ns =
+		clockevent_delta2ns(dev->max_delta_ticks, dev);
 
 	SEQ_printf(m, "Tick Device: mode:     %d\n", td->mode);
 	if (cpu < 0)
@@ -219,10 +223,8 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
 		return;
 	}
 	SEQ_printf(m, "%s\n", dev->name);
-	SEQ_printf(m, " max_delta_ns:   %llu\n",
-		   (unsigned long long) dev->max_delta_ns);
-	SEQ_printf(m, " min_delta_ns:   %llu\n",
-		   (unsigned long long) dev->min_delta_ns);
+	SEQ_printf(m, " max_delta_ns:   %llu\n", max_delta_ns);
+	SEQ_printf(m, " min_delta_ns:   %llu\n", min_delta_ns);
 	SEQ_printf(m, " mult:           %u\n", dev->mult);
 	SEQ_printf(m, " shift:          %u\n", dev->shift);
 	SEQ_printf(m, " mode:           %d\n", clockevent_get_state(dev));
-- 
2.9.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC v4 00/22] adapt clockevents frequencies to mono clock Nicolai Stange <nicstange@gmail.com> - 2016-08-23 01:40 +0200
  [RFC v4 15/22] clockevents: clockevents_program_min_delta(): don't set ->next_event Nicolai Stange <nicstange@gmail.com> - 2016-08-23 01:40 +0200
  [RFC v4 02/22] clocksource: sh_tmu: compute rate before registration again Nicolai Stange <nicstange@gmail.com> - 2016-08-23 01:40 +0200
  [RFC v4 11/22] clockevents: always initialize ->min_delta_ns and ->max_delta_ns Nicolai Stange <nicstange@gmail.com> - 2016-08-23 01:40 +0200
  [RFC v4 18/22] timer_list: print_tickdevice(): calculate ->*_delta_ns dynamically Nicolai Stange <nicstange@gmail.com> - 2016-08-23 01:40 +0200
  [RFC v4 19/22] clockevents: purge ->min_delta_ns and ->max_delta_ns Nicolai Stange <nicstange@gmail.com> - 2016-08-23 01:40 +0200
  [RFC v4 13/22] clockevents: check a programmed delta's bounds in terms of cycles Nicolai Stange <nicstange@gmail.com> - 2016-08-23 01:40 +0200
  [RFC v4 10/22] arch/tile/kernel/time: set ->min_delta_ticks and ->max_delta_ticks Nicolai Stange <nicstange@gmail.com> - 2016-08-23 01:40 +0200

csiph-web