vernier 1.1.0 → 1.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: aa7e8ccc4ac1312ccffb820ec0c6690209725a26ff0f5a9945a508edca073975
4
- data.tar.gz: a0f7b10b284dd8fd387a8b12e15a2c9e8535e07f9d19f37c0734b08c93693956
3
+ metadata.gz: 0e53177832167777357ffdfc79c26f1957a8707804cb85349560faa6d433fd49
4
+ data.tar.gz: bc89ef70d31f160e8a874c27a2b9bb6479c1a4e631549dd4ac583b7137177660
5
5
  SHA512:
6
- metadata.gz: 7effed8c46b5110437f12d3fb8a4c4707e334c7edd51d4838198bb8dfb56cdd48c6d1700464be2d32b979f97eafc4c45a2406a4028cceadcac3bd71c1520babb
7
- data.tar.gz: 4f11e253e293fd455d1eff820262fb6ea217bf0e3c574dd14bc15c3638e576fd3fb25ee84c3cdeb7151b2877d3f918b4157262f3268797482c192f3935b8768a
6
+ metadata.gz: 642f607cc4998decb398e88dd196b920ae9592c139fdf7527ad7feb383579b22ff697fa4dede77d62866784415f798d8b020cdb0f8122cb30ea02a6fa66cc7cb
7
+ data.tar.gz: '03749312aad61f1c336863dece9417afc01df487a6f3f44f7c55e94fcb81b9df32e2aabd232b61a22b7add89f969cfe2a685816ea38cfd66447ac2f7813ed96a'
data/exe/vernier CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "optparse"
4
+ require "vernier/version"
4
5
 
5
6
  banner = <<-END
6
7
  Usage: vernier run [FLAGS] -- COMMAND
@@ -10,6 +11,8 @@ END
10
11
 
11
12
  options = {}
12
13
  parser = OptionParser.new(banner) do |o|
14
+ o.version = Vernier::VERSION
15
+
13
16
  o.on('--output [FILENAME]', String, "output filename") do |s|
14
17
  options[:output] = s
15
18
  end
@@ -554,19 +554,6 @@ struct StackTable {
554
554
  }
555
555
  }
556
556
 
557
- // FIXME: probably should remove
558
- void clear() {
559
- frame_map.clear();
560
- func_map.clear();
561
- func_info_list.clear();
562
-
563
- {
564
- const std::lock_guard<std::mutex> lock(stack_mutex);
565
- stack_node_list.clear();
566
- root_stack_node.children.clear();
567
- }
568
- }
569
-
570
557
  StackNode *convert_stack(StackTable &other, int original_idx) {
571
558
  if (original_idx < 0) {
572
559
  return &root_stack_node;
@@ -1036,13 +1023,15 @@ class SampleList {
1036
1023
  }
1037
1024
 
1038
1025
  void record_sample(int stack_index, TimeStamp time, Category category) {
1039
- if (
1040
- !empty() &&
1041
- stacks.back() == stack_index &&
1042
- categories.back() == category)
1043
- {
1044
- // We don't compare timestamps for de-duplication
1045
- weights.back() += 1;
1026
+ // FIXME: probably better to avoid generating -1 higher up.
1027
+ // Currently this happens when we measure an empty stack. Ideally we would have a better representation
1028
+ if (stack_index < 0)
1029
+ return;
1030
+
1031
+ if (!empty() && stacks.back() == stack_index &&
1032
+ categories.back() == category) {
1033
+ // We don't compare timestamps for de-duplication
1034
+ weights.back() += 1;
1046
1035
  } else {
1047
1036
  stacks.push_back(stack_index);
1048
1037
  timestamps.push_back(time);
@@ -213,7 +213,6 @@ module Vernier
213
213
  @profile = profile
214
214
  @categorizer = categorizer
215
215
  @tid = tid
216
- @allocations = allocations
217
216
  @name = name
218
217
  @is_main = is_main
219
218
  if is_main.nil?
@@ -227,6 +226,15 @@ module Vernier
227
226
 
228
227
  @samples = samples
229
228
 
229
+ if allocations
230
+ allocation_samples = allocations[:samples].dup
231
+ allocation_samples.map! do |sample|
232
+ @stack_table.convert(profile._stack_table, sample)
233
+ end
234
+ allocations = allocations.merge(samples: allocation_samples)
235
+ end
236
+ @allocations = allocations
237
+
230
238
  timestamps ||= [0] * samples.size
231
239
  @weights, @timestamps = weights, timestamps
232
240
  @sample_categories = sample_categories || ([0] * samples.size)
@@ -102,7 +102,7 @@ module Vernier
102
102
  end
103
103
 
104
104
  def line
105
- result.frame_line_idx(idx)
105
+ result._stack_table.frame_line_no(idx)
106
106
  end
107
107
 
108
108
  def to_s
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vernier
4
- VERSION = "1.1.0"
4
+ VERSION = "1.1.2"
5
5
  end
data/vernier.gemspec CHANGED
@@ -12,7 +12,10 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "Next-generation Ruby 3.2.1+ sampling profiler. Tracks multiple threads, GVL activity, GC pauses, idle time, and more."
13
13
  spec.homepage = "https://github.com/jhawthorn/vernier"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = ">= 3.2.1"
15
+
16
+ unless ENV["IGNORE_REQUIRED_RUBY_VERSION"]
17
+ spec.required_ruby_version = ">= 3.2.1"
18
+ end
16
19
 
17
20
  spec.metadata["homepage_uri"] = spec.homepage
18
21
  spec.metadata["source_code_uri"] = spec.homepage
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vernier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-01 00:00:00.000000000 Z
11
+ date: 2024-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  requirements: []
120
- rubygems_version: 3.5.9
120
+ rubygems_version: 3.5.11
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: A next generation CRuby profiler