fiber-profiler 0.1.0 → 0.1.2

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: 242de388a621c02117a98ee14496714ce82c3ad8d8770a891789536fe4dc8fad
4
- data.tar.gz: a911793eb422ac5e0092789263c58564e71831d769bf907d4db489777fbebdf6
3
+ metadata.gz: 7a39de10cbe411ddcec80b11ea0ac8204d589e15d54bc70b19e4bc979f49a16b
4
+ data.tar.gz: 57e2fd24daee67fd4d7aa35fbfa82b12bb73f9b0f2c66610aab58c35baac4ded
5
5
  SHA512:
6
- metadata.gz: e3b5be8bb62d92f11ae5262a526a351092920d2a64761b5a5ce2b38a2bae05edc4eed57283d0031f7e44c28e94427688ab602fca2e303fe0ec6c38f0a7ef68e1
7
- data.tar.gz: e959a0bf539b76cea581a42842e8c08541d9b75b51c6cebbb85f18eb5ad7b15ce5d361f13a1c7466ff0053511c736c556ae22468263148279a10a10148193e1b
6
+ metadata.gz: 91fc103cf78905421511a6c43523911a31fe5862b177024d410c9cace9870015d8d81c0f326b04be0c2329d9998bd5a900c71b74afb1eb276b2168bb398ab386
7
+ data.tar.gz: bb5abc757b8cd79bcd2589ad66cc8693a049ed3a7ba6a81706e2ff1a8c4d6db27ae3b5eb6f51e43a157dbc37ab3e8e08e9926482066acd9d84c2235d51a59e2c
checksums.yaml.gz.sig CHANGED
Binary file
Binary file
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>English</string>
7
+ <key>CFBundleIdentifier</key>
8
+ <string>com.apple.xcode.dsym.Fiber_Profiler.bundle</string>
9
+ <key>CFBundleInfoDictionaryVersion</key>
10
+ <string>6.0</string>
11
+ <key>CFBundlePackageType</key>
12
+ <string>dSYM</string>
13
+ <key>CFBundleSignature</key>
14
+ <string>????</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.0</string>
17
+ <key>CFBundleVersion</key>
18
+ <string>1</string>
19
+ </dict>
20
+ </plist>
@@ -0,0 +1,5 @@
1
+ ---
2
+ triple: 'arm64-apple-darwin'
3
+ binary-path: Fiber_Profiler.bundle
4
+ relocations: []
5
+ ...
data/ext/Makefile ADDED
@@ -0,0 +1,273 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ # V=0 quiet, V=1 verbose. other values don't work.
5
+ V = 0
6
+ V0 = $(V:0=)
7
+ Q1 = $(V:1=)
8
+ Q = $(Q1:0=@)
9
+ ECHO1 = $(V:1=@ :)
10
+ ECHO = $(ECHO1:0=@ echo)
11
+ NULLCMD = :
12
+
13
+ #### Start of system configuration section. ####
14
+
15
+ srcdir = .
16
+ topdir = /Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0
17
+ hdrdir = $(topdir)
18
+ arch_hdrdir = /Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0/arm64-darwin24
19
+ PATH_SEPARATOR = :
20
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir)/fiber/profiler
21
+ prefix = $(DESTDIR)/Users/samuel/.rubies/ruby-3.4.1
22
+ rubysitearchprefix = $(rubylibprefix)/$(sitearch)
23
+ rubyarchprefix = $(rubylibprefix)/$(arch)
24
+ rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
25
+ exec_prefix = $(prefix)
26
+ vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
27
+ sitearchhdrdir = $(sitehdrdir)/$(sitearch)
28
+ rubyarchhdrdir = $(rubyhdrdir)/$(arch)
29
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
30
+ sitehdrdir = $(rubyhdrdir)/site_ruby
31
+ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
32
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
33
+ vendorlibdir = $(vendordir)/$(ruby_version)
34
+ vendordir = $(rubylibprefix)/vendor_ruby
35
+ sitearchdir = $(sitelibdir)/$(sitearch)
36
+ sitelibdir = $(sitedir)/$(ruby_version)
37
+ sitedir = $(rubylibprefix)/site_ruby
38
+ rubyarchdir = $(rubylibdir)/$(arch)
39
+ rubylibdir = $(rubylibprefix)/$(ruby_version)
40
+ sitearchincludedir = $(includedir)/$(sitearch)
41
+ archincludedir = $(includedir)/$(arch)
42
+ sitearchlibdir = $(libdir)/$(sitearch)
43
+ archlibdir = $(libdir)/$(arch)
44
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
45
+ modular_gc_dir = $(DESTDIR)
46
+ mandir = $(datarootdir)/man
47
+ localedir = $(datarootdir)/locale
48
+ libdir = $(exec_prefix)/lib
49
+ psdir = $(docdir)
50
+ pdfdir = $(docdir)
51
+ dvidir = $(docdir)
52
+ htmldir = $(docdir)
53
+ infodir = $(datarootdir)/info
54
+ docdir = $(datarootdir)/doc/$(PACKAGE)
55
+ oldincludedir = $(DESTDIR)/usr/include
56
+ includedir = $(SDKROOT)$(prefix)/include
57
+ runstatedir = $(localstatedir)/run
58
+ localstatedir = $(prefix)/var
59
+ sharedstatedir = $(prefix)/com
60
+ sysconfdir = $(prefix)/etc
61
+ datadir = $(datarootdir)
62
+ datarootdir = $(prefix)/share
63
+ libexecdir = $(exec_prefix)/libexec
64
+ sbindir = $(exec_prefix)/sbin
65
+ bindir = $(exec_prefix)/bin
66
+ archdir = $(rubyarchdir)
67
+
68
+
69
+ CC_WRAPPER =
70
+ CC = clang
71
+ CXX = clang++ -std=gnu++11
72
+ LIBRUBY = $(LIBRUBY_A)
73
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
74
+ LIBRUBYARG_SHARED =
75
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation $(MAINLIBS)
76
+ empty =
77
+ OUTFLAG = -o $(empty)
78
+ COUTFLAG = -o $(empty)
79
+ CSRCFLAG = $(empty)
80
+
81
+ RUBY_EXTCONF_H = extconf.h
82
+ cflags = $(hardenflags) -fdeclspec $(optflags) $(debugflags) $(warnflags)
83
+ cxxflags =
84
+ optflags = -O3 -fno-fast-math
85
+ debugflags = -ggdb3
86
+ warnflags = -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef
87
+ cppflags =
88
+ CCDLFLAGS = -fno-common
89
+ CFLAGS = $(CCDLFLAGS) $(cflags) -pipe -Wall -Wno-unknown-pragmas -std=c99 $(ARCH_FLAG)
90
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
91
+ DEFS =
92
+ CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
93
+ CXXFLAGS = $(CCDLFLAGS) -fdeclspec $(ARCH_FLAG)
94
+ ldflags = -L. -fstack-protector-strong -L/opt/local/lib
95
+ dldflags = -L/opt/local/lib -Wl,-undefined,dynamic_lookup -bundle_loader '$(BUILTRUBY)'
96
+ ARCH_FLAG = -arch arm64
97
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
98
+ LDSHARED = $(CC) -dynamic -bundle
99
+ LDSHAREDXX = $(CXX) -dynamic -bundle
100
+ POSTLINK = dsymutil $@ 2>/dev/null; { test -z '$(RUBY_CODESIGN)' || codesign -s '$(RUBY_CODESIGN)' $@; }
101
+ AR = ar
102
+ LD = ld
103
+ EXEEXT =
104
+
105
+ RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
106
+ RUBY_SO_NAME = ruby.3.4
107
+ RUBYW_INSTALL_NAME =
108
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
109
+ RUBYW_BASE_NAME = rubyw
110
+ RUBY_BASE_NAME = ruby
111
+
112
+ arch = arm64-darwin24
113
+ sitearch = $(arch)
114
+ ruby_version = 3.4.0
115
+ ruby = $(bindir)/$(RUBY_BASE_NAME)
116
+ RUBY = $(ruby)
117
+ BUILTRUBY = $(bindir)/$(RUBY_BASE_NAME)
118
+ 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 $(RUBY_EXTCONF_H)
119
+
120
+ RM = rm -f
121
+ RM_RF = rm -fr
122
+ RMDIRS = rmdir -p
123
+ MAKEDIRS = /opt/local/bin/gmkdir -p
124
+ INSTALL = /opt/local/bin/ginstall -c
125
+ INSTALL_PROG = $(INSTALL) -m 0755
126
+ INSTALL_DATA = $(INSTALL) -m 644
127
+ COPY = cp
128
+ TOUCH = exit >
129
+
130
+ #### End of system configuration section. ####
131
+
132
+ preload =
133
+ libpath = . $(libdir) /opt/local/lib
134
+ LIBPATH = -L. -L$(libdir) -L/opt/local/lib
135
+ DEFFILE =
136
+
137
+ CLEANFILES = mkmf.log
138
+ DISTCLEANFILES =
139
+ DISTCLEANDIRS =
140
+
141
+ extout =
142
+ extout_prefix =
143
+ target_prefix =
144
+ LOCAL_LIBS =
145
+ LIBS = -lpthread
146
+ ORIG_SRCS =
147
+ SRCS = $(ORIG_SRCS) profiler.c time.c fiber.c capture.c
148
+ OBJS = profiler.o time.o fiber.o capture.o
149
+ HDRS = $(srcdir)/extconf.h
150
+ LOCAL_HDRS =
151
+ TARGET = Fiber_Profiler
152
+ TARGET_NAME = Fiber_Profiler
153
+ TARGET_ENTRY = Init_$(TARGET_NAME)
154
+ DLLIB = $(TARGET).bundle
155
+ EXTSTATIC =
156
+ STATIC_LIB =
157
+
158
+ TIMESTAMP_DIR = .
159
+ BINDIR = $(bindir)
160
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
161
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
162
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
163
+ HDRDIR = $(sitehdrdir)$(target_prefix)
164
+ ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
165
+ TARGET_SO_DIR =
166
+ TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
167
+ CLEANLIBS = $(TARGET_SO) $(TARGET_SO:=.dSYM)
168
+ CLEANOBJS = $(OBJS) *.bak
169
+ TARGET_SO_DIR_TIMESTAMP = $(TIMESTAMP_DIR)/.sitearchdir.time
170
+
171
+ all: $(DLLIB)
172
+ static: $(STATIC_LIB)
173
+ .PHONY: all install static install-so install-rb
174
+ .PHONY: clean clean-so clean-static clean-rb
175
+
176
+ clean-static::
177
+ clean-rb-default::
178
+ clean-rb::
179
+ clean-so::
180
+ clean: clean-so clean-static clean-rb-default clean-rb
181
+ -$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
182
+
183
+ distclean-rb-default::
184
+ distclean-rb::
185
+ distclean-so::
186
+ distclean-static::
187
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
188
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
189
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
190
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
191
+
192
+ realclean: distclean
193
+ install: install-so install-rb
194
+
195
+ install-so: $(DLLIB) $(TARGET_SO_DIR_TIMESTAMP)
196
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
197
+ clean-static::
198
+ -$(Q)$(RM) $(STATIC_LIB)
199
+ install-rb: pre-install-rb do-install-rb install-rb-default
200
+ install-rb-default: pre-install-rb-default do-install-rb-default
201
+ pre-install-rb: Makefile
202
+ pre-install-rb-default: Makefile
203
+ do-install-rb:
204
+ do-install-rb-default:
205
+ pre-install-rb-default:
206
+ @$(NULLCMD)
207
+ $(TARGET_SO_DIR_TIMESTAMP):
208
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
209
+ $(Q) $(TOUCH) $@
210
+
211
+ site-install: site-install-so site-install-rb
212
+ site-install-so: install-so
213
+ site-install-rb: install-rb
214
+
215
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
216
+
217
+ .cc.o:
218
+ $(ECHO) compiling $(<)
219
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
220
+
221
+ .cc.S:
222
+ $(ECHO) translating $(<)
223
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
224
+
225
+ .mm.o:
226
+ $(ECHO) compiling $(<)
227
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
228
+
229
+ .mm.S:
230
+ $(ECHO) translating $(<)
231
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
232
+
233
+ .cxx.o:
234
+ $(ECHO) compiling $(<)
235
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
236
+
237
+ .cxx.S:
238
+ $(ECHO) translating $(<)
239
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
240
+
241
+ .cpp.o:
242
+ $(ECHO) compiling $(<)
243
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
244
+
245
+ .cpp.S:
246
+ $(ECHO) translating $(<)
247
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
248
+
249
+ .c.o:
250
+ $(ECHO) compiling $(<)
251
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
252
+
253
+ .c.S:
254
+ $(ECHO) translating $(<)
255
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
256
+
257
+ .m.o:
258
+ $(ECHO) compiling $(<)
259
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
260
+
261
+ .m.S:
262
+ $(ECHO) translating $(<)
263
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
264
+
265
+ $(TARGET_SO): $(OBJS) Makefile
266
+ $(ECHO) linking shared-object $(DLLIB)
267
+ -$(Q)$(RM) $(@)
268
+ $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
269
+ $(Q) $(POSTLINK)
270
+
271
+
272
+
273
+ $(OBJS): $(HDRS) $(ruby_headers)
data/ext/capture.o ADDED
Binary file
data/ext/extconf.h ADDED
@@ -0,0 +1,5 @@
1
+ #ifndef EXTCONF_H
2
+ #define EXTCONF_H
3
+ #define HAVE_RB_FIBER_CURRENT 1
4
+ #define HAVE_RB_EXT_RACTOR_SAFE 1
5
+ #endif
@@ -13,7 +13,7 @@
13
13
  #include <stdio.h>
14
14
 
15
15
  enum {
16
- DEBUG_SKIPPED = 1,
16
+ DEBUG_SKIPPED = 0,
17
17
  };
18
18
 
19
19
  int Fiber_Profiler_capture_p = 0;
@@ -211,9 +211,8 @@ VALUE Fiber_Profiler_Capture_allocate(VALUE klass) {
211
211
  struct Fiber_Profiler_Capture *profiler = ALLOC(struct Fiber_Profiler_Capture);
212
212
 
213
213
  // Initialize the profiler state:
214
- Fiber_Profiler_Capture_output_set(profiler, rb_stderr);
215
214
  Fiber_Profiler_Stream_initialize(&profiler->stream);
216
-
215
+ profiler->output = Qnil;
217
216
  profiler->running = 0;
218
217
  profiler->capture = 0;
219
218
  profiler->stalls = 0;
@@ -258,6 +257,9 @@ VALUE Fiber_Profiler_Capture_initialize(int argc, VALUE *argv, VALUE self) {
258
257
 
259
258
  if (arguments[3] != Qundef) {
260
259
  Fiber_Profiler_Capture_output_set(profiler, arguments[3]);
260
+ } else {
261
+ // Initialize the profiler output - we dup `rb_stderr` because the profiler may otherwise run into synchronization issues with other uses of `rb_stderr`:
262
+ Fiber_Profiler_Capture_output_set(profiler, rb_obj_dup(rb_stderr));
261
263
  }
262
264
 
263
265
  return self;
@@ -560,6 +562,8 @@ void Fiber_Profiler_Capture_print_json(struct Fiber_Profiler_Capture *profiler,
560
562
  }
561
563
 
562
564
  void Fiber_Profiler_Capture_print(struct Fiber_Profiler_Capture *profiler) {
565
+ if (profiler->output == Qnil) return;
566
+
563
567
  FILE *stream = profiler->stream.file;
564
568
  profiler->print(profiler, stream);
565
569
  fflush(stream);
@@ -269,4 +269,4 @@ inline static void *Fiber_Profiler_Deque_last(struct Fiber_Profiler_Deque *deque
269
269
  #define Fiber_Profiler_Deque_each(deque, type, element) \
270
270
  for (struct Fiber_Profiler_Deque_Page *page = (deque)->head; page != NULL && page->size; page = page->tail) \
271
271
  for (size_t i = 0; i < page->size; i++) \
272
- for (type *element = Fiber_Profiler_Deque_Page_get(page, i, sizeof(type)); element != NULL; element = NULL)
272
+ for (type *element = Fiber_Profiler_Deque_Page_get(page, i, sizeof(type)); element != NULL; element = NULL)
data/ext/fiber.o ADDED
Binary file
data/ext/mkmf.log ADDED
@@ -0,0 +1,69 @@
1
+ have_func: checking for rb_fiber_current()... -------------------- yes
2
+
3
+ DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.4.1/lib ASAN_OPTIONS=detect_leaks=0 "clang -o conftest -I/Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0/arm64-darwin24 -I/Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef -pipe -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.4.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.4-static -framework CoreFoundation -lgmp -ldl -lobjc -lpthread -lpthread "
4
+ ld: warning: ignoring duplicate libraries: '-lpthread'
5
+ checked program was:
6
+ /* begin */
7
+ 1: #include "ruby.h"
8
+ 2:
9
+ 3: int main(int argc, char **argv)
10
+ 4: {
11
+ 5: return !!argv[argc];
12
+ 6: }
13
+ /* end */
14
+
15
+ DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.4.1/lib ASAN_OPTIONS=detect_leaks=0 "clang -o conftest -I/Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0/arm64-darwin24 -I/Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef -pipe -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.4.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.4-static -framework CoreFoundation -lgmp -ldl -lobjc -lpthread -lpthread "
16
+ ld: warning: ignoring duplicate libraries: '-lpthread'
17
+ checked program was:
18
+ /* begin */
19
+ 1: #include "ruby.h"
20
+ 2:
21
+ 3: /*top*/
22
+ 4: extern int t(void);
23
+ 5: int main(int argc, char **argv)
24
+ 6: {
25
+ 7: if (argc > 1000000) {
26
+ 8: int (* volatile tp)(void)=(int (*)(void))&t;
27
+ 9: printf("%d", (*tp)());
28
+ 10: }
29
+ 11:
30
+ 12: return !!argv[argc];
31
+ 13: }
32
+ 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_fiber_current; return !p; }
33
+ /* end */
34
+
35
+ --------------------
36
+
37
+ have_func: checking for rb_ext_ractor_safe()... -------------------- yes
38
+
39
+ DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.4.1/lib ASAN_OPTIONS=detect_leaks=0 "clang -o conftest -I/Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0/arm64-darwin24 -I/Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.4.1/include/ruby-3.4.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef -pipe -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.4.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.4-static -framework CoreFoundation -lgmp -ldl -lobjc -lpthread -lpthread "
40
+ ld: warning: ignoring duplicate libraries: '-lpthread'
41
+ checked program was:
42
+ /* begin */
43
+ 1: #include "ruby.h"
44
+ 2:
45
+ 3: /*top*/
46
+ 4: extern int t(void);
47
+ 5: int main(int argc, char **argv)
48
+ 6: {
49
+ 7: if (argc > 1000000) {
50
+ 8: int (* volatile tp)(void)=(int (*)(void))&t;
51
+ 9: printf("%d", (*tp)());
52
+ 10: }
53
+ 11:
54
+ 12: return !!argv[argc];
55
+ 13: }
56
+ 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_ext_ractor_safe; return !p; }
57
+ /* end */
58
+
59
+ --------------------
60
+
61
+ extconf.h is:
62
+ /* begin */
63
+ 1: #ifndef EXTCONF_H
64
+ 2: #define EXTCONF_H
65
+ 3: #define HAVE_RB_FIBER_CURRENT 1
66
+ 4: #define HAVE_RB_EXT_RACTOR_SAFE 1
67
+ 5: #endif
68
+ /* end */
69
+
data/ext/profiler.o ADDED
Binary file
data/ext/time.o ADDED
Binary file
@@ -7,6 +7,6 @@
7
7
  class Fiber
8
8
  # @namespace
9
9
  module Profiler
10
- VERSION = "0.1.0"
10
+ VERSION = "0.1.2"
11
11
  end
12
12
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiber-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -43,7 +43,15 @@ extensions:
43
43
  - ext/extconf.rb
44
44
  extra_rdoc_files: []
45
45
  files:
46
+ - ext/Fiber_Profiler.bundle
47
+ - ext/Fiber_Profiler.bundle.dSYM/Contents/Info.plist
48
+ - ext/Fiber_Profiler.bundle.dSYM/Contents/Resources/DWARF/Fiber_Profiler.bundle
49
+ - ext/Fiber_Profiler.bundle.dSYM/Contents/Resources/Relocations/aarch64/Fiber_Profiler.bundle.yml
50
+ - ext/Makefile
51
+ - ext/capture.o
52
+ - ext/extconf.h
46
53
  - ext/extconf.rb
54
+ - ext/fiber.o
47
55
  - ext/fiber/profiler/capture.c
48
56
  - ext/fiber/profiler/capture.h
49
57
  - ext/fiber/profiler/deque.h
@@ -53,6 +61,9 @@ files:
53
61
  - ext/fiber/profiler/profiler.h
54
62
  - ext/fiber/profiler/time.c
55
63
  - ext/fiber/profiler/time.h
64
+ - ext/mkmf.log
65
+ - ext/profiler.o
66
+ - ext/time.o
56
67
  - lib/fiber/profiler.rb
57
68
  - lib/fiber/profiler/capture.rb
58
69
  - lib/fiber/profiler/native.rb
metadata.gz.sig CHANGED
Binary file