mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
selftests: net: pass bpftrace timeout to cmd()
The bpftrace() helper configures an interval based exit timer but does not propagate the timeout to the cmd object, which defaults to 5 seconds. Since the default BPFTRACE_TIMEOUT is 10 seconds, cmd.process() always raises a TimeoutExpired exception before bpftrace has a chance to exit gracefully. Pass timeout+5 to cmd() to allow bpftrace to complete gracefully. Note: this issue is masked by a bug in the way cmd() passes timeout, this is fixed in the next commit. Reviewed-by: Nimrod Oren <[email protected]> Signed-off-by: Gal Pressman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
1 parent
bd4d6b955d
commit
82562972b8
1 file changed
+2
-1
@@ -258,8 +258,9 @@ def bpftrace(expr, json=None, ns=None, host=None, timeout=None):
|
||||
cmd_arr += ['-f', 'json', '-q']
|
||||
if timeout:
|
||||
expr += ' interval:s:' + str(timeout) + ' { exit(); }'
|
||||
timeout += 5
|
||||
cmd_arr += ['-e', expr]
|
||||
cmd_obj = cmd(cmd_arr, ns=ns, host=host, shell=False)
|
||||
cmd_obj = cmd(cmd_arr, ns=ns, host=host, shell=False, timeout=timeout)
|
||||
if json:
|
||||
# bpftrace prints objects as lines
|
||||
ret = {}
|
||||
|
||||
Reference in new issue
Block a user