Re: [LEDE-DEV] [PATCH 3/3] Add debug output for service_timeout

2017-10-02 Thread Philipp Meier



On 09/28/2017 09:35 PM, Philip Prindeville wrote:

Inline

Sent from my iPhone

On Sep 28, 2017, at 1:09 AM, Philipp Meier  wrote:

Signed-off-by: Philipp Meier 
---
service.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/service.c b/service.c
index 0a9e25d..97b6f91 100644
--- a/service.c
+++ b/service.c
@@ -121,8 +121,10 @@ service_timeout(struct service *s)
{
time_t t = monotonic_time();

-if (t - s->t <= TOUT_LOOKUP)
+if (t - s->t <= TOUT_LOOKUP) {
+DBG(2, "t=%lu, s->t=%lu, t - s->t = %lu\n", t, s->t, t - s->t);


Do you need to write "t - s->t" or would "elapsed", "remaining", or even 
"delta" be more descriptive?



return 0;
+}

return t;
}
--
2.7.4




___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev



Hi Philip,

No - I do not "need" to write "t - s->t" - if John (maintainer) would 
like to have a more descriptive debug message I would be happy to 
provide a patch with these changes.
If not: it's anyway a debug only message which is only meaningful for 
people looking at the source code.


Regards,
Philipp

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH 3/3] Add debug output for service_timeout

2017-09-28 Thread Philip Prindeville
Inline

Sent from my iPhone
> On Sep 28, 2017, at 1:09 AM, Philipp Meier  wrote:
> 
> Signed-off-by: Philipp Meier 
> ---
> service.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/service.c b/service.c
> index 0a9e25d..97b6f91 100644
> --- a/service.c
> +++ b/service.c
> @@ -121,8 +121,10 @@ service_timeout(struct service *s)
> {
>time_t t = monotonic_time();
> 
> -if (t - s->t <= TOUT_LOOKUP)
> +if (t - s->t <= TOUT_LOOKUP) {
> +DBG(2, "t=%lu, s->t=%lu, t - s->t = %lu\n", t, s->t, t - s->t);

Do you need to write "t - s->t" or would "elapsed", "remaining", or even 
"delta" be more descriptive?


>return 0;
> +}
> 
>return t;
> }
> -- 
> 2.7.4
> 


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 3/3] Add debug output for service_timeout

2017-09-28 Thread Philipp Meier
Signed-off-by: Philipp Meier 
---
 service.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/service.c b/service.c
index 0a9e25d..97b6f91 100644
--- a/service.c
+++ b/service.c
@@ -121,8 +121,10 @@ service_timeout(struct service *s)
 {
time_t t = monotonic_time();
 
-   if (t - s->t <= TOUT_LOOKUP)
+   if (t - s->t <= TOUT_LOOKUP) {
+   DBG(2, "t=%lu, s->t=%lu, t - s->t = %lu\n", t, s->t, t - s->t);
return 0;
+   }
 
return t;
 }
-- 
2.7.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev