pf2 0.11.3 → 1.0.0.alpha1
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 +0 -50
- data/README.md +0 -22
- data/Rakefile +0 -5
- data/ext/pf2/pf2.c +8 -8
- data/ext/pf2/sample.c +3 -1
- data/ext/pf2/sample.h +4 -5
- data/ext/pf2/serializer.c +8 -8
- data/ext/pf2/serializer.h +4 -6
- data/ext/pf2/session.c +12 -46
- data/ext/pf2/session.h +2 -2
- data/lib/pf2/reporter/stack_weaver.rb +1 -1
- data/lib/pf2/session.rb +9 -0
- data/lib/pf2/version.rb +1 -1
- data/lib/pf2.rb +2 -1
- metadata +3 -32
- data/.document +0 -3
- data/.rdoc_options +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9f219b8aa5b5281a6ed662a085e00f82636ab52365d2b0f7a8d61a3e06bfc9c6
|
|
4
|
+
data.tar.gz: 162e1eae488afe17e33291f63f807642aa304d7df8069cb165e3a25ce6f10895
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 37b6a1aa4f6ab0753d86983d76cbdfae4b3dfbb7464afb0388aa113d728725f09eabcabb2ae7c2ffadc5ab797be75675b5b27b465c20565d5d69f30291d4837f
|
|
7
|
+
data.tar.gz: 7b69aea55c8873cfd6e28fba3bdddd09325e4c73e1e3e44a5be48fcb9ad776b03e811c707fc049ad8ccc1590e7c011032be7f4053e3d15a5ba5b50c4344db656
|
data/CHANGELOG.md
CHANGED
|
@@ -1,52 +1,5 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
-
## [0.11.3] - 2025-12-28
|
|
4
|
-
|
|
5
|
-
This version is for testing the new release process through [Trusted Publishing](https://guides.rubygems.org/trusted-publishing/). All code is identical to 0.11.2.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## [0.11.2] - 2025-12-28
|
|
9
|
-
|
|
10
|
-
0.11.1 was yanked since it was accidentally published without libbacktrace vendored. Use 0.11.2.
|
|
11
|
-
|
|
12
|
-
### Fixed
|
|
13
|
-
|
|
14
|
-
- Fixed issues preventing builds on macOS.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## [0.11.0] - 2025-12-27
|
|
18
|
-
|
|
19
|
-
### Added
|
|
20
|
-
|
|
21
|
-
- RDoc documentation is now online - https://osyoyu.github.io/pf2/
|
|
22
|
-
- Native stack consolidation now supports LTO-ed binaries (@hanazuki)
|
|
23
|
-
|
|
24
|
-
### Changed
|
|
25
|
-
|
|
26
|
-
- `Pf2c` module is now completely removed. `Pf2c::Session` has been merged as `Pf2::Session`.
|
|
27
|
-
|
|
28
|
-
### Fixed
|
|
29
|
-
|
|
30
|
-
- Fixed an bug where the program crashes when a `Pf2::Session` is GC'd before profiling starts.
|
|
31
|
-
- Fixed an bug where the program crashes when the native stack was more than 200 frames deep.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## [0.10.0] - 2025-12-26
|
|
35
|
-
|
|
36
|
-
### Added
|
|
37
|
-
|
|
38
|
-
**This version contains a complete rewrite of the profiler!**
|
|
39
|
-
|
|
40
|
-
- The default sample collection backend has been switched to the new C-based backend.
|
|
41
|
-
- The previous Rust-based backed has been removed. Use v0.9.0 if you need it.
|
|
42
|
-
- macOS / non-Linux platform support!
|
|
43
|
-
- On platforms which lack `timer_create(3)` such as macOS, Pf2 now fall backs to `setitimer(3)` based sampling. This mode does not support per-thread CPU time sampling.
|
|
44
|
-
|
|
45
|
-
### Changed
|
|
46
|
-
|
|
47
|
-
- `logger` is now declared as a dependency (Ruby 4.0 compat).
|
|
48
|
-
|
|
49
|
-
|
|
50
3
|
## [0.9.0] - 2025-03-22
|
|
51
4
|
|
|
52
5
|
## Added
|
|
@@ -58,7 +11,6 @@ This version is for testing the new release process through [Trusted Publishing]
|
|
|
58
11
|
|
|
59
12
|
- Set SA_RESTART flag to reduce EINTRs in profiled code
|
|
60
13
|
|
|
61
|
-
|
|
62
14
|
## [0.8.0] - 2025-01-27
|
|
63
15
|
|
|
64
16
|
## Added
|
|
@@ -67,14 +19,12 @@ This version is for testing the new release process through [Trusted Publishing]
|
|
|
67
19
|
- This serializer is more efficient and has a smaller memory footprint than the default serializer.
|
|
68
20
|
- Ser2 still lacks some features, such as weaving of native stacks.
|
|
69
21
|
|
|
70
|
-
|
|
71
22
|
## [0.7.1] - 2025-01-02
|
|
72
23
|
|
|
73
24
|
### Fixed
|
|
74
25
|
|
|
75
26
|
- Reverted Cargo.lock version to 3 to support older versions of Rust (<1.78).
|
|
76
27
|
|
|
77
|
-
|
|
78
28
|
## [0.7.0] - 2025-01-03
|
|
79
29
|
|
|
80
30
|
### Changed
|
data/README.md
CHANGED
|
@@ -3,9 +3,6 @@ Pf2
|
|
|
3
3
|
|
|
4
4
|
A experimental sampling-based profiler for Ruby 3.3+.
|
|
5
5
|
|
|
6
|
-
- GitHub: https://github.com/osyoyu/pf2
|
|
7
|
-
- Documentation: https://osyoyu.github.io/pf2/
|
|
8
|
-
|
|
9
6
|
Notable Capabilites
|
|
10
7
|
--------
|
|
11
8
|
|
|
@@ -16,25 +13,6 @@ Notable Capabilites
|
|
|
16
13
|
Usage
|
|
17
14
|
--------
|
|
18
15
|
|
|
19
|
-
### Installation
|
|
20
|
-
|
|
21
|
-
You will need a C compiler to build the native extension.
|
|
22
|
-
|
|
23
|
-
Add this line to your application's Gemfile:
|
|
24
|
-
|
|
25
|
-
```ruby
|
|
26
|
-
gem 'pf2'
|
|
27
|
-
|
|
28
|
-
# When using the main branch, specify submodules: true
|
|
29
|
-
gem 'pf2', git: 'https://github.com/osyoyu/pf2.git', submodules: true
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Pf2 can be installed as a standalone CLI tool as well.
|
|
33
|
-
|
|
34
|
-
```console
|
|
35
|
-
gem install pf2
|
|
36
|
-
```
|
|
37
|
-
|
|
38
16
|
### Quickstart
|
|
39
17
|
|
|
40
18
|
Run your Ruby program through `pf2 serve`.
|
data/Rakefile
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
require 'bundler/gem_tasks'
|
|
2
2
|
require 'rake/extensiontask'
|
|
3
3
|
require 'minitest/test_task'
|
|
4
|
-
require 'rdoc/task'
|
|
5
4
|
|
|
6
5
|
task default: %i[]
|
|
7
6
|
|
|
@@ -16,7 +15,3 @@ Minitest::TestTask.create(:test) do |t|
|
|
|
16
15
|
t.warning = false
|
|
17
16
|
t.test_globs = ["test/**/*_test.rb"]
|
|
18
17
|
end
|
|
19
|
-
|
|
20
|
-
RDoc::Task.new do |doc|
|
|
21
|
-
doc.rdoc_dir = "_site" # for GitHub pages
|
|
22
|
-
end
|
data/ext/pf2/pf2.c
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
#include "session.h"
|
|
4
4
|
|
|
5
|
-
VALUE
|
|
5
|
+
VALUE rb_mPf2c;
|
|
6
6
|
|
|
7
7
|
RUBY_FUNC_EXPORTED void
|
|
8
8
|
Init_pf2(void)
|
|
9
9
|
{
|
|
10
|
-
|
|
11
|
-
VALUE
|
|
12
|
-
rb_define_alloc_func(
|
|
13
|
-
rb_define_method(
|
|
14
|
-
rb_define_method(
|
|
15
|
-
rb_define_method(
|
|
16
|
-
rb_define_method(
|
|
10
|
+
rb_mPf2c = rb_define_module("Pf2c");
|
|
11
|
+
VALUE rb_mPf2c_cSession = rb_define_class_under(rb_mPf2c, "Session", rb_cObject);
|
|
12
|
+
rb_define_alloc_func(rb_mPf2c_cSession, pf2_session_alloc);
|
|
13
|
+
rb_define_method(rb_mPf2c_cSession, "initialize", rb_pf2_session_initialize, -1);
|
|
14
|
+
rb_define_method(rb_mPf2c_cSession, "start", rb_pf2_session_start, 0);
|
|
15
|
+
rb_define_method(rb_mPf2c_cSession, "stop", rb_pf2_session_stop, 0);
|
|
16
|
+
rb_define_method(rb_mPf2c_cSession, "configuration", rb_pf2_session_configuration, 0);
|
|
17
17
|
}
|
data/ext/pf2/sample.c
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
#include "backtrace_state.h"
|
|
10
10
|
#include "sample.h"
|
|
11
11
|
|
|
12
|
+
const int PF2_SAMPLE_MAX_NATIVE_DEPTH = 300;
|
|
13
|
+
|
|
12
14
|
static int capture_native_backtrace(struct pf2_sample *sample);
|
|
13
15
|
static int backtrace_on_ok(void *data, uintptr_t pc);
|
|
14
16
|
|
|
@@ -27,7 +29,7 @@ pf2_sample_capture(struct pf2_sample *sample)
|
|
|
27
29
|
sample->context_pthread = pthread_self();
|
|
28
30
|
|
|
29
31
|
// Obtain the current stack from Ruby
|
|
30
|
-
sample->depth = rb_profile_frames(0,
|
|
32
|
+
sample->depth = rb_profile_frames(0, 200, sample->cmes, sample->linenos);
|
|
31
33
|
|
|
32
34
|
// Capture C-level backtrace
|
|
33
35
|
sample->native_stack_depth = capture_native_backtrace(sample);
|
data/ext/pf2/sample.h
CHANGED
|
@@ -5,18 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
#include <ruby.h>
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
#define PF2_SAMPLE_MAX_NATIVE_DEPTH 300
|
|
8
|
+
extern const int PF2_SAMPLE_MAX_NATIVE_DEPTH;
|
|
10
9
|
|
|
11
10
|
struct pf2_sample {
|
|
12
11
|
pthread_t context_pthread;
|
|
13
12
|
|
|
14
13
|
int depth;
|
|
15
|
-
VALUE cmes[
|
|
16
|
-
int linenos[
|
|
14
|
+
VALUE cmes[200];
|
|
15
|
+
int linenos[200];
|
|
17
16
|
|
|
18
17
|
size_t native_stack_depth;
|
|
19
|
-
uintptr_t native_stack[
|
|
18
|
+
uintptr_t native_stack[200];
|
|
20
19
|
|
|
21
20
|
uint64_t consumed_time_ns;
|
|
22
21
|
uint64_t timestamp_ns;
|
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 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);
|
|
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 =
|
|
86
|
+
ser_sample->ruby_thread_id = 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, ULL2NUM(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 ? SIZET2NUM(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 int
|
|
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 int
|
|
336
|
+
location_index_for(struct pf2_ser *serializer, int 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,23 +1,21 @@
|
|
|
1
1
|
#ifndef PF2C_SERIALIZER_H
|
|
2
2
|
#define PF2C_SERIALIZER_H
|
|
3
3
|
|
|
4
|
-
#include <stdint.h>
|
|
5
|
-
|
|
6
4
|
#include <ruby.h>
|
|
7
5
|
|
|
8
6
|
#include "session.h"
|
|
9
7
|
|
|
10
8
|
struct pf2_ser_sample {
|
|
11
|
-
|
|
9
|
+
int *stack;
|
|
12
10
|
size_t stack_count;
|
|
13
|
-
|
|
11
|
+
int *native_stack;
|
|
14
12
|
size_t native_stack_count;
|
|
15
|
-
|
|
13
|
+
size_t ruby_thread_id;
|
|
16
14
|
uint64_t elapsed_ns;
|
|
17
15
|
};
|
|
18
16
|
|
|
19
17
|
struct pf2_ser_location {
|
|
20
|
-
|
|
18
|
+
int function_index;
|
|
21
19
|
int32_t lineno;
|
|
22
20
|
size_t address;
|
|
23
21
|
};
|
data/ext/pf2/session.c
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#include <bits/time.h>
|
|
1
2
|
#include <pthread.h>
|
|
2
3
|
#include <signal.h>
|
|
3
4
|
#include <stdatomic.h>
|
|
@@ -27,7 +28,6 @@ static struct pf2_session *global_current_session = NULL;
|
|
|
27
28
|
static void *sample_collector_thread(void *arg);
|
|
28
29
|
static void sigprof_handler(int sig, siginfo_t *info, void *ucontext);
|
|
29
30
|
bool ensure_sample_capacity(struct pf2_session *session);
|
|
30
|
-
static void pf2_session_stop(struct pf2_session *session);
|
|
31
31
|
|
|
32
32
|
VALUE
|
|
33
33
|
rb_pf2_session_initialize(int argc, VALUE *argv, VALUE self)
|
|
@@ -251,20 +251,6 @@ rb_pf2_session_stop(VALUE self)
|
|
|
251
251
|
struct pf2_session *session;
|
|
252
252
|
TypedData_Get_Struct(self, struct pf2_session, &pf2_session_type, session);
|
|
253
253
|
|
|
254
|
-
pf2_session_stop(session);
|
|
255
|
-
|
|
256
|
-
// Create serializer and serialize
|
|
257
|
-
struct pf2_ser *serializer = pf2_ser_new();
|
|
258
|
-
pf2_ser_prepare(serializer, session);
|
|
259
|
-
VALUE result = pf2_ser_to_ruby_hash(serializer);
|
|
260
|
-
pf2_ser_free(serializer);
|
|
261
|
-
|
|
262
|
-
return result;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
static void
|
|
266
|
-
pf2_session_stop(struct pf2_session *session)
|
|
267
|
-
{
|
|
268
254
|
// Calculate duration
|
|
269
255
|
struct timespec end_time;
|
|
270
256
|
clock_gettime(CLOCK_MONOTONIC, &end_time);
|
|
@@ -291,6 +277,14 @@ pf2_session_stop(struct pf2_session *session)
|
|
|
291
277
|
// Terminate the collector thread
|
|
292
278
|
session->is_running = false;
|
|
293
279
|
pthread_join(*session->collector_thread, NULL);
|
|
280
|
+
|
|
281
|
+
// Create serializer and serialize
|
|
282
|
+
struct pf2_ser *serializer = pf2_ser_new();
|
|
283
|
+
pf2_ser_prepare(serializer, session);
|
|
284
|
+
VALUE result = pf2_ser_to_ruby_hash(serializer);
|
|
285
|
+
pf2_ser_free(serializer);
|
|
286
|
+
|
|
287
|
+
return result;
|
|
294
288
|
}
|
|
295
289
|
|
|
296
290
|
VALUE
|
|
@@ -317,32 +311,19 @@ pf2_session_alloc(VALUE self)
|
|
|
317
311
|
rb_raise(rb_eNoMemError, "Failed to allocate memory");
|
|
318
312
|
}
|
|
319
313
|
|
|
320
|
-
// is_running
|
|
321
|
-
session->is_running = false;
|
|
322
|
-
|
|
323
|
-
// timer
|
|
324
|
-
#ifdef HAVE_TIMER_CREATE
|
|
325
|
-
session->timer = (timer_t)0;
|
|
326
|
-
#else
|
|
327
|
-
session->timer = (struct itimerval){0};
|
|
328
|
-
#endif
|
|
329
|
-
|
|
330
|
-
// rbuf
|
|
331
314
|
session->rbuf = pf2_ringbuffer_new(1000);
|
|
332
315
|
if (session->rbuf == NULL) {
|
|
333
316
|
rb_raise(rb_eNoMemError, "Failed to allocate memory");
|
|
334
317
|
}
|
|
335
318
|
|
|
336
|
-
// is_marking
|
|
337
319
|
atomic_store_explicit(&session->is_marking, false, memory_order_relaxed);
|
|
338
|
-
|
|
339
|
-
// collector_thread
|
|
340
320
|
session->collector_thread = malloc(sizeof(pthread_t));
|
|
341
321
|
if (session->collector_thread == NULL) {
|
|
342
322
|
rb_raise(rb_eNoMemError, "Failed to allocate memory");
|
|
343
323
|
}
|
|
344
324
|
|
|
345
|
-
|
|
325
|
+
session->duration_ns = 0;
|
|
326
|
+
|
|
346
327
|
session->samples_index = 0;
|
|
347
328
|
session->samples_capacity = 500; // 10 seconds worth of samples at 50 Hz
|
|
348
329
|
session->samples = malloc(sizeof(struct pf2_sample) * session->samples_capacity);
|
|
@@ -350,14 +331,6 @@ pf2_session_alloc(VALUE self)
|
|
|
350
331
|
rb_raise(rb_eNoMemError, "Failed to allocate memory");
|
|
351
332
|
}
|
|
352
333
|
|
|
353
|
-
// start_time_realtime, start_time
|
|
354
|
-
session->start_time_realtime = (struct timespec){0};
|
|
355
|
-
session->start_time = (struct timespec){0};
|
|
356
|
-
|
|
357
|
-
// duration_ns
|
|
358
|
-
session->duration_ns = 0;
|
|
359
|
-
|
|
360
|
-
// configuration
|
|
361
334
|
session->configuration = NULL;
|
|
362
335
|
|
|
363
336
|
return TypedData_Wrap_Struct(self, &pf2_session_type, session);
|
|
@@ -400,15 +373,8 @@ pf2_session_dmark(void *sess)
|
|
|
400
373
|
void
|
|
401
374
|
pf2_session_dfree(void *sess)
|
|
402
375
|
{
|
|
376
|
+
// TODO: Ensure the uninstall process is complete before freeing the session
|
|
403
377
|
struct pf2_session *session = sess;
|
|
404
|
-
|
|
405
|
-
assert(session->is_running == false || session->is_running == true);
|
|
406
|
-
|
|
407
|
-
// Stop the session if it's still running
|
|
408
|
-
if (session->is_running) {
|
|
409
|
-
pf2_session_stop(session);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
378
|
pf2_configuration_free(session->configuration);
|
|
413
379
|
pf2_ringbuffer_free(session->rbuf);
|
|
414
380
|
free(session->samples);
|
data/ext/pf2/session.h
CHANGED
|
@@ -43,14 +43,14 @@ void pf2_session_dfree(void *sess);
|
|
|
43
43
|
size_t pf2_session_dsize(const void *sess);
|
|
44
44
|
|
|
45
45
|
static const rb_data_type_t pf2_session_type = {
|
|
46
|
-
.wrap_struct_name = "
|
|
46
|
+
.wrap_struct_name = "Pf2c::Session",
|
|
47
47
|
.function = {
|
|
48
48
|
.dmark = pf2_session_dmark,
|
|
49
49
|
.dfree = pf2_session_dfree,
|
|
50
50
|
.dsize = pf2_session_dsize,
|
|
51
51
|
},
|
|
52
52
|
.data = NULL,
|
|
53
|
-
.flags =
|
|
53
|
+
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
#endif // PF2_SESSION_H
|
data/lib/pf2/session.rb
ADDED
data/lib/pf2/version.rb
CHANGED
data/lib/pf2.rb
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative 'pf2/pf2'
|
|
4
|
+
require_relative 'pf2/session'
|
|
4
5
|
require_relative 'pf2/version'
|
|
5
6
|
|
|
6
7
|
module Pf2
|
|
7
8
|
class Error < StandardError; end
|
|
8
9
|
|
|
9
10
|
def self.start(...)
|
|
10
|
-
@@session = Session.new(...)
|
|
11
|
+
@@session = Pf2c::Session.new(...)
|
|
11
12
|
@@session.start
|
|
12
13
|
end
|
|
13
14
|
|
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.
|
|
4
|
+
version: 1.0.0.alpha1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daisuke Aritomo
|
|
@@ -9,20 +9,6 @@ bindir: exe
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
-
- !ruby/object:Gem::Dependency
|
|
13
|
-
name: logger
|
|
14
|
-
requirement: !ruby/object:Gem::Requirement
|
|
15
|
-
requirements:
|
|
16
|
-
- - ">="
|
|
17
|
-
- !ruby/object:Gem::Version
|
|
18
|
-
version: '0'
|
|
19
|
-
type: :runtime
|
|
20
|
-
prerelease: false
|
|
21
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
-
requirements:
|
|
23
|
-
- - ">="
|
|
24
|
-
- !ruby/object:Gem::Version
|
|
25
|
-
version: '0'
|
|
26
12
|
- !ruby/object:Gem::Dependency
|
|
27
13
|
name: rake-compiler
|
|
28
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -93,20 +79,6 @@ dependencies:
|
|
|
93
79
|
- - ">="
|
|
94
80
|
- !ruby/object:Gem::Version
|
|
95
81
|
version: '0'
|
|
96
|
-
- !ruby/object:Gem::Dependency
|
|
97
|
-
name: rdoc
|
|
98
|
-
requirement: !ruby/object:Gem::Requirement
|
|
99
|
-
requirements:
|
|
100
|
-
- - ">="
|
|
101
|
-
- !ruby/object:Gem::Version
|
|
102
|
-
version: '0'
|
|
103
|
-
type: :development
|
|
104
|
-
prerelease: false
|
|
105
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
-
requirements:
|
|
107
|
-
- - ">="
|
|
108
|
-
- !ruby/object:Gem::Version
|
|
109
|
-
version: '0'
|
|
110
82
|
email:
|
|
111
83
|
- osyoyu@osyoyu.com
|
|
112
84
|
executables:
|
|
@@ -115,8 +87,6 @@ extensions:
|
|
|
115
87
|
- ext/pf2/extconf.rb
|
|
116
88
|
extra_rdoc_files: []
|
|
117
89
|
files:
|
|
118
|
-
- ".document"
|
|
119
|
-
- ".rdoc_options"
|
|
120
90
|
- CHANGELOG.md
|
|
121
91
|
- LICENSE.txt
|
|
122
92
|
- README.md
|
|
@@ -148,6 +118,7 @@ files:
|
|
|
148
118
|
- lib/pf2/reporter/firefox_profiler_ser2.rb
|
|
149
119
|
- lib/pf2/reporter/stack_weaver.rb
|
|
150
120
|
- lib/pf2/serve.rb
|
|
121
|
+
- lib/pf2/session.rb
|
|
151
122
|
- lib/pf2/version.rb
|
|
152
123
|
- vendor/libbacktrace/.gitignore
|
|
153
124
|
- vendor/libbacktrace/Isaac.Newton-Opticks.txt
|
|
@@ -241,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
241
212
|
- !ruby/object:Gem::Version
|
|
242
213
|
version: '0'
|
|
243
214
|
requirements: []
|
|
244
|
-
rubygems_version:
|
|
215
|
+
rubygems_version: 3.8.0.dev
|
|
245
216
|
specification_version: 4
|
|
246
217
|
summary: Yet another Ruby profiler
|
|
247
218
|
test_files: []
|
data/.document
DELETED