-
Notifications
You must be signed in to change notification settings - Fork 523
Description
uftrace detects shebang in the first line as follows.
#!/usr/bin/env python3
But if it has some whitespaces at the beginning, it can't detect the shebang as follows.
#! /usr/bin/env python3
For example, when there is a script as follows.
$ cat p-abc.py
#! /usr/bin/env python3
import os
def c():
return os.getpid()
def b():
return c()
def a():
return b()
a()
The tracing result looks as follows.
$ uftrace p-abc.py
uftrace: /home/honggyu/work/uftrace/cmds/record.c:1580:find_in_path
ERROR: Cannot trace '': No such executable file.
The shebang with whitespaces is legal so we should fix our shebang detection logic.