vernier 1.10.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/ext/vernier/heap_tracker.cc +3 -0
- data/lib/vernier/output/firefox.rb +63 -25
- data/lib/vernier/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d1af998d7d2517b6c73e0ef7ec8a3e0762c9c0ca23dd859d3c268842f064612f
|
|
4
|
+
data.tar.gz: 558ad40b4ca261719e241f22806112e9ff18b2ba0e1a65d5c24067deee0803e0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 58a0c75db2f1ffb90017f887c4e6813653ef908efc4601cbe6fe105aa1493c5344028355d1ec68658e59c34d36b885fcd59340de553bfffc1a72fcadd7668398
|
|
7
|
+
data.tar.gz: a80cd4ab4c0da94d3799cbedfe93de02788dc48bb7626565eff62cfc7606aa75c93892f5dab17d6b076abf6ea361cbf9231940cfb40384c8116490aff5dee79e
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0
|
data/ext/vernier/heap_tracker.cc
CHANGED
|
@@ -267,6 +267,11 @@ module Vernier
|
|
|
267
267
|
end
|
|
268
268
|
|
|
269
269
|
class Thread
|
|
270
|
+
SAMPLE_CATEGORY_NAMES = {
|
|
271
|
+
1 => "Idle",
|
|
272
|
+
2 => "Stalled"
|
|
273
|
+
}.freeze
|
|
274
|
+
|
|
270
275
|
attr_reader :profile, :is_start
|
|
271
276
|
|
|
272
277
|
def initialize(ruby_thread_id, profile, categorizer, name:, tid:, samples:, weights:, timestamps: nil, sample_categories: nil, markers:, started_at:, stopped_at: nil, allocations: nil, is_main: nil, is_start: nil)
|
|
@@ -355,6 +360,31 @@ module Vernier
|
|
|
355
360
|
@frame_subcategories = @stack_table_hash[:frame_table].fetch(:func).map do |func_idx|
|
|
356
361
|
func_subcategories[func_idx]
|
|
357
362
|
end
|
|
363
|
+
|
|
364
|
+
@sample_category_idx = SAMPLE_CATEGORY_NAMES.transform_values do |name|
|
|
365
|
+
@categorizer.get_category(name).idx
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
@samples.zip(@sample_categories).each do |sample, raw_category|
|
|
369
|
+
next if raw_category == 0
|
|
370
|
+
|
|
371
|
+
@categorized_stacks[[sample, raw_category]]
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
base_stack_frames = @stack_table_hash[:stack_table].fetch(:frame)
|
|
375
|
+
base_frame_count = @stack_table_hash[:frame_table].fetch(:func).size
|
|
376
|
+
@extra_frames = []
|
|
377
|
+
@categorized_frame_map = {}
|
|
378
|
+
|
|
379
|
+
@categorized_stacks.each_key do |(stack, raw_category)|
|
|
380
|
+
original_frame_idx = base_stack_frames[stack]
|
|
381
|
+
key = [original_frame_idx, raw_category]
|
|
382
|
+
next if @categorized_frame_map.key?(key)
|
|
383
|
+
|
|
384
|
+
new_frame_idx = base_frame_count + @extra_frames.size
|
|
385
|
+
@categorized_frame_map[key] = new_frame_idx
|
|
386
|
+
@extra_frames << [original_frame_idx, @sample_category_idx[raw_category]]
|
|
387
|
+
end
|
|
358
388
|
end
|
|
359
389
|
|
|
360
390
|
def categorize_filename(filename)
|
|
@@ -377,7 +407,7 @@ module Vernier
|
|
|
377
407
|
def find_category_and_subcategory(filename, categories)
|
|
378
408
|
categories.each do |category_name|
|
|
379
409
|
category = @categorizer.get_category(category_name)
|
|
380
|
-
subcategory = category.subcategories.detect {|c| c.matches?(filename) }&.idx
|
|
410
|
+
subcategory = category.subcategories.detect { |c| c.matches?(filename) }&.idx
|
|
381
411
|
return category, subcategory if subcategory
|
|
382
412
|
end
|
|
383
413
|
[nil, nil]
|
|
@@ -430,7 +460,7 @@ module Vernier
|
|
|
430
460
|
categories = []
|
|
431
461
|
data = []
|
|
432
462
|
|
|
433
|
-
@markers.
|
|
463
|
+
@markers.each do |(_, name, start, finish, phase, datum)|
|
|
434
464
|
string_indexes << @strings[name]
|
|
435
465
|
start_times << (start / 1_000_000.0)
|
|
436
466
|
|
|
@@ -463,12 +493,14 @@ module Vernier
|
|
|
463
493
|
end
|
|
464
494
|
|
|
465
495
|
def allocations_table
|
|
466
|
-
return nil
|
|
496
|
+
return nil unless @allocations
|
|
497
|
+
|
|
467
498
|
samples, weights, timestamps = @allocations.values_at(:samples, :weights, :timestamps)
|
|
468
|
-
return nil if samples.
|
|
499
|
+
return nil if samples.empty?
|
|
500
|
+
|
|
469
501
|
size = samples.size
|
|
470
502
|
timestamps = timestamps.map { _1 / 1_000_000.0 }
|
|
471
|
-
|
|
503
|
+
{
|
|
472
504
|
"time": timestamps,
|
|
473
505
|
"className": ["Object"]*size,
|
|
474
506
|
"typeName": ["JSObject"]*size,
|
|
@@ -478,7 +510,6 @@ module Vernier
|
|
|
478
510
|
"stack": samples,
|
|
479
511
|
"length": size
|
|
480
512
|
}
|
|
481
|
-
ret
|
|
482
513
|
end
|
|
483
514
|
|
|
484
515
|
def samples_table
|
|
@@ -518,21 +549,22 @@ module Vernier
|
|
|
518
549
|
end
|
|
519
550
|
|
|
520
551
|
def stack_table
|
|
521
|
-
|
|
552
|
+
base_frames = @stack_table_hash[:stack_table].fetch(:frame)
|
|
553
|
+
frames = base_frames.dup
|
|
522
554
|
prefixes = @stack_table_hash[:stack_table].fetch(:parent).dup
|
|
523
|
-
categories
|
|
524
|
-
subcategories
|
|
555
|
+
categories = frames.map { |idx| @frame_categories[idx].idx }
|
|
556
|
+
subcategories = frames.map { |idx| @frame_subcategories[idx] }
|
|
525
557
|
|
|
526
|
-
@categorized_stacks.each_key do |(stack,
|
|
527
|
-
|
|
558
|
+
@categorized_stacks.each_key do |(stack, raw_category)|
|
|
559
|
+
original_frame_idx = base_frames[stack]
|
|
560
|
+
frames << @categorized_frame_map[[original_frame_idx, raw_category]]
|
|
528
561
|
prefixes << prefixes[stack]
|
|
529
|
-
categories <<
|
|
562
|
+
categories << @sample_category_idx[raw_category]
|
|
530
563
|
subcategories << 0
|
|
531
564
|
end
|
|
532
565
|
|
|
533
|
-
size
|
|
534
|
-
|
|
535
|
-
raise unless prefixes.size == size
|
|
566
|
+
raise unless prefixes.size == frames.size
|
|
567
|
+
|
|
536
568
|
{
|
|
537
569
|
frame: frames,
|
|
538
570
|
category: categories,
|
|
@@ -543,18 +575,27 @@ module Vernier
|
|
|
543
575
|
end
|
|
544
576
|
|
|
545
577
|
def frame_table
|
|
546
|
-
funcs = @stack_table_hash[:frame_table].fetch(:func)
|
|
547
|
-
lines = @stack_table_hash[:frame_table].fetch(:line)
|
|
578
|
+
funcs = @stack_table_hash[:frame_table].fetch(:func).dup
|
|
579
|
+
lines = @stack_table_hash[:frame_table].fetch(:line).dup
|
|
548
580
|
raise unless lines.size == funcs.size
|
|
549
581
|
|
|
582
|
+
categories = @frame_categories.map(&:idx)
|
|
583
|
+
subcategories = @frame_subcategories.dup
|
|
584
|
+
implementations = @frame_implementations.dup
|
|
585
|
+
|
|
586
|
+
@extra_frames.each do |(frame_idx, category_idx)|
|
|
587
|
+
funcs << funcs[frame_idx]
|
|
588
|
+
lines << lines[frame_idx]
|
|
589
|
+
categories << category_idx
|
|
590
|
+
subcategories << 0
|
|
591
|
+
implementations << implementations[frame_idx]
|
|
592
|
+
end
|
|
593
|
+
|
|
550
594
|
size = funcs.size
|
|
551
595
|
none = [nil] * size
|
|
552
596
|
default = [0] * size
|
|
553
597
|
unidentified = [-1] * size
|
|
554
598
|
|
|
555
|
-
categories = @frame_categories.map(&:idx)
|
|
556
|
-
subcategories = @frame_subcategories
|
|
557
|
-
|
|
558
599
|
{
|
|
559
600
|
address: unidentified,
|
|
560
601
|
inlineDepth: default,
|
|
@@ -563,7 +604,7 @@ module Vernier
|
|
|
563
604
|
func: funcs,
|
|
564
605
|
nativeSymbol: none,
|
|
565
606
|
innerWindowID: none,
|
|
566
|
-
implementation:
|
|
607
|
+
implementation: implementations,
|
|
567
608
|
line: lines,
|
|
568
609
|
column: none,
|
|
569
610
|
length: size
|
|
@@ -605,11 +646,8 @@ module Vernier
|
|
|
605
646
|
else
|
|
606
647
|
string.scrub
|
|
607
648
|
end
|
|
608
|
-
elsif string.encoding == Encoding::BINARY
|
|
609
|
-
# TODO: We might want to guess UTF-8 and escape the binary more explicitly
|
|
610
|
-
string.dup.force_encoding("UTF-8").scrub
|
|
611
649
|
else
|
|
612
|
-
# TODO:
|
|
650
|
+
# TODO: We might want to guess UTF-8 and escape the binary more explicitly
|
|
613
651
|
string.dup.force_encoding("UTF-8").scrub
|
|
614
652
|
end
|
|
615
653
|
end
|
data/lib/vernier/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vernier
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.10.
|
|
4
|
+
version: 1.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Hawthorn
|
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
134
134
|
- !ruby/object:Gem::Version
|
|
135
135
|
version: '0'
|
|
136
136
|
requirements: []
|
|
137
|
-
rubygems_version: 4.0.
|
|
137
|
+
rubygems_version: 4.0.6
|
|
138
138
|
specification_version: 4
|
|
139
139
|
summary: A next generation CRuby profiler
|
|
140
140
|
test_files: []
|