Skip to content

Commit

Permalink
Revert "maybe this is needed to propagate information for fork-based …
Browse files Browse the repository at this point in the history
…frameworks?"

This reverts commit 6422b64.
  • Loading branch information
taegyunkim committed Sep 18, 2024
1 parent 920a62b commit 2097785
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ extern "C"
void ddup_push_span_id(Datadog::Sample* sample, uint64_t span_id);
void ddup_push_local_root_span_id(Datadog::Sample* sample, uint64_t local_root_span_id);
void ddup_push_trace_type(Datadog::Sample* sample, std::string_view trace_type);
void ddup_push_trace_endpoint(Datadog::Sample* sample, std::string_view trace_endpoint);
void ddup_push_exceptioninfo(Datadog::Sample* sample, std::string_view exception_type, int64_t count);
void ddup_push_class_name(Datadog::Sample* sample, std::string_view class_name);
void ddup_push_frame(Datadog::Sample* sample,
Expand All @@ -64,8 +63,8 @@ extern "C"
void ddup_drop_sample(Datadog::Sample* sample);

// Proxy function to next Profile
void ddup_add_trace_endpoint(uint64_t local_root_span_id, std::string_view trace_endpoint);
void ddup_add_endpoint_count(std::string_view trace_endpoint, int64_t count);
void ddup_push_trace_endpoint(uint64_t local_root_span_id, std::string_view trace_endpoint);
void ddup_push_endpoint_count(std::string_view trace_endpoint, int64_t count);
#ifdef __cplusplus
} // extern "C"
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ namespace Datadog {
X(span_id, "span id") \
X(local_root_span_id, "local root span id") \
X(trace_type, "trace type") \
X(trace_endpoint, "trace endpoint") \
X(class_name, "class name") \
X(lock_name, "lock name")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class Sample
bool push_span_id(uint64_t span_id);
bool push_local_root_span_id(uint64_t local_root_span_id);
bool push_trace_type(std::string_view trace_type);
bool push_trace_endpoint(std::string_view trace_endpoint);
bool push_exceptioninfo(std::string_view exception_type, int64_t count);
bool push_class_name(std::string_view class_name);
bool push_monotonic_ns(int64_t monotonic_ns);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@ ddup_push_trace_type(Datadog::Sample* sample, std::string_view trace_type) // cp
sample->push_trace_type(trace_type);
}

void
ddup_push_trace_endpoint(Datadog::Sample* sample, std::string_view trace_endpoint) // cppcheck-suppress unusedFunction
{
sample->push_trace_endpoint(trace_endpoint);
}

void
ddup_push_exceptioninfo(Datadog::Sample* sample, // cppcheck-suppress unusedFunction
std::string_view exception_type,
Expand Down Expand Up @@ -315,8 +309,8 @@ ddup_upload() // cppcheck-suppress unusedFunction
}

void
ddup_add_trace_endpoint(uint64_t local_root_span_id,
std::string_view trace_endpoint) // cppcheck-suppress unusedFunction
ddup_push_trace_endpoint(uint64_t local_root_span_id,
std::string_view trace_endpoint) // cppcheck-suppress unusedFunction
{
ddog_prof_Profile& profile = Datadog::Sample::profile_borrow();
ddog_CharSlice trace_endpoint_slice = Datadog::to_slice(trace_endpoint);
Expand All @@ -335,7 +329,7 @@ ddup_add_trace_endpoint(uint64_t local_root_span_id,
}

void
ddup_add_endpoint_count(std::string_view trace_endpoint, int64_t count)
ddup_push_endpoint_count(std::string_view trace_endpoint, int64_t count)
{
ddog_prof_Profile& profile = Datadog::Sample::profile_borrow();
ddog_CharSlice trace_endpoint_slice = Datadog::to_slice(trace_endpoint);
Expand Down
10 changes: 0 additions & 10 deletions ddtrace/internal/datadog/profiling/dd_wrapper/src/sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,6 @@ Datadog::Sample::push_trace_type(std::string_view trace_type)
return true;
}

bool
Datadog::Sample::push_trace_endpoint(std::string_view trace_endpoint)
{
if (!push_label(ExportLabelKey::trace_endpoint, trace_endpoint)) {
std::cout << "bad push" << std::endl;
return false;
}
return true;
}

bool
Datadog::Sample::push_class_name(std::string_view class_name)
{
Expand Down
16 changes: 5 additions & 11 deletions ddtrace/internal/datadog/profiling/ddup/_ddup.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,15 @@ cdef extern from "ddup_interface.hpp":
void ddup_push_span_id(Sample *sample, uint64_t span_id)
void ddup_push_local_root_span_id(Sample *sample, uint64_t local_root_span_id)
void ddup_push_trace_type(Sample *sample, string_view trace_type)
void ddup_push_trace_endpoint(Sample *sample, string_view trace_endpoint)
void ddup_push_trace_endpoint(uint64_t local_root_span_id, string_view trace_endpoint)
void ddup_push_endpoint_count(string_view trace_endpoint, int64_t count)
void ddup_push_exceptioninfo(Sample *sample, string_view exception_type, int64_t count)
void ddup_push_class_name(Sample *sample, string_view class_name)
void ddup_push_frame(Sample *sample, string_view _name, string_view _filename, uint64_t address, int64_t line)
void ddup_push_monotonic_ns(Sample *sample, int64_t monotonic_ns)
void ddup_flush_sample(Sample *sample)
void ddup_drop_sample(Sample *sample)

void ddup_set_runtime_id(string_view _id)
void ddup_add_trace_endpoint(uint64_t local_root_span_id, string_view trace_endpoint)
void ddup_add_endpoint_count(string_view trace_endpoint, int64_t count)
bint ddup_upload() nogil

# Create wrappers for cython
Expand Down Expand Up @@ -181,16 +179,16 @@ def upload(processsor: EndpointCallCounterProcessor) -> None:
for span_id, resource in span_ids.items():
resource_bytes = ensure_binary_or_empty(resource)
span_id = clamp_to_uint64_unsigned(span_id)
ddup_add_trace_endpoint(
ddup_push_trace_endpoint(
span_id,
string_view(<const char*>resource_bytes, len(resource_bytes)),
)

for resource, cnt in counts.items():
resource_bytes = ensure_binary_or_empty(resource)
cnt = clamp_to_int64_unsigned(cnt)
print("ddup_add_endpoint_count", resource_bytes, cnt)
ddup_add_endpoint_count(
print("ddup_push_endpoint_count", resource_bytes, cnt)
ddup_push_endpoint_count(
string_view(<const char*>resource_bytes, len(resource_bytes)),
cnt
)
Expand Down Expand Up @@ -312,10 +310,6 @@ cdef class SampleHandle:
if span._local_root.span_type:
span_type_bytes = ensure_binary_or_empty(span._local_root.span_type)
ddup_push_trace_type(self.ptr, string_view(<const char*>span_type_bytes, len(span_type_bytes)))
if endpoint_collection_enabled and span._local_root.resource:
print("ddup_push_trace_endpoint", span._local_root.resource)
resource_bytes = ensure_binary_or_empty(span._local_root.resource)
ddup_push_trace_endpoint(self.ptr, string_view(<const char*>resource_bytes, len(resource_bytes)))

def push_monotonic_ns(self, monotonic_ns: int) -> None:
if self.ptr is not NULL:
Expand Down

0 comments on commit 2097785

Please sign in to comment.