-
Notifications
You must be signed in to change notification settings - Fork 473
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
tracing library calls even if it has no PLT #592
Comments
Pushed review/libcall-noplt-v2 Changelog:
|
In my system, |
What's the version of gcc? Could you (force) trace the pwd binary? |
Pushed review/libcall-noplt-v3 Changelog:
|
I use
|
Ah, you said it has PLT. OK then. Could you please build a simple program (abc.c) with |
Hmm..
So I tried it with
Tested with
But it's very strange that function
The function
It seems that |
Yes, as you showed it didn't have the |
Pushed review/libcall-noplt-v4 Changelog:
|
Tested on Manjaro Linux (Arch Linux), and it works great! Really thrilled with using this feature! log
$ readelf -S /usr/bin/mv | grep plt
$ readelf -S /usr/bin/pwd | grep plt
$ readelf -S /usr/bin/ls | grep plt
$ uftrace -a --force /usr/bin/ls
# DURATION TID FUNCTION
128.716 us [ 4952] | strrchr("/usr/bin/ls", '/') = "/ls";
81.590 us [ 4952] | setlocale();
0.911 us [ 4952] | bindtextdomain();
0.582 us [ 4952] | textdomain();
0.269 us [ 4952] | __cxa_atexit();
1.660 us [ 4952] | isatty();
1.111 us [ 4952] | getenv("QUOTING_STYLE") = "NULL";
0.515 us [ 4952] | getenv("COLUMNS") = "NULL";
1.073 us [ 4952] | ioctl(1, 21523, 0x7ffc3ba10290) = -1;
0.389 us [ 4952] | getenv("TABSIZE") = "NULL";
5.343 us [ 4952] | getopt_long();
0.423 us [ 4952] | getenv("LS_BLOCK_SIZE") = "NULL";
0.409 us [ 4952] | getenv("BLOCK_SIZE") = "NULL";
0.464 us [ 4952] | getenv("BLOCKSIZE") = "NULL";
0.350 us [ 4952] | getenv("POSIXLY_CORRECT") = "NULL";
0.287 us [ 4952] | getenv("BLOCK_SIZE") = "NULL";
0.159 us [ 4952] | __errno_location();
0.286 us [ 4952] | malloc(56) = 0x56400ec7f9d0;
0.348 us [ 4952] | memcpy(0x56400ec7f9d0, 0x56400ce1b520, 56);
0.115 us [ 4952] | __errno_location();
0.163 us [ 4952] | malloc(56) = 0x56400ec4d280;
0.170 us [ 4952] | memcpy(0x56400ec4d280, 0x56400ce1b520, 56);
0.380 us [ 4952] | getenv("TZ") = "NULL";
0.208 us [ 4952] | malloc(128) = 0x56400ec600e0;
2.981 us [ 4952] | malloc(20000) = 0x56400ecd68f0;
0.293 us [ 4952] | malloc(32) = 0x56400ecdb720;
0.347 us [ 4952] | strlen(".") = 1;
0.253 us [ 4952] | malloc(2) = 0x56400ecdb750;
0.204 us [ 4952] | memcpy(0x56400ecdb750, 0x56400ce12f95, 2);
0.104 us [ 4952] | __errno_location();
7.142 us [ 4952] | opendir();
20.885 us [ 4952] | readdir();
2.568 us [ 4952] | closedir();
2.566 us [ 4952] | _setjmp();
0.256 us [ 4952] | free(0x56400ecdb750);
0.196 us [ 4952] | free(0);
0.173 us [ 4952] | free(0x56400ecdb720);
0.370 us [ 4952] | __fpending();
0.285 us [ 4952] | fileno();
0.280 us [ 4952] | __freading();
0.544 us [ 4952] | fflush();
1.323 us [ 4952] | fclose(0x7fbb9692c5c0) = 0;
0.122 us [ 4952] | fflush();
0.880 us [ 4952] | fclose(0x7fbb9692c4e0) = 0;
(END) |
I don't see library calls in my Ubuntu 17.04 machine.
Please see the detail logs below. objdump output
readelf -d output
readelf -r output
|
This is related to #119. |
Pushed review/libcall-noplt-v5 Changelog:
|
Thanks for the update. I just tested on Ubuntu 17.04 machine and it works fine now. Thanks! |
This change will enable tracing library calls have no PLT. As PLT is needed to trace those libcalls, uftrace make up a trampoline and fill necessary instructions there.
The code is available at review/libcall-noplt-v1 branch.
Before:
After:
The text was updated successfully, but these errors were encountered: