summaryrefslogtreecommitdiffstats
path: root/yql/essentials/utils/debug_info.cpp
diff options
context:
space:
mode:
authorvvvv <[email protected]>2025-10-06 11:26:09 +0300
committervvvv <[email protected]>2025-10-06 11:53:26 +0300
commit60f45e69a4d7dbc6131208e16c45faf35aa5a985 (patch)
tree4daa45b52c295a178c7620e4c93921465fcf7950 /yql/essentials/utils/debug_info.cpp
parent1bded1a65a7e6e9171418f3e1c691d390125b64e (diff)
YQL-20086 utils
init commit_hash:54feccd520ebd0ab23612bc0cb830914dff9d0e8
Diffstat (limited to 'yql/essentials/utils/debug_info.cpp')
-rw-r--r--yql/essentials/utils/debug_info.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/yql/essentials/utils/debug_info.cpp b/yql/essentials/utils/debug_info.cpp
index ff56166695e..bfb390864fe 100644
--- a/yql/essentials/utils/debug_info.cpp
+++ b/yql/essentials/utils/debug_info.cpp
@@ -7,25 +7,22 @@
#include <string.h>
-
namespace NYql {
static const size_t OPERATION_ID_MAX_LENGTH = 24;
static const size_t THREAD_NAME_MAX_LENGTH = 16;
-
struct TDebugInfo {
char OperationId[OPERATION_ID_MAX_LENGTH + 1];
};
Y_POD_THREAD(TDebugInfo) TlsDebugInfo;
-
void SetCurrentOperationId(const char* operationId) {
size_t len = strlcpy(
- (&TlsDebugInfo)->OperationId,
- operationId,
- OPERATION_ID_MAX_LENGTH);
+ (&TlsDebugInfo)->OperationId,
+ operationId,
+ OPERATION_ID_MAX_LENGTH);
const char* threadName = nullptr;
if (len > THREAD_NAME_MAX_LENGTH) {
@@ -38,11 +35,11 @@ void SetCurrentOperationId(const char* operationId) {
long GetRunnigThreadsCount() {
TString procStat = TFileInput("/proc/self/stat").ReadAll();
- long num_threads = -2; // Number of threads in this process (since Linux 2.6)
+ long num_threads = -2; // Number of threads in this process (since Linux 2.6)
int n = sscanf(procStat.data(),
- "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %*u %*d %*d %*d %*d %ld",
- &num_threads);
+ "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %*u %*d %*d %*d %*d %ld",
+ &num_threads);
return n == 1 ? num_threads : -2;
}