Skip to content

Show nanoseconds in strace log#2642

Merged
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:strace-log-nanoseconds
Jan 4, 2023
Merged

Show nanoseconds in strace log#2642
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:strace-log-nanoseconds

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler commented Jan 4, 2023

This can be useful when matching the strace log with the shadow log, or for seeing where syscall latency is applied.

Before:

00:00:01.000 [tid 1000] socket(Inet, 1, 0) = 3
00:00:01.000 [tid 1000] socket(Inet, 1, 0) = 4
00:00:01.000 [tid 1000] bind(3, 0x7fffffffdc88, 16) = 0
00:00:01.000 [tid 1000] getsockname(3, 0x7fffffffdc88, 16 (0x7fffffffdcf0)) = 0
00:00:01.000 [tid 1000] listen(3, 10) = 0
00:00:01.000 [tid 1000] connect(4, 0x7fffffffddec, 16) = 0
00:00:01.002 [tid 1000] nanosleep(...) = 0
00:00:01.002 [tid 1000] connect(4, 0x7fffffffe14c, 16) = -106 (EISCONN: Transport endpoint is already connected)
00:00:01.002 [tid 1000] close(4) = 0
00:00:01.002 [tid 1000] close(3) = 0

After:

00:00:01.000097028 [tid 1000] socket(Inet, 1, 0) = 3
00:00:01.000099028 [tid 1000] socket(Inet, 1, 0) = 4
00:00:01.000099028 [tid 1000] bind(3, 0x7fffffffdc88, 16) = 0
00:00:01.000101028 [tid 1000] getsockname(3, 0x7fffffffdc88, 16 (0x7fffffffdcf0)) = 0
00:00:01.000101028 [tid 1000] listen(3, 10) = 0
00:00:01.000103030 [tid 1000] connect(4, 0x7fffffffddec, 16) = 0
00:00:01.002103030 [tid 1000] nanosleep(...) = 0
00:00:01.002103030 [tid 1000] connect(4, 0x7fffffffe14c, 16) = -106 (EISCONN: Transport endpoint is already connected)
00:00:01.002105030 [tid 1000] close(4) = 0
00:00:01.002105030 [tid 1000] close(3) = 0

This can be useful when matching the strace log with the shadow log, or for
seeing where syscall latency is applied.
@stevenengler stevenengler self-assigned this Jan 4, 2023
@github-actions github-actions bot added the Component: Main Composing the core Shadow executable label Jan 4, 2023
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 4, 2023

Codecov Report

Base: 68.23% // Head: 66.99% // Decreases project coverage by -1.23% ⚠️

Coverage data is based on head (44ec8ca) compared to base (fc18b7f).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2642      +/-   ##
==========================================
- Coverage   68.23%   66.99%   -1.24%     
==========================================
  Files         201      201              
  Lines       29496    29502       +6     
  Branches     5800     5800              
==========================================
- Hits        20126    19765     -361     
- Misses       4753     5165     +412     
+ Partials     4617     4572      -45     
Flag Coverage Δ
tests 66.99% <100.00%> (-1.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/host/syscall/formatter.rs 80.55% <100.00%> (ø)
src/main/utility/time.rs 55.26% <100.00%> (-13.49%) ⬇️
src/main/host/syscall/handler/eventfd.rs 0.00% <0.00%> (-72.23%) ⬇️
src/main/host/syscall/handler/time.rs 0.00% <0.00%> (-67.45%) ⬇️
src/main/host/descriptor/eventfd.rs 0.00% <0.00%> (-65.66%) ⬇️
src/main/host/syscall/handler/unistd.rs 52.96% <0.00%> (-19.77%) ⬇️
src/main/host/syscall/handler/fcntl.rs 47.14% <0.00%> (-18.58%) ⬇️
src/main/host/syscall/handler/ioctl.rs 42.85% <0.00%> (-17.15%) ⬇️
src/main/host/descriptor/pipe.rs 71.87% <0.00%> (-11.88%) ⬇️
... and 26 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stevenengler stevenengler enabled auto-merge January 4, 2023 21:39
@stevenengler stevenengler merged commit d031b60 into shadow:main Jan 4, 2023
@stevenengler stevenengler deleted the strace-log-nanoseconds branch January 4, 2023 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants