pyroscope 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36bb83e12718ebaaceda2abd73fe6aa04b7118186a2532a9a84334a8d9ea78a9
4
- data.tar.gz: b7c5269520ffb6692ef147d781f7ebc1d1ee71f0810367ab8e9dd39149a5043a
3
+ metadata.gz: 42f5e0729331e9002034247e8e90daf55c4efee52fd9c73a09bcf97ea3faf073
4
+ data.tar.gz: a15a4611dd40f44d1a3dd82d3fc15fe92efd3ac61bcba0ea4eb94e94748a34e4
5
5
  SHA512:
6
- metadata.gz: 50d07468d065727335c16c76fec8365f79aee6e10f924dfc8613b2bc2c8307a71db6586bd5efe15391288e86e1132c2bcdfd58b75d3972c9a519080bf4c63306
7
- data.tar.gz: afd0327de15581b6cb6a48ea34472ce9c3b7ceeb1b39c197ba62b33e4b6fb0125d603d2595fe34a0757e0bb4b60b059a723a9d5fa787097753fd311269c56f26
6
+ metadata.gz: 702c84e56457539ce3872df0b9639c0f1ca3d8f70b6a5053a62056bec9cfb52272a99f8a4b9b795fc340dca5b34d9d1b2c02985f4a36ff96ae65f2981da69413
7
+ data.tar.gz: 3c8bef0ab7f2bd2a86e8971eed949ea22e6a4edf1c0ad5bd274ab91c0f8d4538cef49a9ee441c54d0941b173329bd364ba434a17ffa49e2afe9919c52acd3143
@@ -0,0 +1,265 @@
1
+ SHELL = /bin/sh
2
+
3
+ # V=0 quiet, V=1 verbose. other values don't work.
4
+ V = 1
5
+ Q1 = $(V:1=)
6
+ Q = $(Q1:0=@)
7
+ ECHO1 = $(V:1=@ :)
8
+ ECHO = $(ECHO1:0=@ echo)
9
+ NULLCMD = :
10
+
11
+ #### Start of system configuration section. ####
12
+
13
+ srcdir = ../../../../ext/pyroscope
14
+ topdir = /usr/include
15
+ hdrdir = $(topdir)
16
+ arch_hdrdir = /usr/include
17
+ PATH_SEPARATOR = :
18
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
19
+ prefix = $(DESTDIR)/usr
20
+ rubysitearchprefix = $(sitearchlibdir)/$(RUBY_BASE_NAME)
21
+ rubyarchprefix = $(DESTDIR)/usr/lib64/ruby
22
+ rubylibprefix = $(exec_prefix)/share/ruby
23
+ exec_prefix = $(DESTDIR)/usr
24
+ vendorarchhdrdir = $(vendorhdrdir)/$(arch)
25
+ sitearchhdrdir = $(sitehdrdir)/$(arch)
26
+ rubyarchhdrdir = $(DESTDIR)/usr/include
27
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
28
+ sitehdrdir = $(rubyhdrdir)/site_ruby
29
+ rubyhdrdir = $(DESTDIR)/usr/include
30
+ rubygemsdir = $(DESTDIR)/usr/share/rubygems
31
+ vendorarchdir = $(DESTDIR)/usr/lib64/ruby/vendor_ruby
32
+ vendorlibdir = $(vendordir)
33
+ vendordir = $(DESTDIR)/usr/share/ruby/vendor_ruby
34
+ sitearchdir = $(DESTDIR)/usr/local/lib64/ruby/site_ruby
35
+ sitelibdir = $(sitedir)
36
+ sitedir = $(DESTDIR)/usr/local/share/ruby/site_ruby
37
+ rubyarchdir = $(rubyarchprefix)
38
+ rubylibdir = $(rubylibprefix)
39
+ sitearchincludedir = $(includedir)/$(sitearch)
40
+ archincludedir = $(includedir)/$(arch)
41
+ sitearchlibdir = $(libdir)/$(sitearch)
42
+ archlibdir = $(DESTDIR)/usr/lib64
43
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
44
+ mandir = $(DESTDIR)/usr/share/man
45
+ localedir = $(datarootdir)/locale
46
+ libdir = $(exec_prefix)/lib64
47
+ psdir = $(docdir)
48
+ pdfdir = $(docdir)
49
+ dvidir = $(docdir)
50
+ htmldir = $(docdir)
51
+ infodir = $(DESTDIR)/usr/share/info
52
+ docdir = $(datarootdir)/doc/$(PACKAGE)
53
+ oldincludedir = $(DESTDIR)/usr/include
54
+ includedir = $(DESTDIR)/usr/include
55
+ localstatedir = $(DESTDIR)/var
56
+ sharedstatedir = $(DESTDIR)/var/lib
57
+ sysconfdir = $(DESTDIR)/etc
58
+ datadir = $(DESTDIR)/usr/share
59
+ datarootdir = $(prefix)/share
60
+ libexecdir = $(DESTDIR)/usr/libexec
61
+ sbindir = $(DESTDIR)/usr/sbin
62
+ bindir = $(exec_prefix)/bin
63
+ archdir = $(rubyarchdir)
64
+
65
+
66
+ CC_WRAPPER =
67
+ CC = gcc
68
+ CXX = g++
69
+ LIBRUBY = $(LIBRUBY_SO)
70
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
71
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
72
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static $(MAINLIBS)
73
+ empty =
74
+ OUTFLAG = -o $(empty)
75
+ COUTFLAG = -o $(empty)
76
+ CSRCFLAG = $(empty)
77
+
78
+ RUBY_EXTCONF_H =
79
+ cflags = $(optflags) $(debugflags) $(warnflags)
80
+ cxxflags =
81
+ optflags = -O3
82
+ debugflags = -ggdb3
83
+ warnflags = -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable
84
+ cppflags =
85
+ CCDLFLAGS = -fPIC
86
+ CFLAGS = $(CCDLFLAGS) -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic -fPIC $(ARCH_FLAG)
87
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
88
+ DEFS =
89
+ CPPFLAGS = -I/usr/include $(DEFS) $(cppflags)
90
+ CXXFLAGS = $(CCDLFLAGS) -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic $(ARCH_FLAG)
91
+ ldflags = -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -rdynamic -Wl,-export-dynamic
92
+ dldflags = -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
93
+ ARCH_FLAG = -m64
94
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
95
+ LDSHARED = $(CC) -shared
96
+ LDSHAREDXX = $(CXX) -shared
97
+ AR = gcc-ar
98
+ EXEEXT =
99
+
100
+ RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
101
+ RUBY_SO_NAME = ruby
102
+ RUBYW_INSTALL_NAME =
103
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version_dir_name)
104
+ RUBYW_BASE_NAME = rubyw
105
+ RUBY_BASE_NAME = ruby
106
+
107
+ arch = x86_64-linux
108
+ sitearch = $(arch)
109
+ ruby_version = 3.0.0
110
+ ruby = $(bindir)/$(RUBY_BASE_NAME)
111
+ RUBY = $(ruby)
112
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
113
+
114
+ RM = rm -f
115
+ RM_RF = $(RUBY) -run -e rm -- -rf
116
+ RMDIRS = rmdir --ignore-fail-on-non-empty -p
117
+ MAKEDIRS = /usr/bin/mkdir -p
118
+ INSTALL = /usr/bin/install -c
119
+ INSTALL_PROG = $(INSTALL) -m 0755
120
+ INSTALL_DATA = $(INSTALL) -m 644
121
+ COPY = cp
122
+ TOUCH = exit >
123
+
124
+ #### End of system configuration section. ####
125
+
126
+ preload =
127
+ libpath = . $(archlibdir) /usr/lib64 /home/dmitry/pyroscope-ruby/ext/pyroscope/lib
128
+ LIBPATH = -L. -L$(archlibdir) -L/usr/lib64 -L/home/dmitry/pyroscope-ruby/ext/pyroscope/lib
129
+ DEFFILE =
130
+
131
+ CLEANFILES = mkmf.log
132
+ DISTCLEANFILES =
133
+ DISTCLEANDIRS =
134
+
135
+ extout =
136
+ extout_prefix =
137
+ target_prefix =
138
+ LOCAL_LIBS = -lpyroscope.rbspy -lrustdeps
139
+ LIBS = $(LIBRUBYARG_SHARED) -lm -lc
140
+ ORIG_SRCS = pyroscope.c
141
+ SRCS = $(ORIG_SRCS)
142
+ OBJS = pyroscope.o
143
+ HDRS =
144
+ LOCAL_HDRS =
145
+ TARGET = pyroscope_c
146
+ TARGET_NAME = pyroscope_c
147
+ TARGET_ENTRY = Init_$(TARGET_NAME)
148
+ DLLIB = $(TARGET).so
149
+ EXTSTATIC =
150
+ STATIC_LIB =
151
+
152
+ TIMESTAMP_DIR = .
153
+ BINDIR = $(bindir)
154
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
155
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
156
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
157
+ HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
158
+ ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
159
+ TARGET_SO_DIR =
160
+ TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
161
+ CLEANLIBS = $(TARGET_SO)
162
+ CLEANOBJS = *.o *.bak
163
+
164
+ all: $(DLLIB)
165
+ static: $(STATIC_LIB)
166
+ .PHONY: all install static install-so install-rb
167
+ .PHONY: clean clean-so clean-static clean-rb
168
+
169
+ clean-static::
170
+ clean-rb-default::
171
+ clean-rb::
172
+ clean-so::
173
+ clean: clean-so clean-static clean-rb-default clean-rb
174
+ -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
175
+
176
+ distclean-rb-default::
177
+ distclean-rb::
178
+ distclean-so::
179
+ distclean-static::
180
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
181
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
182
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
183
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
184
+
185
+ realclean: distclean
186
+ install: install-so install-rb
187
+
188
+ install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.time
189
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
190
+ clean-static::
191
+ -$(Q)$(RM) $(STATIC_LIB)
192
+ install-rb: pre-install-rb do-install-rb install-rb-default
193
+ install-rb-default: pre-install-rb-default do-install-rb-default
194
+ pre-install-rb: Makefile
195
+ pre-install-rb-default: Makefile
196
+ do-install-rb:
197
+ do-install-rb-default:
198
+ pre-install-rb-default:
199
+ @$(NULLCMD)
200
+ $(TIMESTAMP_DIR)/.sitearchdir.time:
201
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
202
+ $(Q) $(TOUCH) $@
203
+
204
+ site-install: site-install-so site-install-rb
205
+ site-install-so: install-so
206
+ site-install-rb: install-rb
207
+
208
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
209
+
210
+ .cc.o:
211
+ $(ECHO) compiling $(<)
212
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
213
+
214
+ .cc.S:
215
+ $(ECHO) translating $(<)
216
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
217
+
218
+ .mm.o:
219
+ $(ECHO) compiling $(<)
220
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
221
+
222
+ .mm.S:
223
+ $(ECHO) translating $(<)
224
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
225
+
226
+ .cxx.o:
227
+ $(ECHO) compiling $(<)
228
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
229
+
230
+ .cxx.S:
231
+ $(ECHO) translating $(<)
232
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
233
+
234
+ .cpp.o:
235
+ $(ECHO) compiling $(<)
236
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
237
+
238
+ .cpp.S:
239
+ $(ECHO) translating $(<)
240
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
241
+
242
+ .c.o:
243
+ $(ECHO) compiling $(<)
244
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
245
+
246
+ .c.S:
247
+ $(ECHO) translating $(<)
248
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
249
+
250
+ .m.o:
251
+ $(ECHO) compiling $(<)
252
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
253
+
254
+ .m.S:
255
+ $(ECHO) translating $(<)
256
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
257
+
258
+ $(TARGET_SO): $(OBJS) Makefile
259
+ $(ECHO) linking shared-object $(DLLIB)
260
+ -$(Q)$(RM) $(@)
261
+ $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
262
+
263
+
264
+
265
+ $(OBJS): $(HDRS) $(ruby_headers)
@@ -9,7 +9,7 @@ HEADER_DIRS = [INCLUDEDIR]
9
9
 
10
10
  LIB_DIRS = [LIBDIR, File.expand_path(File.join(File.dirname(__FILE__), "lib"))]
11
11
 
12
- COMMIT = "bfb9a32"
12
+ COMMIT = "39a3d9c"
13
13
 
14
14
  # TODO: this is not very accurate, but it works for now
15
15
  OS = RUBY_PLATFORM.include?("darwin") ? "mac" : "linux"
@@ -25,24 +25,42 @@ if ENV["PYROSCOPE_RUBY_LOCAL"]
25
25
  system "cp #{ENV["HOME"]}/pyroscope/out/librustdeps.a #{File.join(ROOT, "lib/librustdeps.a")}"
26
26
  else
27
27
  Net::HTTP.start("dl.pyroscope.io", 443, :use_ssl => true) do |http|
28
- res1 = http.get(PREFIX+"/libpyroscope.rbspy.a")
29
- raise "HTTP error: #{res1.code}" unless res1.code == "200"
30
- lib1 = res1.body
31
- File.binwrite(File.join(ROOT, "lib/libpyroscope.rbspy.a"), lib1)
32
-
33
- res2 = http.get(PREFIX+"/librustdeps.a")
34
- raise "HTTP error: #{res2.code}" unless res2.code == "200"
35
- lib2 = res2.body
36
- File.binwrite(File.join(ROOT, "lib/librustdeps.a"), lib2)
28
+ req = Net::HTTP::Get.new(PREFIX+"/libpyroscope.rbspy.combo.a.gz")
29
+ http.request(req) do |resp|
30
+ raise "HTTP error: #{resp.code}" unless resp.code == "200"
31
+
32
+ r, w = IO.pipe
33
+
34
+ t = Thread.new do
35
+ zreader = Zlib::GzipReader.new(r)
36
+ File.open(File.join(ROOT, "lib/libpyroscope.rbspy.combo.a"), "wb") do |f|
37
+ loop do
38
+ begin
39
+ chunk = zreader.readpartial(32768)
40
+ break if chunk.nil?
41
+ rescue EOFError
42
+ break
43
+ end
44
+ f.write(chunk)
45
+ end
46
+ end
47
+ end
48
+
49
+ resp.read_body do |chunk|
50
+ w.write(chunk)
51
+ end
52
+
53
+ t.join
54
+ end
37
55
  end
38
56
  end
39
57
 
40
- # TODO: figure out how to fix this bug
41
- system "strip --strip-debug #{File.join(ROOT, "lib/libpyroscope.rbspy.a")}"
58
+ # this is now done upstream
59
+ # system "strip --strip-debug #{File.join(ROOT, "lib/libpyroscope.rbspy.combo.a")}"
42
60
 
43
61
  dir_config('pyroscope', HEADER_DIRS, LIB_DIRS)
44
62
 
45
- libs = ['-lpyroscope.rbspy', '-lrustdeps']
63
+ libs = ['-lpyroscope.rbspy.combo']
46
64
  libs.each do |lib|
47
65
  $LOCAL_LIBS << "#{lib} "
48
66
  end
Binary file
@@ -1,3 +1,3 @@
1
1
  module Pyroscope
2
- VERSION = "0.0.12".freeze
2
+ VERSION = "0.0.13".freeze
3
3
  end
data/test.rb CHANGED
@@ -1,11 +1,11 @@
1
- require 'pyroscope'
1
+ # require 'pyroscope'
2
2
 
3
3
  puts "prestart #{Process.pid}"
4
4
 
5
- Pyroscope.configure do |config|
6
- config.app_name = "test.ruby.app{}"
7
- config.server_address = "http://localhost:4040/"
8
- end
5
+ # Pyroscope.configure do |config|
6
+ # config.app_name = "test.ruby.app{}"
7
+ # config.server_address = "http://localhost:4040/"
8
+ # end
9
9
 
10
10
  puts "start"
11
11
  iteration=0
@@ -39,13 +39,13 @@ while true
39
39
  sleep_job
40
40
  elsif r < 0.5
41
41
  puts(" * test.ruby.app{job=0}")
42
- Pyroscope.change_name("test.ruby.app{job=0}")
42
+ # Pyroscope.change_name("test.ruby.app{job=0}")
43
43
  job_0
44
- Pyroscope.change_name("test.ruby.app{}")
44
+ # Pyroscope.change_name("test.ruby.app{}")
45
45
  else
46
46
  puts(" * test.ruby.app{job=1}")
47
- Pyroscope.change_name("test.ruby.app{job=1}")
47
+ # Pyroscope.change_name("test.ruby.app{job=1}")
48
48
  job_1
49
- Pyroscope.change_name("test.ruby.app{}")
49
+ # Pyroscope.change_name("test.ruby.app{}")
50
50
  end
51
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyroscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pyroscope Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-23 00:00:00.000000000 Z
11
+ date: 2021-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,8 +92,10 @@ files:
92
92
  - Gemfile.lock
93
93
  - README.md
94
94
  - Rakefile
95
+ - ext/pyroscope/Makefile.example
95
96
  - ext/pyroscope/extconf.rb
96
97
  - ext/pyroscope/lib/libpyroscope.rbspy.a
98
+ - ext/pyroscope/lib/libpyroscope.rbspy.combo.a
97
99
  - ext/pyroscope/lib/librustdeps.a
98
100
  - ext/pyroscope/pyroscope.c
99
101
  - lib/pyroscope.rb