gc_tracer 1.0.2 → 1.0.3

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
  SHA1:
3
- metadata.gz: e88092e8af66c335eb5b650723f56a691824bd1e
4
- data.tar.gz: 19baeffe0a1d32a4630db100ca6f0127a14c4770
3
+ metadata.gz: 477d54ed3c9678407cf4cdb090080222048716f6
4
+ data.tar.gz: 1c45e0a9ae7ff7f95c5d670835d784c5bef79328
5
5
  SHA512:
6
- metadata.gz: 8c6fd1751d1e264920e79af7b3465fd767c4d36290317b444d902d416eef1a61fd8ec374bb406a1522e0ec2f705bf850ad14508967be2ea3acd7a7cfbbfd0c0f
7
- data.tar.gz: 291863722be9cdc26e7df65e4836f285b9ac1e513d41acdb2a1a1fa1583a624e1dedba70d55378562047aa0ec50704ab8dc5d930fb1288b34bc9755bb907c697
6
+ metadata.gz: ff98def642484926e33a0116e12a1bec60cb06daccafd798505ac14f17918662c3ffa0f19d6d87fc28e8974b4077b7482d04969e0bbcbd5c54da4ffa14a67cf3
7
+ data.tar.gz: f9108f5902479a5d559ed40b16b074036b29f6b65abcc62816046060978aec449307bc424d611637ed1e7ebb1058c5706e09d93e54ac74819b5920f082df8f4f
data/README.md CHANGED
@@ -96,7 +96,7 @@ setting is "gc_stat: true, gc_latest_gc_info: true, rusage: false".
96
96
 
97
97
  You can specify tick (time stamp) type with keyword parameter
98
98
  "tick_type". You can choose one of the tick type in :hw_counter, :time
99
- and :nano_time.
99
+ and :nano_time (if platform supports clock_gettime()).
100
100
 
101
101
  See lib/gc_tracer.rb for more details.
102
102
 
@@ -179,6 +179,7 @@ out_time_time(FILE *out)
179
179
  }
180
180
  }
181
181
 
182
+ #ifdef HAVE_CLOCK_GETTIME
182
183
  static void
183
184
  out_time_nano_time(FILE *out)
184
185
  {
@@ -192,6 +193,7 @@ out_time_nano_time(FILE *out)
192
193
  fprintf(out, "%lu\t", (unsigned long)ts.tv_nsec);
193
194
  }
194
195
  }
196
+ #endif
195
197
 
196
198
  static void
197
199
  out_obj(FILE *out, VALUE obj)
@@ -456,18 +458,24 @@ gc_tracer_setup_logging_tick_type(VALUE self, VALUE sym)
456
458
  static const char *names[] = {
457
459
  "none",
458
460
  "hw_counter",
459
- "time",
461
+ "time"
462
+ #ifdef HAVE_CLOCK_GETTIME
463
+ ,
460
464
  "nano_time"
465
+ #endif
461
466
  };
462
467
  static const out_time_func_t funcs[] = {
463
468
  out_time_none,
464
469
  out_time_hw_counter,
465
- out_time_time,
470
+ out_time_time
471
+ #ifdef HAVE_CLOCK_GETTIME
472
+ ,
466
473
  out_time_nano_time
474
+ #endif
467
475
  };
468
476
  int i;
469
477
 
470
- for (i=0; i<4; i++) {
478
+ for (i=0; i<(int)(sizeof(funcs)/sizeof(out_time_func_t)); i++) {
471
479
  if (sym == ID2SYM(rb_intern(names[i]))) {
472
480
  logging->config.out_time_func = funcs[i];
473
481
  return self;
@@ -582,5 +590,5 @@ Init_gc_tracer_logging(VALUE mod)
582
590
  gc_tracer_setup_logging_gc_stat(Qnil, Qtrue);
583
591
  gc_tracer_setup_logging_gc_latest_gc_info(Qnil, Qtrue);
584
592
  gc_tracer_setup_logging_rusage(Qnil, Qfalse);
585
- trace_logging.config.out_time_func = out_time_nano_time;
593
+ trace_logging.config.out_time_func = out_time_time;
586
594
  }
@@ -1,3 +1,3 @@
1
1
  module GC::Tracer
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
data/lib/gc_tracer.rb CHANGED
@@ -8,7 +8,7 @@ module GC
8
8
  # event filter
9
9
  events: %i(start end_mark end_sweep),
10
10
  # tick type (:hw_counter, :time, :user_time, :system_time)
11
- tick_type: :nano_time,
11
+ tick_type: :time,
12
12
  # collect information
13
13
  gc_stat: true,
14
14
  gc_latest_gc_info: true,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gc_tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Sasada