# [PATCH] trace2: fix hdr-check warnings

5 messages from 2019-01-26 to 2019-02-05. Participants: Ramsay Jones, Jeff Hostetler, Carlo Arenas.
Thread: https://gitlist.dev/t/50331

## Ramsay Jones, 2019-01-26 21:07

Subject: [PATCH] trace2: fix hdr-check warnings
Message-ID: <ba0549c5-25f1-efcc-e49a-d7e76be73fe3@ramsayjones.plus.com>
URL: https://gitlist.dev/e/ba0549c5-25f1-efcc-e49a-d7e76be73fe3%40ramsayjones.plus.com

```

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Jeff,

If you need to re-roll your 'jh/trace2' branch, could you please
squash this into the relevant patches (sorry, I didn't look to
see which patches need to be modified).

Thanks!

ATB,
Ramsay Jones

 trace2/tr2_tgt.h | 4 ++++
 trace2/tr2_tls.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/trace2/tr2_tgt.h b/trace2/tr2_tgt.h
index 4fdf253b57..8a46bbad4e 100644
--- a/trace2/tr2_tgt.h
+++ b/trace2/tr2_tgt.h
@@ -1,6 +1,10 @@
 #ifndef TR2_TGT_H
 #define TR2_TGT_H
 
+struct child_process;
+struct repository;
+struct json_writer;
+
 /*
  * Function prototypes for a TRACE2 "target" vtable.
  */
diff --git a/trace2/tr2_tls.h b/trace2/tr2_tls.h
index 99ea9018ce..bb80e3f8e7 100644
--- a/trace2/tr2_tls.h
+++ b/trace2/tr2_tls.h
@@ -1,6 +1,8 @@
 #ifndef TR2_TLS_H
 #define TR2_TLS_H
 
+#include "strbuf.h"
+
 /*
  * Arbitry limit for thread names for column alignment.
  */
-- 
2.20.0

```

## Jeff Hostetler, 2019-01-30 12:29

Subject: Re: [PATCH] trace2: fix hdr-check warnings
Message-ID: <00e08dc3-a610-0429-e819-1d29d0ddb81a@jeffhostetler.com>
URL: https://gitlist.dev/e/00e08dc3-a610-0429-e819-1d29d0ddb81a%40jeffhostetler.com
In-Reply-To: <ba0549c5-25f1-efcc-e49a-d7e76be73fe3@ramsayjones.plus.com>

```


On 1/26/2019 4:07 PM, Ramsay Jones wrote:
> 
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
> 
> Hi Jeff,
> 
> If you need to re-roll your 'jh/trace2' branch, could you please
> squash this into the relevant patches (sorry, I didn't look to
> see which patches need to be modified).

Will do. Thanks.

BTW, how do you find these?  I ran both "make sparse" and
"make DEVELOPER=1" and it didn't complain about these items.

Jeff


```

## Carlo Arenas, 2019-01-30 15:39

Subject: Re: [PATCH] trace2: fix hdr-check warnings
Message-ID: <CAPUEspgs795iM3nseKYOD0RFcAh2qCdq-zVOYkTBVjO2zPe6zw@mail.gmail.com>
URL: https://gitlist.dev/e/CAPUEspgs795iM3nseKYOD0RFcAh2qCdq-zVOYkTBVjO2zPe6zw%40mail.gmail.com
In-Reply-To: <00e08dc3-a610-0429-e819-1d29d0ddb81a@jeffhostetler.com>

```
On Wed, Jan 30, 2019 at 4:30 AM Jeff Hostetler <git@jeffhostetler.com> wrote:
> BTW, how do you find these?  I ran both "make sparse" and
> "make DEVELOPER=1" and it didn't complain about these items.

$ make hdr-check

available since ebb7baf02f ("Makefile: add a hdr-check target", 2018-09-19)

Carlo

```

## Ramsay Jones, 2019-02-04 19:44

Subject: Re: [PATCH] trace2: fix hdr-check warnings
Message-ID: <d680fda2-7e54-2200-cd00-97772de45b47@ramsayjones.plus.com>
URL: https://gitlist.dev/e/d680fda2-7e54-2200-cd00-97772de45b47%40ramsayjones.plus.com
In-Reply-To: <00e08dc3-a610-0429-e819-1d29d0ddb81a@jeffhostetler.com>

```


On 30/01/2019 12:29, Jeff Hostetler wrote:
> 
> 
> On 1/26/2019 4:07 PM, Ramsay Jones wrote:
>>
>> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
>> ---
>>
>> Hi Jeff,
>>
>> If you need to re-roll your 'jh/trace2' branch, could you please
>> squash this into the relevant patches (sorry, I didn't look to
>> see which patches need to be modified).
> 
> Will do. Thanks.
> 
> BTW, how do you find these?  I ran both "make sparse" and
> "make DEVELOPER=1" and it didn't complain about these items.

Carlo already replied about 'make hdr-check', but you seem to
have missed squashing half of the original patch, since the
re-rolled series still causes 'make -k hdr-check >phcout 2>&1'
to show:

  $ diff nhcout phcout
  22a23,34
  >     HDR trace2/tr2_dst.h
  >     HDR trace2/tr2_cfg.h
  >     HDR trace2/tr2_tgt.h
  >     HDR trace2/tr2_cmd_name.h
  >     HDR trace2/tr2_sid.h
  >     HDR trace2/tr2_tls.h
  > trace2/tr2_tls.h:12:16: error: field ‘thread_name’ has incomplete type
  >   struct strbuf thread_name;
  >                 ^~~~~~~~~~~
  > Makefile:2739: recipe for target 'trace2/tr2_tls.hco' failed
  > make: *** [trace2/tr2_tls.hco] Error 1
  >     HDR trace2/tr2_tbuf.h
  131c143
  < Makefile:2725: recipe for target 'sha256/gcrypt.hco' failed
  ---
  > Makefile:2739: recipe for target 'sha256/gcrypt.hco' failed
  164a177
  >     HDR trace2.h
  $ 

So, quoting the last part of the original patch:

diff --git a/trace2/tr2_tls.h b/trace2/tr2_tls.h
index 99ea9018ce..bb80e3f8e7 100644
--- a/trace2/tr2_tls.h
+++ b/trace2/tr2_tls.h
@@ -1,6 +1,8 @@
 #ifndef TR2_TLS_H
 #define TR2_TLS_H
 
+#include "strbuf.h"
+
 /*
  * Arbitry limit for thread names for column alignment.
  */
-- 


ATB,
Ramsay Jones





```

## Jeff Hostetler, 2019-02-05 20:22

Subject: Re: [PATCH] trace2: fix hdr-check warnings
Message-ID: <d91d1d89-5759-2006-7b38-4211db5988af@jeffhostetler.com>
URL: https://gitlist.dev/e/d91d1d89-5759-2006-7b38-4211db5988af%40jeffhostetler.com
In-Reply-To: <d680fda2-7e54-2200-cd00-97772de45b47@ramsayjones.plus.com>

```


On 2/4/2019 2:44 PM, Ramsay Jones wrote:
> 
> 
> On 30/01/2019 12:29, Jeff Hostetler wrote:
>>
>>
>> On 1/26/2019 4:07 PM, Ramsay Jones wrote:
>>>
>>> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
>>> ---
>>>
>>> Hi Jeff,
>>>
>>> If you need to re-roll your 'jh/trace2' branch, could you please
>>> squash this into the relevant patches (sorry, I didn't look to
>>> see which patches need to be modified).
>>
>> Will do. Thanks.
>>
>> BTW, how do you find these?  I ran both "make sparse" and
>> "make DEVELOPER=1" and it didn't complain about these items.
> 
> Carlo already replied about 'make hdr-check', but you seem to
> have missed squashing half of the original patch, since the
> re-rolled series still causes 'make -k hdr-check >phcout 2>&1'
> to show:
> 
>    $ diff nhcout phcout
>    22a23,34
>    >     HDR trace2/tr2_dst.h
>    >     HDR trace2/tr2_cfg.h
>    >     HDR trace2/tr2_tgt.h
>    >     HDR trace2/tr2_cmd_name.h
>    >     HDR trace2/tr2_sid.h
>    >     HDR trace2/tr2_tls.h
>    > trace2/tr2_tls.h:12:16: error: field ‘thread_name’ has incomplete type
>    >   struct strbuf thread_name;
>    >                 ^~~~~~~~~~~
>    > Makefile:2739: recipe for target 'trace2/tr2_tls.hco' failed
>    > make: *** [trace2/tr2_tls.hco] Error 1
>    >     HDR trace2/tr2_tbuf.h
>    131c143
>    < Makefile:2725: recipe for target 'sha256/gcrypt.hco' failed
>    ---
>    > Makefile:2739: recipe for target 'sha256/gcrypt.hco' failed
>    164a177
>    >     HDR trace2.h
>    $
> 
> So, quoting the last part of the original patch:
> 
> diff --git a/trace2/tr2_tls.h b/trace2/tr2_tls.h
> index 99ea9018ce..bb80e3f8e7 100644
> --- a/trace2/tr2_tls.h
> +++ b/trace2/tr2_tls.h
> @@ -1,6 +1,8 @@
>   #ifndef TR2_TLS_H
>   #define TR2_TLS_H
>   
> +#include "strbuf.h"
> +
>   /*
>    * Arbitry limit for thread names for column alignment.
>    */
> 

Yes, it appears I missed one.  I'll add it if I re-roll this.
(I hate to send a whole new version for one line.)

Thanks
Jeff

```
