Sha256: f1379b6a5891afe102f0d5a38cfd8f4a0c27a7c4d0b1282a03a320500b24d19a

Contents?: true

Size: 779 Bytes

Versions: 15

Compression:

Stored size: 779 Bytes

Contents

#pragma once

#include <stdbool.h>
#include <time.h>

// Contains the operating-system specific identifier needed to fetch CPU-time, and a flag to indicate if we failed to fetch it
typedef struct thread_cpu_time_id {
  bool valid;
  clockid_t clock_id;
} thread_cpu_time_id;

// Contains the current cpu time, and a flag to indicate if we failed to fetch it
typedef struct thread_cpu_time {
  bool valid;
  long result_ns;
} thread_cpu_time;

void self_test_clock_id(void);

// TODO: Remove this after the OldStack profiler gets removed
VALUE clock_id_for(VALUE self, VALUE thread);

// Safety: This function is assumed never to raise exceptions by callers
thread_cpu_time_id thread_cpu_time_id_for(VALUE thread);
thread_cpu_time thread_cpu_time_for(thread_cpu_time_id time_id);

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ddtrace-1.14.0 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.13.1 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.13.0 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.12.1 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.12.0 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.11.1 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.11.0 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.11.0.beta1 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.10.1 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.10.0 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.9.0 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.8.0 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.7.0 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.6.1 ext/ddtrace_profiling_native_extension/clock_id.h
ddtrace-1.6.0 ext/ddtrace_profiling_native_extension/clock_id.h