enlarge the size of ring buffer to 256
#
# Copyright 2019 Fastly, Toru Maesaka
+from __future__ import print_function
from bcc import BPF, USDT, __version__ as bcc_version
from collections import OrderedDict
import binascii, getopt, json, sys, time, os, platform
version = "0.0.1"
+ring_buffer_page_cnt = 256 # overridden by -b=N
+
# sudo itself if it is not running as root
if os.geteuid() != 0:
os.execvp("sudo", ["-E", sys.executable] + sys.argv)
@@ -804,8 +807,8 @@ BCC: %s
exit()
def trace_http():
- b["rxbuf"].open_perf_buffer(handle_req_line, page_cnt=128)
- b["txbuf"].open_perf_buffer(handle_resp_line, page_cnt=128)
+ b["rxbuf"].open_perf_buffer(handle_req_line, page_cnt=ring_buffer_page_cnt)
+ b["txbuf"].open_perf_buffer(handle_resp_line, page_cnt=ring_buffer_page_cnt)
while 1:
try:
@@ -814,7 +817,7 @@ def trace_http():
exit()
def trace_quic():
- b["events"].open_perf_buffer(handle_quic_event, page_cnt=128)
+ b["events"].open_perf_buffer(handle_quic_event, page_cnt=ring_buffer_page_cnt)
while 1:
try:
b.perf_buffer_poll()
