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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74e3ac2900007b7750e3c3274833e1f713b6e85570db0aa738761ea99b517fe8
4
- data.tar.gz: 68ffc8d681328e4d5542e4bd4b3a98edfd08d69fa1b54342fdccbe8f9495bcf0
3
+ metadata.gz: f702b46d54df92652f7134c52d2b1f69419b886ff89ffa0034959232ac0d19e7
4
+ data.tar.gz: 1643574c4a00ad12776f683c9d2e4b2468b236933eb72d823e2a8bb87c38f98e
5
5
  SHA512:
6
- metadata.gz: 4f1e67870eac32734a7532f46f29b74589ec6d71c59c925fc02456f473a516218fbbf46fed730558f0b9525c585dbb2fbc088fcf9cbfb47e7f4b89adda7f4974
7
- data.tar.gz: 8f5ec74f112eb65a512dbcd7002b0db9a4da0d3a2124d3bd2e7106412c71009b36f92ff442efc87910a5a8829094c06e1ee93169c829ab893dd8e1bd86a81a4f
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 int function_index_for(struct pf2_ser *serializer, struct pf2_ser_function *function);
20
- static int location_index_for(struct pf2_ser *serializer, int function_index, int32_t lineno);
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, ULL2NUM(sample->native_stack[j]));
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 ? SIZET2NUM(sample->ruby_thread_id) : Qnil
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 int
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 int
336
- location_index_for(struct pf2_ser *serializer, int function_index, int32_t lineno) {
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
- int *stack;
11
+ size_t *stack; // array of location_indexes
10
12
  size_t stack_count;
11
- int *native_stack;
13
+ size_t *native_stack; // array of location_indexes
12
14
  size_t native_stack_count;
13
- size_t ruby_thread_id;
15
+ uintptr_t ruby_thread_id;
14
16
  uint64_t elapsed_ns;
15
17
  };
16
18
 
17
19
  struct pf2_ser_location {
18
- int function_index;
20
+ size_t function_index;
19
21
  int32_t lineno;
20
22
  size_t address;
21
23
  };
data/ext/pf2/session.c CHANGED
@@ -1,4 +1,3 @@
1
- #include <bits/time.h>
2
1
  #include <pthread.h>
3
2
  #include <signal.h>
4
3
  #include <stdatomic.h>
data/lib/pf2/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pf2
4
- VERSION = '0.11.0'
4
+ VERSION = '0.11.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pf2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Aritomo