This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Written with ChatGPT | |
#include <iostream> | |
#include <chrono> | |
#include <format> | |
#include <print> | |
#include <fmt/core.h> | |
#include <fmt/format.h> | |
#include <fmt/chrono.h> | |
#include <fmt/ranges.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2024.12.10 14:13:33.100758 [ 3466 ] {b0c2bae7-e930-484d-9a98-26d972c8a985} <Trace> PushingToViews: Pushing (sequentially) from default.t_null (97ff26c2-3608-4b4b-b9a9-41696dd3f1a1) to default.t_mv (6ce3ce80-e1b0-4986-a79f-6c318399a8a6) took 21719 ms. | |
2024.12.10 14:13:33.100823 [ 3466 ] {} <Error> ThreadStatus: Untracked memory left: -96.00 B | |
2024.12.10 14:13:33.100969 [ 3135 ] {} <Trace> BaseDaemon: Received signal 6 | |
2024.12.10 14:13:33.101277 [ 13793 ] {} <Fatal> BaseDaemon: ########## Short fault info ############ | |
2024.12.10 14:13:33.101325 [ 13793 ] {} <Fatal> BaseDaemon: (version 24.12.1.1, build id: FBBF1E9C30254289BBFDF63093B967C2508ACB4C, git hash: 423da86c3064580c77679684d61b2b9d73da756f, architecture: x86_64) (from thread 3466) Received signal 6 | |
2024.12.10 14:13:33.101344 [ 13793 ] {} <Fatal> BaseDaemon: Signal description: Aborted | |
2024.12.10 14:13:33.101351 [ 13793 ] {} <Fatal> BaseDaemon: | |
2024.12.10 14:13:33.101370 [ 13793 ] {} <Fatal> BaseDaemon: Stack trace: 0x000000000c16f4ed 0x000000000c42cafc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pyinotify | |
def get_current_memory_cgroup_path(): | |
try: | |
with open("/proc/self/cgroup", "r") as f: | |
for line in f: | |
parts = line.strip().split(":") | |
if len(parts) == 3 and parts[1] == "": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import matplotlib.pyplot as plt | |
def hashsocket_1(fd): | |
return fd | |
def hashsocket_2(fd): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <atomic> | |
#include <bits/types/clockid_t.h> | |
#include <cstdint> | |
#include <cstdlib> | |
#include <ctime> | |
#include <cerrno> | |
#include <iostream> | |
#include <list> | |
#include <random> | |
#include <sched.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Measure overhead of fsync_part_directory for SELECTs from MergeTree/ReplicatedMergeTree (due to rename under lock) | |
# Refs: https://github.com/ClickHouse/ClickHouse/pull/64955 | |
set -e | |
bin=$1 && shift | |
id=$BASHPID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This is wrapper for faster addr2line, that is required for "perf --call-graph dwarf" | |
# NOTE: since v6.3 perf supports specifying addr2line and supports LLVM so it is not required there | |
# stdbuf is important here to avoid buffering, otherwise perf will stuck | |
stdbuf -o0 -i0 sed -e 's/,//' -e 's/^$/ffffffffffffff/' | llvm-addr2line "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/smart_ptr/detail/spinlock.hpp> | |
#include <cstdint> | |
#include <cstring> | |
#include <cassert> | |
#include <iostream> | |
#include <list> | |
#include <mutex> | |
#include <optional> | |
#include <shared_mutex> | |
#include <thread> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lscpu -J | jq '.lscpu.[] | select(.field == "Model name:").data' -r | |
AMD Ryzen Threadripper PRO 5975WX 32-Cores | |
$ musl-clang -static -O3 -o test-syscalls test-syscalls.cpp | |
$ ldd test-syscalls | |
not a dynamic executable | |
$ ./test-syscalls | |
gettid: 48735.848us, 20518777.061 cps, 48.736 ns per call | |
clock_gettime (VDSO): 20660.516us, 48401501.686 cps, 20.661 ns per call | |
nothing_indirect_call: 0.020us, 50000000000000.000 cps, 0.000 ns per call | |
nothing: 0.020us, 50000000000000.000 cps, 0.000 ns per call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <ctime> | |
#include <cerrno> | |
#include <iostream> | |
#include <utility> | |
uint64_t now_ns(clockid_t clock) | |
{ | |
struct timespec ts; | |
clock_gettime(clock, &ts); |
NewerOlder