Re: [PATCH linux next] tools headers UAPI: sync linux/taskstats.h for procacct.c
From: wang.yaxin
Date: Fri May 29 2026 - 00:50:39 EST
>> From: Wang Yaxin <wang.yaxin@xxxxxxxxxx>
>>
>> Background
>> ==========
>> After commit 9b93f7e32774 ("tools/getdelays: use the static UAPI
>> headers from tools/include/uapi"), the Makefile was changed to use
>> -I../include/uapi/ instead of -I../../usr/include to ensure tools
>> always use the up-to-date UAPI headers.
>>
>> However, only linux/taskstats.h was added to tools/include/uapi/ in
>> commit e5bbb35a07b3 ("tools headers UAPI: sync linux/taskstats.h"),
>> but linux/acct.h was missing.
>
>Please let's Cc the author of both of these commits!
Ok
>> Problem
>> =======
>> This causes procacct.c to fail to compile with:
>>
>> procacct.c:234:37: error: 'AGROUP' undeclared (first use in this function)
>>
>> gcc -I../include/uapi/ getdelays.c -o getdelays
>> gcc -I../include/uapi/ procacct.c -o procacct
>> procacct.c: In function ‘print_procacct’:
>> procacct.c:234:37: error: ‘AGROUP’ undeclared (first use in this function)
>> did you mean ‘NOGROUP’?
>> 234 | , t->version >= 12 ? (t->ac_flag & AGROUP ? 'P' : 'T') : '?'
>> | ^~~~~~
>> | NOGROUP
>> procacct.c:234:37: note: each undeclared ident
>>
>> because procacct.c uses the AGROUP macro defined in linux/acct.h.
>>
>> Solution
>> ========
>> Add the missing linux/acct.h to complete the static UAPI header set.
>
>It has always annoyed me that we do this by copying the file. I'm
>surprised that there isn't a way of using the original file directly.
Using -I../../usr/include avoids duplicate headers and relies on a
single original copy, but requires make headers_install. This aligns
with commit 9b93f7e32774 ("tools/getdelays: use the static UAPI headers
from tools/include/uapi").
Using -I../include/uapi/ keeps two separate header copies, which may
cause inconsistencies when one copy is updated. Can we optimize it
with symbolic links, or revert to the first solution?
Thanks
Yaxin