pf2 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/ext/pf2/serializer.c +8 -8
- data/ext/pf2/serializer.h +6 -4
- data/ext/pf2/session.c +0 -1
- data/lib/pf2/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f702b46d54df92652f7134c52d2b1f69419b886ff89ffa0034959232ac0d19e7
|
|
4
|
+
data.tar.gz: 1643574c4a00ad12776f683c9d2e4b2468b236933eb72d823e2a8bb87c38f98e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d543709dbfd9eabad98be5ac04660c4f5e1033bfaba12df7524b3ddeae352a895c0749480f1736e38b1f611cb1b068534262d0596743e43600ea63a9fc8a4b67
|
|
7
|
+
data.tar.gz: 632fc6ed85d8ad4ee9fd9f657265aa7b2150259e00006dbb128bc4e78a6e1a419256f1e3d3a2f7041c6988e4b05a5172501746391db011f42b8bb531061dd59c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.11.2] - 2025-12-28
|
|
4
|
+
|
|
5
|
+
0.11.1 was accidentally published without libbacktrace vendored.
|
|
6
|
+
|
|
7
|
+
## [0.11.1] - 2025-12-28
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Fixed issues preventing builds on macOS.
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
## [0.11.0] - 2025-12-27
|
|
4
15
|
|
|
5
16
|
### Added
|
data/ext/pf2/serializer.c
CHANGED
|
@@ -16,8 +16,8 @@ static struct pf2_ser_function extract_function_from_ruby_frame(VALUE frame);
|
|
|
16
16
|
static struct pf2_ser_function extract_function_from_native_pc(uintptr_t pc);
|
|
17
17
|
// static int backtrace_pcinfo_callback(void *data, uintptr_t pc, const char *filename, int lineno, const char *function);
|
|
18
18
|
static void pf2_backtrace_syminfo_callback(void *data, uintptr_t pc, const char *symname, uintptr_t symval, uintptr_t symsize);
|
|
19
|
-
static
|
|
20
|
-
static
|
|
19
|
+
static size_t function_index_for(struct pf2_ser *serializer, struct pf2_ser_function *function);
|
|
20
|
+
static size_t location_index_for(struct pf2_ser *serializer, size_t function_index, int32_t lineno);
|
|
21
21
|
static void ensure_samples_capacity(struct pf2_ser *serializer);
|
|
22
22
|
static void ensure_locations_capacity(struct pf2_ser *serializer);
|
|
23
23
|
static void ensure_functions_capacity(struct pf2_ser *serializer);
|
|
@@ -83,7 +83,7 @@ pf2_ser_prepare(struct pf2_ser *serializer, struct pf2_session *session) {
|
|
|
83
83
|
ensure_samples_capacity(serializer);
|
|
84
84
|
|
|
85
85
|
struct pf2_ser_sample *ser_sample = &serializer->samples[serializer->samples_count++];
|
|
86
|
-
ser_sample->ruby_thread_id = sample->context_pthread;
|
|
86
|
+
ser_sample->ruby_thread_id = (uintptr_t)sample->context_pthread;
|
|
87
87
|
ser_sample->elapsed_ns = sample->timestamp_ns - serializer->start_timestamp_ns;
|
|
88
88
|
|
|
89
89
|
// Copy and process Ruby stack frames
|
|
@@ -145,7 +145,7 @@ pf2_ser_to_ruby_hash(struct pf2_ser *serializer) {
|
|
|
145
145
|
VALUE native_stack = rb_ary_new_capa(sample->native_stack_count);
|
|
146
146
|
if (sample->native_stack != NULL) {
|
|
147
147
|
for (size_t j = 0; j < sample->native_stack_count; j++) {
|
|
148
|
-
rb_ary_push(native_stack,
|
|
148
|
+
rb_ary_push(native_stack, SIZET2NUM(sample->native_stack[j]));
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
rb_hash_aset(sample_hash, ID2SYM(rb_intern("native_stack")), native_stack);
|
|
@@ -154,7 +154,7 @@ pf2_ser_to_ruby_hash(struct pf2_ser *serializer) {
|
|
|
154
154
|
rb_hash_aset(
|
|
155
155
|
sample_hash,
|
|
156
156
|
ID2SYM(rb_intern("ruby_thread_id")),
|
|
157
|
-
sample->ruby_thread_id ?
|
|
157
|
+
sample->ruby_thread_id ? ULL2NUM(sample->ruby_thread_id) : Qnil
|
|
158
158
|
);
|
|
159
159
|
rb_hash_aset(sample_hash, ID2SYM(rb_intern("elapsed_ns")), ULL2NUM(sample->elapsed_ns));
|
|
160
160
|
|
|
@@ -304,7 +304,7 @@ pf2_backtrace_syminfo_callback(void *data, uintptr_t pc, const char *symname, ui
|
|
|
304
304
|
|
|
305
305
|
// Returns the index of the function in `functions`.
|
|
306
306
|
// Calling this method will modify `serializer->profile` in place.
|
|
307
|
-
static
|
|
307
|
+
static size_t
|
|
308
308
|
function_index_for(struct pf2_ser *serializer, struct pf2_ser_function *function) {
|
|
309
309
|
for (size_t i = 0; i < serializer->functions_count; i++) {
|
|
310
310
|
struct pf2_ser_function *existing = &serializer->functions[i];
|
|
@@ -332,8 +332,8 @@ function_index_for(struct pf2_ser *serializer, struct pf2_ser_function *function
|
|
|
332
332
|
|
|
333
333
|
// Returns the index of the location in `locations`.
|
|
334
334
|
// Calling this method will modify `self.profile` in place.
|
|
335
|
-
static
|
|
336
|
-
location_index_for(struct pf2_ser *serializer,
|
|
335
|
+
static size_t
|
|
336
|
+
location_index_for(struct pf2_ser *serializer, size_t function_index, int32_t lineno) {
|
|
337
337
|
for (size_t i = 0; i < serializer->locations_count; i++) {
|
|
338
338
|
struct pf2_ser_location *existing = &serializer->locations[i];
|
|
339
339
|
if (existing->function_index == function_index && existing->lineno == lineno) {
|
data/ext/pf2/serializer.h
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
#ifndef PF2C_SERIALIZER_H
|
|
2
2
|
#define PF2C_SERIALIZER_H
|
|
3
3
|
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
|
|
4
6
|
#include <ruby.h>
|
|
5
7
|
|
|
6
8
|
#include "session.h"
|
|
7
9
|
|
|
8
10
|
struct pf2_ser_sample {
|
|
9
|
-
|
|
11
|
+
size_t *stack; // array of location_indexes
|
|
10
12
|
size_t stack_count;
|
|
11
|
-
|
|
13
|
+
size_t *native_stack; // array of location_indexes
|
|
12
14
|
size_t native_stack_count;
|
|
13
|
-
|
|
15
|
+
uintptr_t ruby_thread_id;
|
|
14
16
|
uint64_t elapsed_ns;
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
struct pf2_ser_location {
|
|
18
|
-
|
|
20
|
+
size_t function_index;
|
|
19
21
|
int32_t lineno;
|
|
20
22
|
size_t address;
|
|
21
23
|
};
|
data/ext/pf2/session.c
CHANGED
data/lib/pf2/version.rb
CHANGED