This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"time" | |
"github.com/Shopify/sarama" | |
"gopkg.in/confluentinc/confluent-kafka-go.v1/kafka" |
This file contains hidden or 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
Hey @l2g - thanks for putting this together. | |
I tried to set this up today but I'm running into trouble with the TLS certificates on repo.nuxref.com: | |
[code] | |
kj@hyp01:~$ sudo rpm -Uhi https://repo.nuxref.com/fedora/fc33/en/x86_64/custom/nuxref-release-1.0.0-5.fc33.nuxref.noarch.rpm | |
curl: (60) SSL certificate problem: unable to get local issuer certificate | |
More details here: https://curl.haxx.se/docs/sslcerts.html | |
curl failed to verify the legitimacy of the server and therefore could not |
This file contains hidden or 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
package jemalloc | |
/* | |
// This cgo directive is what actually causes jemalloc to be linked in to the | |
// final Go executable | |
#cgo pkg-config: jemalloc | |
#include <jemalloc/jemalloc.h> | |
void _refresh_jemalloc_stats() { |
This file contains hidden or 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
==731== 7,560 bytes in 315 blocks are still reachable in loss record 608 of 611 | |
==731== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) | |
==731== by 0x5362C35: OPENSSL_LH_insert (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1) | |
==731== by 0x533FF82: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1) | |
==731== by 0x53403AF: ERR_load_strings_const (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1) | |
==731== by 0x518C26F: ERR_load_SSL_strings (in /usr/lib/x86_64-linux-gnu/libssl.so.1.1) | |
==731== by 0x518C29C: ??? (in /usr/lib/x86_64-linux-gnu/libssl.so.1.1) | |
==731== by 0x4D3C47E: __pthread_once_slow (pthread_once.c:116) | |
==731== by 0x53CB74C: CRYPTO_THREAD_run_once (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1) | |
==731== by 0x518C64A: OPENSSL_init_ssl (in /usr/lib/x86_64-linux-gnu/libssl.so.1.1) |
This file contains hidden or 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 macros from SystemTap project | |
#include <sys/sdt.h> | |
// ... lots of librdkafka code ... | |
static RD_INLINE RD_UNUSED void *rd_malloc(size_t sz) { | |
void *p = malloc(sz); | |
rd_assert(p); | |
// Add a call to DTRACE_PROBE here to call our probe with the address |
This file contains hidden or 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
usdt:/usr/local/lib/librdkafka.so.1:librdkafka:rd_malloc { | |
@allocated_addrs[arg0] = ustack(); | |
@allocation_time[arg0] = nsecs; | |
} | |
usdt:/usr/local/lib/librdkafka.so.1:librdkafka:rd_free { | |
delete(@allocated_addrs[arg0]); | |
delete(@allocation_time[arg0]); | |
} |
This file contains hidden or 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
@allocated_addrs[140548392353792]: | |
0x7fd431f0d4d4 | |
0xb4fc7a | |
0x8b7845 | |
0x8c273d | |
0x8bb2b6 | |
0x937f85 | |
0x9426b8 | |
0x93f4d5 | |
0x93f9b9 |
This file contains hidden or 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 ruby | |
require 'open3' | |
@allocated_addrs = {} | |
@allocation_time = {} | |
@symbol_cache = {} | |
@app_pid = ARGV[0] | |
def resolve_symbol(addr) |
This file contains hidden or 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
Pointer at 140292879716464: | |
rd.h:130 | |
rdkafka_partition.c:2924 | |
rdkafka_cgrp.c:2730 | |
rdatomic.h:86 | |
rdkafka_op.c:830 | |
rdkafka_op.c:860 | |
rdkafka_queue.c:510 | |
rdkafka.c:2060 | |
pthread_create.c:474 |
This file contains hidden or 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 ruby | |
require 'open3' | |
# rubocop:disable Lint/MissingCopEnableDirective | |
# rubocop:disable Style/GlobalVars | |
$stdout_lock = Mutex.new | |
$stdout.sync = true | |
Thread.abort_on_exception = true |