Skip to content

Commit

Permalink
tools: Update tcpdrop error message when the probe fails
Browse files Browse the repository at this point in the history
When tcpdrop tool fails to attach a kprobe to tcp_drop() function, the
error message suggest that the running kernel is too old. However,
tcp_drop() is a relatively small static function, so nowadays, it's
more likely that it has been inlined.

Update the error message to avoid to confuse the user.

Signed-off-by: Jerome Marchand <[email protected]>
  • Loading branch information
jeromemarchand authored and yonghong-song committed May 18, 2022
1 parent 9aa986a commit 44fdef3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/tcpdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def print_ipv6_event(cpu, data, size):
b.attach_kprobe(event="tcp_drop", fn_name="trace_tcp_drop")
else:
print("ERROR: tcp_drop() kernel function not found or traceable. "
"Older kernel versions not supported.")
"The kernel might be too old or the the function has been inlined.")
exit()
stack_traces = b.get_table("stack_traces")

Expand Down

0 comments on commit 44fdef3

Please sign in to comment.