Re: [Xen-devel] [PATCH v4 7/7] add sleep, msleep and NOW() macros to time manager

2018-04-17 Thread Roger Pau Monné
On Mon, Apr 16, 2018 at 12:45:17PM +0200, Paul Semel wrote:
> On 04/13/2018 03:55 PM, Roger Pau Monné wrote:
> > > those are helpful macro to use the time manager correctly
> > > 
> > > Signed-off-by: Paul Semel 
> > > ---
> > > 
> > > Notes:
> > >  v4:
> > >  - new patch version
> > > 
> > >   common/time.c  | 10 ++
> > >   include/xtf/time.h | 12 
> > >   2 files changed, 22 insertions(+)
> > > 
> > > diff --git a/common/time.c b/common/time.c
> > > index 7515eb0..e2779b9 100644
> > > --- a/common/time.c
> > > +++ b/common/time.c
> > > @@ -163,6 +163,16 @@ static inline void mspin_sleep(uint64_t t)
> > >   nspin_sleep(nsec);
> > >   }
> > > +void sleep(uint64_t t)
> > > +{
> > > +spin_sleep(t);
> > > +}
> > > +
> > > +void msleep(uint64_t t)
> > > +{
> > > +mspin_sleep(t);
> > 
> > Why can you just call mspin_sleep msleep directly?
> > 
> > The same applies to spin_sleep.
> > 
> > Also I was expecting to see some kind of test appear at the end of the
> > series. You are basically adding a bunch of dead code, since there's
> > no user of any of the newly introduced functions.
> 
> Actually, I won't be able to add a real XSA test using this feature. Anyway,
> I do think that having the sleep functions will be really useful in the
> future.
> Anyway, I was thinking about adding a test that is calling the gettimeofday
> function or something similar.
> 
> What do you think about it ?

Yes, see my last reply to 3/7.

Thanks, Roger.

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v4 7/7] add sleep, msleep and NOW() macros to time manager

2018-04-16 Thread Paul Semel

On 04/13/2018 03:55 PM, Roger Pau Monné wrote:

those are helpful macro to use the time manager correctly

Signed-off-by: Paul Semel 
---

Notes:
 v4:
 - new patch version

  common/time.c  | 10 ++
  include/xtf/time.h | 12 
  2 files changed, 22 insertions(+)

diff --git a/common/time.c b/common/time.c
index 7515eb0..e2779b9 100644
--- a/common/time.c
+++ b/common/time.c
@@ -163,6 +163,16 @@ static inline void mspin_sleep(uint64_t t)
  nspin_sleep(nsec);
  }
  
+void sleep(uint64_t t)

+{
+spin_sleep(t);
+}
+
+void msleep(uint64_t t)
+{
+mspin_sleep(t);


Why can you just call mspin_sleep msleep directly?

The same applies to spin_sleep.

Also I was expecting to see some kind of test appear at the end of the
series. You are basically adding a bunch of dead code, since there's
no user of any of the newly introduced functions.


Actually, I won't be able to add a real XSA test using this feature. Anyway, I 
do think that having the sleep functions will be really useful in the future.
Anyway, I was thinking about adding a test that is calling the gettimeofday 
function or something similar.


What do you think about it ?

--
Paul Semel

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v4 7/7] add sleep, msleep and NOW() macros to time manager

2018-04-13 Thread Roger Pau Monné
On Tue, Apr 10, 2018 at 09:17:01PM +0200, Paul Semel wrote:
> those are helpful macro to use the time manager correctly
> 
> Signed-off-by: Paul Semel 
> ---
> 
> Notes:
> v4:
> - new patch version
> 
>  common/time.c  | 10 ++
>  include/xtf/time.h | 12 
>  2 files changed, 22 insertions(+)
> 
> diff --git a/common/time.c b/common/time.c
> index 7515eb0..e2779b9 100644
> --- a/common/time.c
> +++ b/common/time.c
> @@ -163,6 +163,16 @@ static inline void mspin_sleep(uint64_t t)
>  nspin_sleep(nsec);
>  }
>  
> +void sleep(uint64_t t)
> +{
> +spin_sleep(t);
> +}
> +
> +void msleep(uint64_t t)
> +{
> +mspin_sleep(t);

Why can you just call mspin_sleep msleep directly?

The same applies to spin_sleep.

Also I was expecting to see some kind of test appear at the end of the
series. You are basically adding a bunch of dead code, since there's
no user of any of the newly introduced functions.

Thanks, Roger.

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PATCH v4 7/7] add sleep, msleep and NOW() macros to time manager

2018-04-10 Thread Paul Semel
those are helpful macro to use the time manager correctly

Signed-off-by: Paul Semel 
---

Notes:
v4:
- new patch version

 common/time.c  | 10 ++
 include/xtf/time.h | 12 
 2 files changed, 22 insertions(+)

diff --git a/common/time.c b/common/time.c
index 7515eb0..e2779b9 100644
--- a/common/time.c
+++ b/common/time.c
@@ -163,6 +163,16 @@ static inline void mspin_sleep(uint64_t t)
 nspin_sleep(nsec);
 }
 
+void sleep(uint64_t t)
+{
+spin_sleep(t);
+}
+
+void msleep(uint64_t t)
+{
+mspin_sleep(t);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/include/xtf/time.h b/include/xtf/time.h
index d9cecdb..545da25 100644
--- a/include/xtf/time.h
+++ b/include/xtf/time.h
@@ -23,8 +23,20 @@ uint64_t since_boot_time(void);
 
 uint64_t current_time(void);
 
+/* This function takes seconds in parameter */
+void sleep(uint64_t f);
+
+/* Be careful, this function takes milliseconds in parameter,
+ * not microseconds !
+ */
+void msleep(uint64_t f);
+
 int gettimeofday(struct timeval *tp, void *restrict tzp);
 
+
+/* This returns the current epoch time */
+#define NOW() current_time()
+
 #endif /* XTF_TIME_H */
 
 /*
-- 
2.16.1


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel