diff mbox series

trace2: fix incorrect function pointer check

Message ID 548a9b833f4569c526cf94c048ae115a76d54be9.1556211995.git.steadmon@google.com (mailing list archive)
State New, archived
Headers show
Series trace2: fix incorrect function pointer check | expand

Commit Message

Josh Steadmon April 25, 2019, 5:08 p.m. UTC
Fix trace2_data_json_fl() to check for the presence of pfn_data_json_fl
in its targets, rather than pfn_data_fl, which is not actually called.

Signed-off-by: Josh Steadmon <steadmon@google.com>
---
 trace2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Derrick Stolee April 25, 2019, 6:46 p.m. UTC | #1
On 4/25/2019 1:08 PM, Josh Steadmon wrote:
> Fix trace2_data_json_fl() to check for the presence of pfn_data_json_fl
> in its targets, rather than pfn_data_fl, which is not actually called.

[snip]

>  	for_each_wanted_builtin (j, tgt_j)
> -		if (tgt_j->pfn_data_fl)
> +		if (tgt_j->pfn_data_json_fl)
>  			tgt_j->pfn_data_json_fl(file, line, us_elapsed_absolute,

Seems obviously correct. Thanks!

-Stolee
Junio C Hamano April 26, 2019, 2:42 a.m. UTC | #2
Derrick Stolee <stolee@gmail.com> writes:

> On 4/25/2019 1:08 PM, Josh Steadmon wrote:
>> Fix trace2_data_json_fl() to check for the presence of pfn_data_json_fl
>> in its targets, rather than pfn_data_fl, which is not actually called.
>
> [snip]
>
>>  	for_each_wanted_builtin (j, tgt_j)
>> -		if (tgt_j->pfn_data_fl)
>> +		if (tgt_j->pfn_data_json_fl)
>>  			tgt_j->pfn_data_json_fl(file, line, us_elapsed_absolute,
>
> Seems obviously correct. Thanks!
>
> -Stolee

Thanks, both.  It is embarrassing and sad that nobody caught it
before it hit my tree X-<.
Jeff Hostetler April 29, 2019, 1:01 p.m. UTC | #3
On 4/25/2019 1:08 PM, Josh Steadmon wrote:
> Fix trace2_data_json_fl() to check for the presence of pfn_data_json_fl
> in its targets, rather than pfn_data_fl, which is not actually called.
> 
> Signed-off-by: Josh Steadmon <steadmon@google.com>
> ---
>   trace2.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/trace2.c b/trace2.c
> index 8bbad56887..a73cfdf6fe 100644
> --- a/trace2.c
> +++ b/trace2.c
> @@ -717,7 +717,7 @@ void trace2_data_json_fl(const char *file, int line, const char *category,
>   	us_elapsed_region = tr2tls_region_elasped_self(us_now);
>   
>   	for_each_wanted_builtin (j, tgt_j)
> -		if (tgt_j->pfn_data_fl)
> +		if (tgt_j->pfn_data_json_fl)
>   			tgt_j->pfn_data_json_fl(file, line, us_elapsed_absolute,
>   						us_elapsed_region, category,
>   						repo, key, value);
> 

good catch.  thanks.

Jeff
diff mbox series

Patch

diff --git a/trace2.c b/trace2.c
index 8bbad56887..a73cfdf6fe 100644
--- a/trace2.c
+++ b/trace2.c
@@ -717,7 +717,7 @@  void trace2_data_json_fl(const char *file, int line, const char *category,
 	us_elapsed_region = tr2tls_region_elasped_self(us_now);
 
 	for_each_wanted_builtin (j, tgt_j)
-		if (tgt_j->pfn_data_fl)
+		if (tgt_j->pfn_data_json_fl)
 			tgt_j->pfn_data_json_fl(file, line, us_elapsed_absolute,
 						us_elapsed_region, category,
 						repo, key, value);