Skip to content

perf(profiling): remove utf8 check #13054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ add_cppcheck_target(
${CMAKE_CURRENT_SOURCE_DIR}
INCLUDE
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/include/vendored
${CMAKE_CURRENT_SOURCE_DIR}/include/util
${CMAKE_CURRENT_SOURCE_DIR}/..
${echion_SOURCE_DIR}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "stack_renderer.hpp"

#include "thread_span_links.hpp"
#include "utf8_validate.hpp"

#include "echion/strings.h"

Expand Down Expand Up @@ -144,17 +143,6 @@ StackRenderer::render_frame(Frame& frame)

auto line = frame.location.line;

// Normally, further utf-8 validation would be pointless here, but we may be reading data where the
// string pointer was valid, but the string is actually garbage data at the exact time of the read.
// This is rare, but blowing some cycles on early validation allows the sample to be retained by
// libdatadog, so we can evaluate the actual impact of this scenario in live scenarios.
static const std::string_view invalid = "<invalid_utf8>";
if (!utf8_check_is_valid(name_str.data(), name_str.size())) {
name_str = invalid;
}
if (!utf8_check_is_valid(filename_str.data(), filename_str.size())) {
filename_str = invalid;
}
// DEV: Echion pushes a dummy frame containing task name, and its line
// number is set to 0.
if (!pushed_task_name and line == 0) {
Expand Down
7 changes: 7 additions & 0 deletions releasenotes/notes/prof-perf-utf8-c3e0ea98c4a17e11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
#instructions:
fixes:
- |
profiling: reduces overhead of the v2 stack sampler by removing unnecessary
and expensive utf-8 validation

Loading