Created
January 16, 2020 07:39
-
-
Save ethercflow/1ed2badb1d35e6b8d8aa8e47f6d49036 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package timechaos; | |
import "google/protobuf/empty.proto"; | |
service Inject { | |
rpc SetTimeval(Request) returns (google.protobuf.Empty) {} | |
rpc Recover(Request) returns (google.protobuf.Empty) {} | |
} | |
message Request { | |
uint32 pid = 1; | |
bool tid = 2; | |
int32 sec = 3; | |
int32 usec = 4; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
3 和 4 为偏差,假设期望某个进程访问时间函数时,时间超前 2min,则 sec 为 120s, usec 为 0;
当前 timeval 和 timespec 为 union 成员,所以暂时精度按 usec 算,以后根据需求看是否做分离;