Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] [PATCH] Fix passing factors in recursive function
@ 2010-09-14 20:12 masoume.jabbarifar
  2010-09-14 20:20 ` Mathieu Desnoyers
  0 siblings, 1 reply; 3+ messages in thread
From: masoume.jabbarifar @ 2010-09-14 20:12 UTC (permalink / raw)


From: Masoume Jabbarifar <masoume.jabbarifar@polymtl.ca>

---
 lttv/lttv/sync/factor_reduction_accuracy.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lttv/lttv/sync/factor_reduction_accuracy.c b/lttv/lttv/sync/factor_reduction_accuracy.c
index a63dae7..ffb2d95 100644
--- a/lttv/lttv/sync/factor_reduction_accuracy.c
+++ b/lttv/lttv/sync/factor_reduction_accuracy.c
@@ -415,8 +415,14 @@ static void getFactors(AllFactors* const allFactors, unsigned int** const
 	unsigned int reference;
 	PairFactors** const pairFactors= allFactors->pairFactors;
 
-	reference= references[traceNum];
-
+	if (traceNum == references[traceNum])
+	{
+		reference= traceNum;
+	}
+	else
+	{
+		reference= predecessors[references[traceNum]][traceNum];
+	}
 	if (reference == traceNum)
 	{
 		factors->offset= 0.;
-- 
1.6.0.4





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ltt-dev] [PATCH] Fix passing factors in recursive function
  2010-09-14 20:12 [ltt-dev] [PATCH] Fix passing factors in recursive function masoume.jabbarifar
@ 2010-09-14 20:20 ` Mathieu Desnoyers
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2010-09-14 20:20 UTC (permalink / raw)


* masoume.jabbarifar at polymtl.ca (masoume.jabbarifar at polymtl.ca) wrote:
> From: Masoume Jabbarifar <masoume.jabbarifar@polymtl.ca>
> 

Hi Masoume,

Please CC Benjamin when posting these patches, so we can get his feedback.

Also a description of the problem this is addressing would be welcome in
the patch header (before the "---" line).


Typical patch (the two first lines are provided by your mail client, you
have to provide the rest):

From: Your email
Subject: [PATCH] Fix passing factors in recursive function

Some detail about what the patch does.

Signed-off-by: Your email.


Thanks,

Mathieu

> ---
>  lttv/lttv/sync/factor_reduction_accuracy.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/lttv/lttv/sync/factor_reduction_accuracy.c b/lttv/lttv/sync/factor_reduction_accuracy.c
> index a63dae7..ffb2d95 100644
> --- a/lttv/lttv/sync/factor_reduction_accuracy.c
> +++ b/lttv/lttv/sync/factor_reduction_accuracy.c
> @@ -415,8 +415,14 @@ static void getFactors(AllFactors* const allFactors, unsigned int** const
>  	unsigned int reference;
>  	PairFactors** const pairFactors= allFactors->pairFactors;
>  
> -	reference= references[traceNum];
> -
> +	if (traceNum == references[traceNum])
> +	{
> +		reference= traceNum;
> +	}
> +	else
> +	{
> +		reference= predecessors[references[traceNum]][traceNum];
> +	}
>  	if (reference == traceNum)
>  	{
>  		factors->offset= 0.;
> -- 
> 1.6.0.4
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ltt-dev] [PATCH] Fix passing factors in recursive function
@ 2010-09-14 20:52 Masoume Jabbarifar
  0 siblings, 0 replies; 3+ messages in thread
From: Masoume Jabbarifar @ 2010-09-14 20:52 UTC (permalink / raw)


After finding the best path to the reference node, factors should
be converted in this path recursively.

Signed-off-by: Masoume Jabbarifar <masoume.jabbarifar at polymtl.ca>
---
 lttv/lttv/sync/factor_reduction_accuracy.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lttv/lttv/sync/factor_reduction_accuracy.c b/lttv/lttv/sync/factor_reduction_accuracy.c
index a63dae7..ffb2d95 100644
--- a/lttv/lttv/sync/factor_reduction_accuracy.c
+++ b/lttv/lttv/sync/factor_reduction_accuracy.c
@@ -415,8 +415,14 @@ static void getFactors(AllFactors* const allFactors, unsigned int** const
 	unsigned int reference;
 	PairFactors** const pairFactors= allFactors->pairFactors;
 
-	reference= references[traceNum];
-
+	if (traceNum == references[traceNum])
+	{
+		reference= traceNum;
+	}
+	else
+	{
+		reference= predecessors[references[traceNum]][traceNum];
+	}
 	if (reference == traceNum)
 	{
 		factors->offset= 0.;
-- 
1.6.0.4





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-14 20:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-14 20:12 [ltt-dev] [PATCH] Fix passing factors in recursive function masoume.jabbarifar
2010-09-14 20:20 ` Mathieu Desnoyers
2010-09-14 20:52 Masoume Jabbarifar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox