Open kangheng opened 4 weeks ago
+1
can you add shebang
to your python script
chmod +x conv2d.py
then
uftrace record conv2d.py
can you add
shebang
to your python script!/usr/bin/env python3
chmod +x conv2d.py
then
uftrace record conv2d.py
I have added shebang to my python script, but it still fails
$ uftrace record -P . ./conv2d.py
WARN: Segmentation fault: address not mapped (addr: (nil))
WARN: if this happens only with uftrace, please consider -e/--estimate-return option.
WARN: Backtrace from uftrace v0.16 ( x86_64 dwarf python3 luajit tui perf sched dynamic )
WARN: =====================================
WARN: [10] (call_trampoline[557f2695897c] <= profile_trampoline[557f26958ab7])
WARN: [9] (call_trace_protected[557f26909514] <= _PyEval_EvalFrameDefault.cold.2787[557f2699c00c])
WARN: [8] (PyEval_EvalFrameEx[557f269b43d5] <= _PyEval_EvalCodeWithName[557f26a21c32])
WARN: [7] (PyEval_EvalCode[557f26ab5f45] <= run_eval_code_obj[557f26ab6004])
WARN: [6] (PyRun_StringFlags[557f26aee575] <= builtin_exec[557f26aeeffc])
WARN: [5] (trace_call_function[557f2691c0ac] <= _PyEval_EvalFrameDefault.cold.2787[557f2699c417])
WARN: [4] (PyEval_EvalFrameEx[557f269b43d5] <= _PyEval_EvalCodeWithName[557f26a21c32])
WARN: [3] (PyEval_EvalCode[557f26ab5f45] <= builtin_exec[557f26aeef33])
WARN: [2] (PyEval_EvalFrameEx[557f269b43d5] <= _PyEval_EvalCodeWithName[557f26a21c32])
WARN: [1] (PyEval_EvalFrameEx[557f269b43d5] <= _PyEval_EvalCodeWithName[557f26a21c32])
WARN: [0] (Py_BytesMain[557f26aeeb95] <= __libc_start_main[7f1166c1a493])
Please report this bug to https://github.com/namhyung/uftrace/issues.
WARN: child terminated by signal: 11: Segmentation fault
You should remove -P .
in this case.
Do you want to trace python function or python interpreter itself, which is written in C?
You should remove
-P .
in this case.Do you want to trace python function or python interpreter itself, which is written in C?
I want to trace the C/C++ interface functions in pytorch
Then it will need more fine tuned argument usage. Having python conv2d.py
shows python interpreter mostly so you should hide those, then it will eventually call some native functions of pytorch. But -P .
is only applied to the python
interpreter so you won't be able to see native functions of pytorch. Firstly, you need to find which binary file has pytorch native functions.
Then it will need more fine tuned argument usage. Having
python conv2d.py
shows python interpreter mostly so you should hide those, then it will eventually call some native functions of pytorch. But-P .
is only applied to thepython
interpreter so you won't be able to see native functions of pytorch. Firstly, you need to find which binary file has pytorch native functions.
When I added the "-e" option, although I couldn't record the exit time, I was able to trace the function interface of pytorch. $ uftrace record -e -P . python conv2d.py
I've recorded the following pytorch program with uftrace.
It works fine without uftrace.
But it fails when running with uftrace as follows.