On 10/03/2026 4:41, Jakub Kicinski wrote:
> On Sun, 8 Mar 2026 21:21:25 +0200 Gal Pressman wrote:
>> @@ -240,8 +240,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
> 
> it may be easy to miss that input arg is modified so..
> 
>>      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)
> 
> timeout=(timeout + 5)
> 
> here instead could potentially be cleaner, but up to you.

timeout is None by default, so I figured my version looks better than:
timeout=(timeout + 5) if timeout else None

Reply via email to