Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

biotop compilation error on 4.9-rc3 #800

Closed
goldshtn opened this issue Nov 5, 2016 · 6 comments · Fixed by #825
Closed

biotop compilation error on 4.9-rc3 #800

goldshtn opened this issue Nov 5, 2016 · 6 comments · Fixed by #825

Comments

@goldshtn
Copy link
Collaborator

goldshtn commented Nov 5, 2016

This is from Ubuntu 16.04 with Linux 4.9-rc3:

/usr/share/bcc/tools# ./biotop
In file included from /virtual/main.c:3:
In file included from include/linux/blkdev.h:9:
In file included from include/linux/genhd.h:64:
In file included from include/linux/device.h:24:
In file included from include/linux/pinctrl/devinfo.h:21:
In file included from include/linux/pinctrl/consumer.h:17:
In file included from include/linux/seq_file.h:10:
include/linux/fs.h:2693:9: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
        if (id < 0 || id >= READING_MAX_ID)
            ~~ ^ ~
/virtual/main.c:74:34: error: use of undeclared identifier 'REQ_WRITE'; did you mean 'REQ_OP_WRITE'?
    info.type = req->cmd_flags & REQ_WRITE;
                                 ^~~~~~~~~
                                 REQ_OP_WRITE
include/linux/blk_types.h:241:2: note: 'REQ_OP_WRITE' declared here
        REQ_OP_WRITE,
        ^
1 warning and 1 error generated.
Traceback (most recent call last):
  File "./biotop", line 152, in <module>
    """, debug=0)
  File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 240, in __init__
    raise Exception("Failed to compile BPF module %s" % src_file)
Exception: Failed to compile BPF module 

/cc @brendangregg

@ghost
Copy link

ghost commented Nov 7, 2016

Same here.

@ghost
Copy link

ghost commented Nov 7, 2016

The fix is also very simple. Just replace REQ_WRITE with REQ_OP_WRITE in biotop tool.

@goldshtn
Copy link
Collaborator Author

goldshtn commented Nov 7, 2016

Indeed, except we probably want to support both pre-4.9 and post-4.9 kernels.

@goldshtn
Copy link
Collaborator Author

goldshtn commented Nov 7, 2016

I think that if we can move this tool (and some others) to use tracepoints it would be truly great, and break much less often.

@4ast
Copy link
Member

4ast commented Nov 7, 2016

in the mean time, let's fix biotop the same way biosnoop fixed this issue.

@syg00
Copy link

syg00 commented Jan 4, 2017

Looks like 4.10 is breaking things again (at least biotop and biosnoop).
REQ_OP_SHIFT has disappeared from blkdev.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants