iovisor / iovisor/bcc

SEC macro redefined error

Open
#2,357 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
5d 13h
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with include/spl/sys/time.h and compare its SEC definition with the SEC macro in /virtual/include/bcc/helpers.h shown in the compiler output. Trace the affected BCC include path and verify that the reported ZFS tracing script no longer emits the macro-redefinition warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.