diff options
author | ruperts <ruperts@google.com> | 2017-11-28 21:17:48 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-11-28 21:19:26 -0800 |
commit | b394da457e9e1f717581b00926e811f6c9e018f3 (patch) | |
tree | de17a49a8222a84ca26a477a0a1f42300004471f /src/main/protobuf | |
parent | 85d69f2397d7b54fa8b8c69b7bc9ec6d36cb1d49 (diff) |
Make process-wrapper output execution statistics for executed commands.
For example, it now outputs resource usage statistics like the amount of user time and system time used.
RELNOTES: None
PiperOrigin-RevId: 177263221
Diffstat (limited to 'src/main/protobuf')
-rw-r--r-- | src/main/protobuf/BUILD | 13 | ||||
-rw-r--r-- | src/main/protobuf/execution_statistics.proto | 47 |
2 files changed, 60 insertions, 0 deletions
diff --git a/src/main/protobuf/BUILD b/src/main/protobuf/BUILD index 89afb792ee..d48de4388e 100644 --- a/src/main/protobuf/BUILD +++ b/src/main/protobuf/BUILD @@ -5,6 +5,13 @@ load("//tools/build_rules:utilities.bzl", "java_library_srcs") load("//third_party/protobuf/3.4.0:protobuf.bzl", "py_proto_library") load("//third_party/grpc:build_defs.bzl", "java_grpc_library") +exports_files( + ["execution_statitics.proto"], + visibility = [ + "//src/test/shell/integration:process_wrapper_test", + ], +) + FILES = [ "action_cache", "android_deploy_info", @@ -15,6 +22,7 @@ FILES = [ "crosstool_config", "deps", "desugar_deps", + "execution_statistics", "extra_actions_base", "invocation_policy", "java_compilation", @@ -114,6 +122,11 @@ java_library_srcs( deps = ["//third_party/pprof:profile_java_proto"], ) +cc_proto_library( + name = "execution_statistics_cc_proto", + deps = [":execution_statistics_proto"], +) + filegroup( name = "srcs", srcs = glob(["**"]), diff --git a/src/main/protobuf/execution_statistics.proto b/src/main/protobuf/execution_statistics.proto new file mode 100644 index 0000000000..86bfe35b03 --- /dev/null +++ b/src/main/protobuf/execution_statistics.proto @@ -0,0 +1,47 @@ +// Copyright 2017 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package tools.protos; + +option java_package = "com.google.devtools.build.lib.shell"; +option java_outer_classname = "Protos"; + +// Verbatim representation of the rusage structure returned by getrusage(2). +// For further details on all these cryptic names, see that manual page. +message ResourceUsage { + int64 utime_sec = 1; // user CPU time used, seconds part + int64 utime_usec = 2; // user CPU time used, microseconds part + int64 stime_sec = 3; // system CPU time used, seconds part + int64 stime_usec = 4; // system CPU time used, microseconds part + int64 maxrss = 5; // maximum resident set size + int64 ixrss = 6; // integral shared memory size + int64 idrss = 7; // integral unshared data size + int64 isrss = 8; // integral unshared stack size + int64 minflt = 9; // page reclaims (soft page faults) + int64 majflt = 10; // page faults (hard page faults) + int64 nswap = 11; // swaps + int64 inblock = 12; // block input operations + int64 oublock = 13; // block output operations + int64 msgsnd = 14; // IPC messages sent + int64 msgrcv = 15; // IPC messages received + int64 nsignals = 16; // signals received + int64 nvcsw = 17; // voluntary context switches + int64 nivcsw = 18; // involuntary context switches +} + +message ExecutionStatistics { + ResourceUsage resource_usage = 1; +} |