Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output is not display the name of the function #1976

Open
d3monviking opened this issue Oct 8, 2024 · 7 comments
Open

Output is not display the name of the function #1976

d3monviking opened this issue Oct 8, 2024 · 7 comments

Comments

@d3monviking
Copy link

d3monviking commented Oct 8, 2024

Upon compiling and running uftrace locally, all the commands are displaying function's pointers (I guess), instead of their name. Here is a screenshot of the output I got on running the sample hello world file from the tutorial.

image

Upon running the -A and -R options for displaying the argument and the return value of the functions, the output isn't running as intended.

image

@namhyung
Copy link
Owner

namhyung commented Oct 8, 2024

I've checked your data and found something strange. The task.txt file shows this:

$ cat uftrace.data/task.txt 
SESS timestamp=4803.710931385 pid=116519 sid=361ba6f00622caf5 exename="/home/priyanshu/Desktop/uftrace practice/foobar"
TASK timestamp=4803.711096219 tid=116519 pid=116519
TASK timestamp=4803.711404436 tid=116522 pid=116519

I'm curious why the exename looks like that. It's supposed to have the path of the target binary only like below.

SESS timestamp=329054.713035896 pid=4025051 sid=5ca4a0a2dc928d11 exename="/usr/bin/pwd"
TASK timestamp=329054.713139792 tid=4025051 pid=4025051

@d3monviking
Copy link
Author

I am not sure why that happened. I tried to recreate this issue by deleting everything except the hello.c and compiled it with gcc -o hello -pg hello.c. After that I called uftrace hello and got this

image

I entered the record option with uftrace record pwd but I got the compiler error

ERROR: Can't find 'mcount' symbol in the '/bin/pwd'.
        It seems not to be compiled with -pg or -finstrument-functions flag
        which generates traceable code.  Please check your binary file. 

which wasn't the case in the previous attempt. Finally I recorded the trace data using --force option and here is what the task.txt file reads now:

SESS timestamp=8653.961016768 pid=53370 sid=e2c61a39838c1600 exename="/usr/bin/pwd"
TASK timestamp=8653.961142838 tid=53370 pid=53370

@namhyung
Copy link
Owner

namhyung commented Oct 9, 2024

Ok, can you show me the task.txt file after running uftrace record hello then?

@d3monviking
Copy link
Author

It just contains two lines of information (which was expected previously)

SESS timestamp=8653.961016768 pid=53370 sid=e2c61a39838c1600 exename="/usr/bin/pwd"
TASK timestamp=8653.961142838 tid=53370 pid=53370

@namhyung
Copy link
Owner

namhyung commented Oct 9, 2024

It's pwd not hello. But then I think it should show symbols in uftrace replay.

@d3monviking
Copy link
Author

d3monviking commented Oct 9, 2024

So I tried it again and upon running uftrace record hello, the task.txt file looked like this

SESS timestamp=1375.779041323 pid=6667 sid=63d766442d49887b exename="/home/priyanshu/Desktop/uftrace practice/hello"
TASK timestamp=1375.779242949 tid=6667 pid=6667

Here is a screenshot to the record and replay options
image

@namhyung
Copy link
Owner

It's strange that it has the exename including uftrace. I think it should be "/home/priyanshu/Desktop/practice/hello".

Is there anything special on your system or the binary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants