rbtrace 0.4.13 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/extconf.rb +2 -2
- data/ext/rbtrace.c +8 -2
- data/lib/rbtrace/cli.rb +2 -2
- data/lib/rbtrace/rbtracer.rb +1 -1
- data/lib/rbtrace/version.rb +1 -1
- data/server.rb +13 -10
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78fc8aa96b3b20a4663ceaef1253f41443689e85f344a9efecb60c240e85183b
|
4
|
+
data.tar.gz: 2f2ab561dfe12096dcbe28ff188d07e34af48bbed936f09bbc0dd23309132bea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1710793189ea23b9048c68ff61c1c7f52202b4e7770991e4c049f9b1b069dbbe4fd71f59e2e79a06d34c4c15628073d0498175fcbb64572152c22b9636557a09
|
7
|
+
data.tar.gz: 315c8c2bc040cf790e4964a93ee9f50b97f9b2b7718f71790e8af36cb2d1fe01d529da06fd6b346747e45fc82b52b2fde6fd62bf9053010e8e93d38f76e575fe
|
data/ext/extconf.rb
CHANGED
@@ -13,7 +13,7 @@ require 'fileutils'
|
|
13
13
|
|
14
14
|
libdir = File.basename RbConfig::CONFIG['libdir']
|
15
15
|
|
16
|
-
unless File.
|
16
|
+
unless File.exist?("#{CWD}/dst/#{libdir}/libmsgpackc.a")
|
17
17
|
Logging.message "Building msgpack\n"
|
18
18
|
|
19
19
|
msgpack = File.basename('msgpack-1.1.0.tar.gz')
|
@@ -28,7 +28,7 @@ unless File.exists?("#{CWD}/dst/#{libdir}/libmsgpackc.a")
|
|
28
28
|
end
|
29
29
|
|
30
30
|
Dir.chdir('src') do
|
31
|
-
FileUtils.rm_rf(dir) if File.
|
31
|
+
FileUtils.rm_rf(dir) if File.exist?(dir)
|
32
32
|
|
33
33
|
sys("tar zxvfo #{msgpack}")
|
34
34
|
Dir.chdir(dir) do
|
data/ext/rbtrace.c
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
|
23
23
|
#include <msgpack.h>
|
24
24
|
#include <ruby.h>
|
25
|
+
#include <ruby/debug.h>
|
25
26
|
|
26
27
|
#ifndef RUBY_VM
|
27
28
|
#include <env.h>
|
@@ -51,6 +52,11 @@
|
|
51
52
|
#endif
|
52
53
|
|
53
54
|
|
55
|
+
// The SUN_LEN macro is not available on Android
|
56
|
+
#ifndef SUN_LEN
|
57
|
+
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen((ptr)->sun_path))
|
58
|
+
#endif
|
59
|
+
|
54
60
|
static uint64_t
|
55
61
|
ru_utime_usec()
|
56
62
|
{
|
@@ -688,7 +694,7 @@ rbtracer_add(char *query, bool is_slow)
|
|
688
694
|
*idx = NULL,
|
689
695
|
*method = NULL;
|
690
696
|
|
691
|
-
if (NULL != (idx =
|
697
|
+
if (NULL != (idx = strrchr(query, '.'))) {
|
692
698
|
klass_begin = 0;
|
693
699
|
klass_end = idx - query;
|
694
700
|
is_singleton = true;
|
@@ -700,7 +706,7 @@ rbtracer_add(char *query, bool is_slow)
|
|
700
706
|
|
701
707
|
method = idx+1;
|
702
708
|
|
703
|
-
} else if (NULL != (idx =
|
709
|
+
} else if (NULL != (idx = strrchr(query, '#'))) {
|
704
710
|
klass_begin = 0;
|
705
711
|
klass_end = idx - query;
|
706
712
|
is_singleton = false;
|
data/lib/rbtrace/cli.rb
CHANGED
@@ -12,7 +12,7 @@ class RBTraceCLI
|
|
12
12
|
#
|
13
13
|
# Returns nothing.
|
14
14
|
def self.check_msgmnb
|
15
|
-
if File.
|
15
|
+
if File.exist?(msgmnb = "/proc/sys/kernel/msgmnb")
|
16
16
|
curr = File.read(msgmnb).to_i
|
17
17
|
max = 1024*1024
|
18
18
|
cmd = "sysctl kernel.msgmnb=#{max}"
|
@@ -273,7 +273,7 @@ EOS
|
|
273
273
|
file = [
|
274
274
|
config,
|
275
275
|
File.expand_path("../../../tracers/#{config}.tracer", __FILE__)
|
276
|
-
].find{ |f| File.
|
276
|
+
].find{ |f| File.exist?(f) }
|
277
277
|
|
278
278
|
unless file
|
279
279
|
parser.die :config, '(file does not exist)'
|
data/lib/rbtrace/rbtracer.rb
CHANGED
data/lib/rbtrace/version.rb
CHANGED
data/server.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'ext/rbtrace'
|
2
|
+
require 'tmpdir'
|
2
3
|
|
3
4
|
class String
|
4
5
|
def multiply_vowels(num)
|
@@ -26,19 +27,21 @@ end
|
|
26
27
|
|
27
28
|
while true
|
28
29
|
proc {
|
29
|
-
Dir.
|
30
|
-
Dir.
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
Dir.mktmpdir do |tmp|
|
31
|
+
Dir.chdir(tmp) do
|
32
|
+
Dir.pwd
|
33
|
+
Process.pid
|
34
|
+
'hello'.multiply_vowels(3){ :ohai }
|
35
|
+
sleep rand*0.5
|
34
36
|
|
35
|
-
|
36
|
-
|
37
|
+
ENV['blah']
|
38
|
+
GC.start
|
37
39
|
|
38
|
-
|
39
|
-
|
40
|
+
reload_test.call
|
41
|
+
Test.run
|
40
42
|
|
41
|
-
|
43
|
+
#fib(1024*100)
|
44
|
+
end
|
42
45
|
end
|
43
46
|
}.call
|
44
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbtrace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aman Gupta
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -107,7 +107,7 @@ homepage: http://github.com/tmm1/rbtrace
|
|
107
107
|
licenses:
|
108
108
|
- MIT
|
109
109
|
metadata: {}
|
110
|
-
post_install_message:
|
110
|
+
post_install_message:
|
111
111
|
rdoc_options: []
|
112
112
|
require_paths:
|
113
113
|
- lib
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
126
|
rubygems_version: 3.0.3
|
127
|
-
signing_key:
|
127
|
+
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: 'rbtrace: like strace but for ruby code'
|
130
130
|
test_files: []
|