mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
GPU profilers (Nsight Systems/CUPTI) build their trace timeline from CLOCK_MONOTONIC_RAW. gVisor serves CLOCK_MONOTONIC_RAW as an alias of CLOCK_MONOTONIC, this will drift from CLOCK_MONOTONIC_RAW breaking profiling. When nvproxy is enabled with `capProfiling`, this change exposes CLOCK_MONOTONIC_RAW as a clock distinct from CLOCK_MONOTONIC that tracks the host's CLOCK_MONOTONIC_RAW (absolute, unadjusted). CLOCK_MONOTONIC is unchanged. When profiling is disabled, CLOCK_MONOTONIC_RAW continues to alias CLOCK_MONOTONIC as before.
29 lines
864 B
C++
29 lines
864 B
C++
// Copyright 2018 The gVisor Authors.
|
|
//
|
|
// 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.
|
|
|
|
#ifndef VDSO_VDSO_TIME_H_
|
|
#define VDSO_VDSO_TIME_H_
|
|
|
|
#include <time.h>
|
|
|
|
namespace vdso {
|
|
|
|
int ClockRealtime(struct timespec* ts);
|
|
int ClockMonotonic(struct timespec* ts);
|
|
int ClockMonotonicRaw(struct timespec* ts);
|
|
|
|
} // namespace vdso
|
|
|
|
#endif // VDSO_VDSO_TIME_H_
|