iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.23k stars 3.84k forks source link

SEC macro redefined error #2357

Open brad-lewis opened 5 years ago

brad-lewis commented 5 years ago

I encountered the following error in a script attempting to trace zfs.

`In file included from /virtual/main.c:6: In file included from /export/home/delphix/zfs/include/sys/zio.h:35: In file included from /export/home/delphix/zfs/include/sys/zfs_context.h:38: In file included from /export/home/delphix/zfs/include/spl/sys/condvar.h:33: /export/home/delphix/zfs/include/spl/sys/time.h:41:9: warning: 'SEC' macro redefined [-Wmacro-redefined]

define SEC 1

          ^

/virtual/include/bcc/helpers.h:54:9: note: previous definition is here

define SEC(NAME) attribute((section(NAME), used))

          ^`

I propose that SEC be changed to BPF_SEC to prevent name collisions.

yonghong-song commented 5 years ago

Where is this include/spl/sys/time.h seems not in the upstream linux tree?

brad-lewis commented 5 years ago

Thanks. It is in zfsonlinux.

I have changed the zfs symbol in our local repo but it seems that the BPF symbol should be used by bcc to avoid similar naming conflicts, especially with something that could be used commonly as shorthand for seconds, sections, security, ...