You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment
OS: rocky-release-8.7-1.2.el8.noarch
kernel: 4.18.0-477.21.1.el8_8.x86_64
ZFS: zfs-2.2.99-52_ge47e9bbe8 (https://github.com/kjy8901/zfs forked from openzfs/zfs and rpm build)
I'm analyzing ZFS.
I would like to measure the CPU usage of ZFS's deduplication-related functions.
So, I included the linux header to use linux functions. But when I make it again, a problem occurs.
For example, add #include <linux/kernel_stat.h> to the zio.c file.
And I added linux src to Makefile.in
ex) DEFAULT_INCLUDES += -I/usr/src/kernels/4.18.0-477.21.1.el8_8.x86_64/include/
However, various crash errors occur.
ex)
/usr/include/sys/types.h:161:20: note: previous declaration of 'u_int64_t' was here
typedef __uint64_t u_int64_t;
^~~~~~~~~
In file included from /usr/local/lib/linux/limits.h:6,
from /usr/include/bits/local_lim.h:38,
from /usr/include/bits/posix1_lim.h:161,
from /usr/include/limits.h:183,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/limits.h:194,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/syslimits.h:7,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/limits.h:34,
from /usr/include/sys/param.h:26,
from ./lib/libspl/include/os/linux/sys/param.h:30,
from ./lib/libspl/include/sys/types.h:50,
from ./lib/libspl/include/unistd.h:35,
from lib/libspl/page.c:23:
/usr/local/lib/linux/types.h:114:9: error: unknown type name 's64'
typedef s64 int64_t;
^~~
/usr/local/lib/linux/types.h:114:15: error: conflicting types for 'int64_t'
typedef s64 int64_t;
^~~~~~~
In file included from /usr/include/sys/types.h:155,
from ./lib/libspl/include/sys/types.h:38,
from ./lib/libspl/include/unistd.h:35,
from lib/libspl/page.c:23:
...
In file included from /usr/local/lib/linux/limits.h:6,
from /usr/include/bits/local_lim.h:38,
from /usr/include/bits/posix1_lim.h:161,
from /usr/include/limits.h:183,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/limits.h:194,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/syslimits.h:7,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/limits.h:34,
from /usr/include/sys/param.h:26,
from ./lib/libspl/include/os/linux/sys/param.h:30,
from ./lib/libspl/include/sys/types.h:50,
from ./lib/libspl/include/unistd.h:35,
from lib/libspl/page.c:23:
/usr/local/lib/linux/types.h:156:9: error: unknown type name 'u32'
typedef u32 dma_addr_t;
^~~
/usr/local/lib/linux/types.h:166:9: error: unknown type name 'u32'
typedef u32 phys_addr_t;
^~~
In file included from /usr/local/lib/linux/limits.h:7,
from /usr/include/bits/local_lim.h:38,
from /usr/include/bits/posix1_lim.h:161,
from /usr/include/limits.h:183,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/limits.h:194,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/syslimits.h:7,
from /usr/lib/gcc/x86_64-redhat-linux/8/include/limits.h:34,
from /usr/include/sys/param.h:26,
from ./lib/libspl/include/os/linux/sys/param.h:30,
from ./lib/libspl/include/sys/types.h:50,
from ./lib/libspl/include/unistd.h:35,
from lib/libspl/page.c:23:
/usr/include/bits/xopen_lim.h:99:6: error: missing binary operator before token "("
# if INT_MAX == 32767
^~~~~~~
/usr/include/bits/xopen_lim.h:102:7: error: missing binary operator before token "("
# if INT_MAX == 2147483647
^~~~~~~
/usr/include/bits/xopen_lim.h:126:6: error: missing binary operator before token "("
# if LONG_MAX == 2147483647
My questions are:
Are there any guidelines for conflict issues that occur when including Linux-related headers as above?
Or is there a way to measure CPU usage within ZFS?
I am planning to use the CUDA API within the ZFS code in the future, and this problem is likely to occur even then. Are there any guidelines for CUDA API support?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Environment
OS: rocky-release-8.7-1.2.el8.noarch
kernel: 4.18.0-477.21.1.el8_8.x86_64
ZFS: zfs-2.2.99-52_ge47e9bbe8 (https://github.com/kjy8901/zfs forked from openzfs/zfs and rpm build)
I'm analyzing ZFS.
I would like to measure the CPU usage of ZFS's deduplication-related functions.
So, I included the linux header to use linux functions. But when I make it again, a problem occurs.
For example, add
#include <linux/kernel_stat.h>
to the zio.c file.And I added linux src to Makefile.in
ex)
DEFAULT_INCLUDES += -I/usr/src/kernels/4.18.0-477.21.1.el8_8.x86_64/include/
However, various crash errors occur.
ex)
My questions are:
Thanks. regards
Beta Was this translation helpful? Give feedback.
All reactions