trace2: fix up a missing "leave" entry point
diff mbox series

Message ID 20190510133738.4511-1-avarab@gmail.com
State New
Headers show
Series
  • trace2: fix up a missing "leave" entry point
Related show

Commit Message

Ævar Arnfjörð Bjarmason May 10, 2019, 1:37 p.m. UTC
Fix a trivial bug that's been here since the shared/do_write_index
tracing was added in 42fee7a388 ("trace2:data: add trace2
instrumentation to index read/write", 2019-02-22). We should have
enter/leave points, not two enter/enter points. This resulted in an
"enter" event without a corresponding "leave" event.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 read-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Derrick Stolee May 10, 2019, 1:45 p.m. UTC | #1
On 5/10/2019 9:37 AM, Ævar Arnfjörð Bjarmason wrote:
> Fix a trivial bug that's been here since the shared/do_write_index
> tracing was added in 42fee7a388 ("trace2:data: add trace2
> instrumentation to index read/write", 2019-02-22). We should have
> enter/leave points, not two enter/enter points. This resulted in an
> "enter" event without a corresponding "leave" event.
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  read-cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/read-cache.c b/read-cache.c
> index 61b043bac3..4fad4e3f9a 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -3131,7 +3131,7 @@ static int write_shared_index(struct index_state *istate,
>  	trace2_region_enter_printf("index", "shared/do_write_index",
>  				   the_repository, "%s", (*temp)->filename.buf);
>  	ret = do_write_index(si->base, *temp, 1);
> -	trace2_region_enter_printf("index", "shared/do_write_index",
> +	trace2_region_leave_printf("index", "shared/do_write_index",
>  				   the_repository, "%s", (*temp)->filename.buf);
>  
>  	if (ret)
> 

Thanks! Obviously correct.

-Stolee
Jeff Hostetler May 20, 2019, 4:50 p.m. UTC | #2
On 5/10/2019 9:37 AM, Ævar Arnfjörð Bjarmason wrote:
> Fix a trivial bug that's been here since the shared/do_write_index
> tracing was added in 42fee7a388 ("trace2:data: add trace2
> instrumentation to index read/write", 2019-02-22). We should have
> enter/leave points, not two enter/enter points. This resulted in an
> "enter" event without a corresponding "leave" event.
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>   read-cache.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/read-cache.c b/read-cache.c
> index 61b043bac3..4fad4e3f9a 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -3131,7 +3131,7 @@ static int write_shared_index(struct index_state *istate,
>   	trace2_region_enter_printf("index", "shared/do_write_index",
>   				   the_repository, "%s", (*temp)->filename.buf);
>   	ret = do_write_index(si->base, *temp, 1);
> -	trace2_region_enter_printf("index", "shared/do_write_index",
> +	trace2_region_leave_printf("index", "shared/do_write_index",
>   				   the_repository, "%s", (*temp)->filename.buf);
>   
>   	if (ret)
> 

Good catch!

Thanks,
Jeff

Patch
diff mbox series

diff --git a/read-cache.c b/read-cache.c
index 61b043bac3..4fad4e3f9a 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -3131,7 +3131,7 @@  static int write_shared_index(struct index_state *istate,
 	trace2_region_enter_printf("index", "shared/do_write_index",
 				   the_repository, "%s", (*temp)->filename.buf);
 	ret = do_write_index(si->base, *temp, 1);
-	trace2_region_enter_printf("index", "shared/do_write_index",
+	trace2_region_leave_printf("index", "shared/do_write_index",
 				   the_repository, "%s", (*temp)->filename.buf);
 
 	if (ret)