rotoscope 0.3.1.pre.3 → 0.3.1
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/.github/dependabot.yml +17 -0
- data/.github/workflows/ci.yml +9 -3
- data/.rubocop.yml +5 -2
- data/.ruby-version +1 -0
- data/Gemfile +1 -1
- data/README.md +7 -0
- data/dev.yml +1 -1
- data/ext/rotoscope/rotoscope.c +14 -6
- data/ext/rotoscope/rotoscope.h +3 -1
- data/lib/rotoscope/version.rb +1 -1
- data/rotoscope.gemspec +3 -3
- metadata +12 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb0b39e7f67f3038593c3dc6021e903404a75117afbe8364eb80a2941bbfa8ef
|
|
4
|
+
data.tar.gz: 7d3fceeb211a47f13088b099e26db5e5e8847b84c14090aa64d58bf6c919d92d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 493b13e1a1f905be9c9c4774cd5d7280f5c163b791bfbe0d3b3dec81b0c575cc3b35063d0db62ba21ce5126810431dbf2d9197f3d224f008e9e143cfb346b81c
|
|
7
|
+
data.tar.gz: f67d35ba99ba3400714365ed02475bf5efc345bafb2f76f9834ad964fbfbc4538698deb00ea8e159320b5b788aa8d2f880f60c78fd463511e97d17cf1ba9790c
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: bundler
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
time: "14:00"
|
|
8
|
+
open-pull-requests-limit: 100
|
|
9
|
+
insecure-external-code-execution: allow
|
|
10
|
+
registries: "*"
|
|
11
|
+
groups:
|
|
12
|
+
minor-gem-update:
|
|
13
|
+
update-types:
|
|
14
|
+
- "minor"
|
|
15
|
+
patch-gem-update:
|
|
16
|
+
update-types:
|
|
17
|
+
- "patch"
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -6,21 +6,27 @@ on:
|
|
|
6
6
|
jobs:
|
|
7
7
|
test:
|
|
8
8
|
runs-on: ubuntu-latest
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
ruby: ["2.7"]
|
|
9
12
|
steps:
|
|
10
13
|
- uses: actions/checkout@v2
|
|
11
14
|
- uses: ruby/setup-ruby@v1
|
|
12
15
|
with:
|
|
13
|
-
ruby-version:
|
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
|
14
17
|
bundler-cache: true
|
|
15
18
|
- run: bundle exec rake
|
|
16
19
|
|
|
17
20
|
valgrind:
|
|
18
21
|
runs-on: ubuntu-latest
|
|
22
|
+
strategy:
|
|
23
|
+
matrix:
|
|
24
|
+
ruby: ["2.7"]
|
|
19
25
|
steps:
|
|
20
|
-
- run: sudo apt-get install -y valgrind
|
|
26
|
+
- run: sudo apt-get update && sudo apt-get install -y valgrind
|
|
21
27
|
- uses: actions/checkout@v2
|
|
22
28
|
- uses: ruby/setup-ruby@v1
|
|
23
29
|
with:
|
|
24
|
-
ruby-version:
|
|
30
|
+
ruby-version: ${{ matrix.ruby }}
|
|
25
31
|
bundler-cache: true
|
|
26
32
|
- run: bundle exec rake test:valgrind
|
data/.rubocop.yml
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.7.8
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -9,6 +9,13 @@ Rotoscope is a high-performance logger of Ruby method invocations.
|
|
|
9
9
|
|
|
10
10
|
Rotoscope is subject to breaking changes in minor versions until `1.0` is available.
|
|
11
11
|
|
|
12
|
+
## Table of Contents
|
|
13
|
+
|
|
14
|
+
- [Example](https://github.com/Shopify/rotoscope?tab=readme-ov-file#example)
|
|
15
|
+
- [API](https://github.com/Shopify/rotoscope?tab=readme-ov-file#api)
|
|
16
|
+
- [Default Logging Interface](https://github.com/Shopify/rotoscope?tab=readme-ov-file#default-logging-interface)
|
|
17
|
+
- [Low-level API](https://github.com/Shopify/rotoscope?tab=readme-ov-file#low-level-api)
|
|
18
|
+
|
|
12
19
|
## Example
|
|
13
20
|
|
|
14
21
|
```ruby
|
data/dev.yml
CHANGED
data/ext/rotoscope/rotoscope.c
CHANGED
|
@@ -124,7 +124,11 @@ static void event_hook(VALUE tpval, void *data) {
|
|
|
124
124
|
|
|
125
125
|
config->callsite = tracearg_path(trace_arg);
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
rs_stack_frame_t *caller = rs_stack_peek(&config->stack);
|
|
128
|
+
config->has_caller = caller != NULL;
|
|
129
|
+
if (caller != NULL) {
|
|
130
|
+
config->caller = *caller;
|
|
131
|
+
}
|
|
128
132
|
|
|
129
133
|
rs_method_desc_t method_desc = called_method_desc(trace_arg);
|
|
130
134
|
rs_stack_push(&config->stack, (rs_stack_frame_t){.method = method_desc});
|
|
@@ -137,6 +141,9 @@ static void rs_gc_mark(void *data) {
|
|
|
137
141
|
rb_gc_mark(config->tracepoint);
|
|
138
142
|
rb_gc_mark(config->trace_proc);
|
|
139
143
|
rs_stack_mark(&config->stack);
|
|
144
|
+
if (config->has_caller) {
|
|
145
|
+
rs_method_desc_mark(&config->caller.method);
|
|
146
|
+
}
|
|
140
147
|
}
|
|
141
148
|
|
|
142
149
|
static void rs_dealloc(void *data) {
|
|
@@ -165,7 +172,7 @@ static VALUE rs_alloc(VALUE klass) {
|
|
|
165
172
|
config->pid = getpid();
|
|
166
173
|
config->tid = current_thread_id();
|
|
167
174
|
config->tracing = false;
|
|
168
|
-
config->
|
|
175
|
+
config->has_caller = false;
|
|
169
176
|
config->callsite = (rs_callsite_t){
|
|
170
177
|
.filepath = Qnil,
|
|
171
178
|
.lineno = 0,
|
|
@@ -204,6 +211,7 @@ VALUE rotoscope_stop_trace(VALUE self) {
|
|
|
204
211
|
rb_tracepoint_disable(config->tracepoint);
|
|
205
212
|
config->tracing = false;
|
|
206
213
|
rs_stack_reset(&config->stack);
|
|
214
|
+
config->has_caller = false;
|
|
207
215
|
}
|
|
208
216
|
|
|
209
217
|
return Qnil;
|
|
@@ -256,18 +264,18 @@ VALUE rotoscope_singleton_method_p(VALUE self) {
|
|
|
256
264
|
|
|
257
265
|
VALUE rotoscope_caller_object(VALUE self) {
|
|
258
266
|
Rotoscope *config = get_config(self);
|
|
259
|
-
if (config->
|
|
267
|
+
if (!config->has_caller) {
|
|
260
268
|
return Qnil;
|
|
261
269
|
}
|
|
262
|
-
return config->caller
|
|
270
|
+
return config->caller.method.receiver;
|
|
263
271
|
}
|
|
264
272
|
|
|
265
273
|
VALUE rotoscope_caller_class(VALUE self) {
|
|
266
274
|
Rotoscope *config = get_config(self);
|
|
267
|
-
if (config->
|
|
275
|
+
if (!config->has_caller) {
|
|
268
276
|
return Qnil;
|
|
269
277
|
}
|
|
270
|
-
return rs_method_class(&config->caller
|
|
278
|
+
return rs_method_class(&config->caller.method);
|
|
271
279
|
}
|
|
272
280
|
|
|
273
281
|
VALUE rotoscope_caller_class_name(VALUE self) {
|
data/ext/rotoscope/rotoscope.h
CHANGED
|
@@ -19,7 +19,9 @@ typedef struct {
|
|
|
19
19
|
unsigned long tid;
|
|
20
20
|
bool tracing;
|
|
21
21
|
rs_stack_t stack;
|
|
22
|
-
|
|
22
|
+
// Copy, not a pointer into `stack`: pushing may realloc the stack buffer.
|
|
23
|
+
rs_stack_frame_t caller;
|
|
24
|
+
bool has_caller;
|
|
23
25
|
rs_callsite_t callsite;
|
|
24
26
|
VALUE trace_proc;
|
|
25
27
|
} Rotoscope;
|
data/lib/rotoscope/version.rb
CHANGED
data/rotoscope.gemspec
CHANGED
|
@@ -21,10 +21,10 @@ Gem::Specification.new do |s|
|
|
|
21
21
|
end
|
|
22
22
|
s.metadata["allowed_push_host"] = "https://rubygems.org/"
|
|
23
23
|
|
|
24
|
-
s.required_ruby_version = ">= 2.
|
|
24
|
+
s.required_ruby_version = ">= 2.7.0"
|
|
25
25
|
s.extensions = ["ext/rotoscope/extconf.rb"]
|
|
26
26
|
|
|
27
27
|
s.add_development_dependency("minitest", "~> 5.0")
|
|
28
|
-
s.add_development_dependency("mocha", "~>
|
|
29
|
-
s.add_development_dependency("rake-compiler", "~>
|
|
28
|
+
s.add_development_dependency("mocha", "~> 2.4")
|
|
29
|
+
s.add_development_dependency("rake-compiler", "~> 1.2")
|
|
30
30
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rotoscope
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.1
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jahfer Husain
|
|
8
8
|
- Dylan Thacker-Smith
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: minitest
|
|
@@ -31,28 +30,28 @@ dependencies:
|
|
|
31
30
|
requirements:
|
|
32
31
|
- - "~>"
|
|
33
32
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: '
|
|
33
|
+
version: '2.4'
|
|
35
34
|
type: :development
|
|
36
35
|
prerelease: false
|
|
37
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
38
37
|
requirements:
|
|
39
38
|
- - "~>"
|
|
40
39
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: '
|
|
40
|
+
version: '2.4'
|
|
42
41
|
- !ruby/object:Gem::Dependency
|
|
43
42
|
name: rake-compiler
|
|
44
43
|
requirement: !ruby/object:Gem::Requirement
|
|
45
44
|
requirements:
|
|
46
45
|
- - "~>"
|
|
47
46
|
- !ruby/object:Gem::Version
|
|
48
|
-
version: '
|
|
47
|
+
version: '1.2'
|
|
49
48
|
type: :development
|
|
50
49
|
prerelease: false
|
|
51
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
52
51
|
requirements:
|
|
53
52
|
- - "~>"
|
|
54
53
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: '
|
|
54
|
+
version: '1.2'
|
|
56
55
|
description: High-performance logger of Ruby method invocations
|
|
57
56
|
email: jahfer.husain@shopify.com
|
|
58
57
|
executables: []
|
|
@@ -62,11 +61,13 @@ extra_rdoc_files: []
|
|
|
62
61
|
files:
|
|
63
62
|
- ".clang-format"
|
|
64
63
|
- ".github/PULL_REQUEST_TEMPLATE"
|
|
64
|
+
- ".github/dependabot.yml"
|
|
65
65
|
- ".github/workflows/ci.yml"
|
|
66
66
|
- ".github/workflows/cla.yml"
|
|
67
67
|
- ".gitignore"
|
|
68
68
|
- ".rubocop.yml"
|
|
69
69
|
- ".rubocop_todo.yml"
|
|
70
|
+
- ".ruby-version"
|
|
70
71
|
- Gemfile
|
|
71
72
|
- LICENSE
|
|
72
73
|
- README.md
|
|
@@ -93,7 +94,6 @@ licenses:
|
|
|
93
94
|
- MIT
|
|
94
95
|
metadata:
|
|
95
96
|
allowed_push_host: https://rubygems.org/
|
|
96
|
-
post_install_message:
|
|
97
97
|
rdoc_options: []
|
|
98
98
|
require_paths:
|
|
99
99
|
- lib
|
|
@@ -101,15 +101,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
101
101
|
requirements:
|
|
102
102
|
- - ">="
|
|
103
103
|
- !ruby/object:Gem::Version
|
|
104
|
-
version: 2.
|
|
104
|
+
version: 2.7.0
|
|
105
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
requirements:
|
|
107
|
-
- - "
|
|
107
|
+
- - ">="
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version:
|
|
109
|
+
version: '0'
|
|
110
110
|
requirements: []
|
|
111
|
-
rubygems_version:
|
|
112
|
-
signing_key:
|
|
111
|
+
rubygems_version: 4.0.21
|
|
113
112
|
specification_version: 4
|
|
114
113
|
summary: Tracing Ruby
|
|
115
114
|
test_files: []
|