ruby-static-tracing 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 77e9c7647715d271d4cfdf9cb78359842ef0bae3f3582ea3f0248f3cbea2d288
4
+ data.tar.gz: bac4e1fb75dbbcea6304c1a1ee9e8597c31334dd56ff3b75eb3df32e173e130e
5
+ SHA512:
6
+ metadata.gz: 482ef944a73814773fce74d5f4906ee7ab626c35b5838ec3ed26579706e544ccf0c86dd2cd45ad880e5b3d9e9f69c3d60785eb173f005eb700110ab16796cf8c
7
+ data.tar.gz: 9e311329c44e0081533e62b32eb78a4b1ef08671d60b37ceeee44cc565aedb270b3e3310ff21edaa756182ff36baea878428045668501d85bebbc1e373d4fff3
@@ -0,0 +1,40 @@
1
+ $LOAD_PATH.unshift File.expand_path("../../../lib", __FILE__)
2
+
3
+ require 'mkmf'
4
+ require 'ruby-static-tracing/platform'
5
+
6
+ unless StaticTracing.linux?
7
+ end
8
+
9
+ def platform_dir(platform)
10
+ File.expand_path("../../../ext/ruby-static-tracing/#{platform}/", __FILE__)
11
+ end
12
+
13
+ if StaticTracing.linux?
14
+ abort 'libstapsdt.h is missing, please install libstapsdt' unless find_header('libstapsdt.h')
15
+
16
+ have_header 'libstapsdt.h'
17
+
18
+ $CFLAGS = "-D_GNU_SOURCE -Werror -Wall "
19
+ if ENV.key?('DEBUG')
20
+ $CFLAGS << "-O0 -g -DDEBUG"
21
+ else
22
+ $CFLAGS << "-O3"
23
+ end
24
+
25
+ create_makefile('ruby-static-tracing/ruby_static_tracing', platform_dir("linux"))
26
+ else
27
+ # FIXME properly stub this.
28
+ # Should have 3 cases:
29
+ # - Linux, via libstapsdt
30
+ # - BSD and other dtrace platforms, via libusdt
31
+ # - Stub, for other platforms that support neither
32
+ # for now, we will yolo stub this to leave room to handle platforms
33
+ # that support properly support conventional dtrace
34
+ File.write "Makefile", <<MAKEFILE
35
+ all:
36
+ clean:
37
+ install:
38
+ MAKEFILE
39
+ exit
40
+ end
@@ -0,0 +1,4 @@
1
+ void Init_ruby_static_tracing()
2
+ {
3
+
4
+ }
@@ -0,0 +1,5 @@
1
+ module StaticTracing
2
+ def self.linux?
3
+ true
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module StaticTracing
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,26 @@
1
+ require 'ruby-static-tracing/version'
2
+ require 'ruby-static-tracing/platform'
3
+
4
+ # FIXME Including StaticTracing should cause every method in a module or class to be registered
5
+ # Implement this by introspecting all methods on the includor, and wrapping them.
6
+ module StaticTracing
7
+ extend self
8
+
9
+ # Should indicate if static tracing is enabled - a global constant
10
+ def enabled?
11
+ end
12
+
13
+ # Overwrite the definition of all functions that are enabled
14
+ # with a wrapped version that has tracing enabled
15
+ def enable
16
+ end
17
+
18
+ # Overwrite the definition of all functions to their original definition,
19
+ # no longer wrapping them
20
+ def disable
21
+ end
22
+ end
23
+
24
+ # FIXME add signal handlers to enable-disable on specific process signals
25
+ # within a trap handler.
26
+ # Specify default signals, but allow these to be overidden for easier integration
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-static-tracing
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dale Hamel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-03-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake-compiler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.9'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '11.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "<"
39
+ - !ruby/object:Gem::Version
40
+ version: '11.0'
41
+ description: " A Ruby C extension that enables defining static tracepoints\n from
42
+ within a ruby context. \n"
43
+ email: dale.hamel@srvthe.net
44
+ executables: []
45
+ extensions:
46
+ - ext/ruby-static-tracing/extconf.rb
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ext/ruby-static-tracing/extconf.rb
50
+ - ext/ruby-static-tracing/linux/ruby_static_tracing.c
51
+ - lib/ruby-static-tracing.rb
52
+ - lib/ruby-static-tracing/platform.rb
53
+ - lib/ruby-static-tracing/version.rb
54
+ homepage: https://github.com/dalehamel/ruby-static-tracing
55
+ licenses:
56
+ - MIT
57
+ metadata: {}
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubyforge_project:
74
+ rubygems_version: 2.7.9
75
+ signing_key:
76
+ specification_version: 4
77
+ summary: USDT tracing for Ruby
78
+ test_files: []