iovisor / bcc

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

fileslower 0 cause error info loop #2235

Open justlooks opened 5 years ago

justlooks commented 5 years ago

this can not be stop until I type "kill -9"

Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 314, in 'calling callback function'
  File "/usr/lib/python2.7/site-packages/bcc/table.py", line 650, in raw_cb_
    callback(cpu, data, size)
  File "./fileslower", line 229, in print_event
    if event.name_len > DNAME_INLINE_LEN:
NameError: global name 'DNAME_INLINE_LEN' is not defined
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 314, in 'calling callback function'
  File "/usr/lib/python2.7/site-packages/bcc/table.py", line 650, in raw_cb_
    callback(cpu, data, size)
  File "./fileslower", line 229, in print_event
    if event.name_len > DNAME_INLINE_LEN:
NameError: global name 'DNAME_INLINE_LEN' is not defined
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 314, in 'calling callback function'
  File "/usr/lib/python2.7/site-packages/bcc/table.py", line 650, in raw_cb_
    callback(cpu, data, size)
  File "./fileslower", line 229, in print_event
    if event.name_len > DNAME_INLINE_LEN:
NameError: global name 'DNAME_INLINE_LEN' is not defined
mcaleavya commented 5 years ago

Hey

What kernel and OS are you running? and version of bcc?

Al

On Wed, Feb 27, 2019 at 9:01 AM justlooks notifications@github.com wrote:

this can not be stop until I type "kill -9"

Traceback (most recent call last): File " ctypes/callbacks.c", line 314, in 'calling callback function' File "/usr/lib/python2.7/site-packages/bcc/table.py", line 650, in raw_cb callback(cpu, data, size) File "./fileslower", line 229, in print_event if event.name_len > DNAME_INLINE_LEN: NameError: global name 'DNAME_INLINE_LEN' is not defined Traceback (most recent call last): File " ctypes/callbacks.c", line 314, in 'calling callback function' File "/usr/lib/python2.7/site-packages/bcc/table.py", line 650, in raw_cb callback(cpu, data, size) File "./fileslower", line 229, in print_event if event.name_len > DNAME_INLINE_LEN: NameError: global name 'DNAME_INLINE_LEN' is not defined Traceback (most recent call last): File " ctypes/callbacks.c", line 314, in 'calling callback function' File "/usr/lib/python2.7/site-packages/bcc/table.py", line 650, in raw_cb callback(cpu, data, size) File "./fileslower", line 229, in print_event if event.name_len > DNAME_INLINE_LEN: NameError: global name 'DNAME_INLINE_LEN' is not defined

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/iovisor/bcc/issues/2235, or mute the thread https://github.com/notifications/unsubscribe-auth/ADPbVEI01yJiyMzcc_wi7bBIPjkbWkNpks5vRklggaJpZM4bUBct .

mcaleavya commented 5 years ago

ok I can see this with the latest version of bcc

root@henky:~/bcc/tools# ./fileslower.py 1 Tracing sync read/writes slower than 1 ms TIME(s) COMM TID D BYTES LAT(ms) FILENAME Traceback (most recent call last): File "_ctypes/callbacks.c", line 315, in 'calling callback function' File "/usr/lib/python2.7/dist-packages/bcc/table.py", line 650, in rawcb callback(cpu, data, size) File "./fileslower.py", line 229, in print_event if event.name_len > DNAME_INLINE_LEN: NameError: global name 'DNAME_INLINE_LEN' is not defined

I am not sure as to why this is failing now as compared to previously - but declaring DNAME_INLINE_LEN to be say 32 as a python variable resolves the issue - happy to do a pull request but would like to understand the failure more as this was showing as working on previous versions where I had a file > 32 chars it was limited and appended with dots.

root@henky:~/bcc/tools# ./fileslower.py 1 Tracing sync read/writes slower than 1 ms TIME(s) COMM TID D BYTES LAT(ms) FILENAME 3.268 prometheus 1285 W 3123 1.96 45030fed915769.db 13.267 prometheus 1285 W 3123 1.73 47f09950ff0807.db 23.274 prometheus 1351 W 3123 7.73 47fc9950ff014b.db 33.268 prometheus 1351 W 3123 1.93 5a665c3eabcb2c.db

Al

On Wed, Feb 27, 2019 at 9:24 AM allan.mcaleavy@gmail.com wrote:

Hey

What kernel and OS are you running? and version of bcc?

Al

On Wed, Feb 27, 2019 at 9:01 AM justlooks notifications@github.com wrote:

this can not be stop until I type "kill -9"

Traceback (most recent call last): File " ctypes/callbacks.c", line 314, in 'calling callback function' File "/usr/lib/python2.7/site-packages/bcc/table.py", line 650, in raw_cb callback(cpu, data, size) File "./fileslower", line 229, in print_event if event.name_len > DNAME_INLINE_LEN: NameError: global name 'DNAME_INLINE_LEN' is not defined Traceback (most recent call last): File " ctypes/callbacks.c", line 314, in 'calling callback function' File "/usr/lib/python2.7/site-packages/bcc/table.py", line 650, in raw_cb callback(cpu, data, size) File "./fileslower", line 229, in print_event if event.name_len > DNAME_INLINE_LEN: NameError: global name 'DNAME_INLINE_LEN' is not defined Traceback (most recent call last): File " ctypes/callbacks.c", line 314, in 'calling callback function' File "/usr/lib/python2.7/site-packages/bcc/table.py", line 650, in raw_cb callback(cpu, data, size) File "./fileslower", line 229, in print_event if event.name_len > DNAME_INLINE_LEN: NameError: global name 'DNAME_INLINE_LEN' is not defined

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/iovisor/bcc/issues/2235, or mute the thread https://github.com/notifications/unsubscribe-auth/ADPbVEI01yJiyMzcc_wi7bBIPjkbWkNpks5vRklggaJpZM4bUBct .

arighi commented 5 years ago

I think 51d62d36bd072530a238ac147a61b631fdc44659 broke it.

mcaleavya commented 5 years ago

Thanks I was wondering this morning where the ctype structures went but didn’t have a lot of time to investigate further

Al

On 27 Feb 2019, at 17:32, Andrea Righi notifications@github.com wrote:

I think 51d62d3 broke it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

boat0 commented 5 years ago

Fixed by #2236 . Thanks!

boat0 commented 5 years ago

Thanks I was wondering this morning where the ctype structures went but didn’t have a lot of time to investigate further Al

https://github.com/iovisor/bcc/commit/3156303439960602667b2e1dc05aebfe43ad0066