Skip to content

Commit

Permalink
Keep indentation and update example for thread_name_with_extension
Browse files Browse the repository at this point in the history
  • Loading branch information
benoittgt committed Apr 26, 2023
1 parent 2dfb68d commit c1baf71
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
70 changes: 35 additions & 35 deletions examples/thread_name_with_extension.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
[
{"ph": "M", "pid": 23071, "tid": 0, "name": "thread_name", "args": {"name": "1713472 "}},
{"ph": "E", "pid": 23071, "tid": 0, "ts": 1.000000},
{"ph": "B", "pid": 23071, "tid": 0, "ts": 1.000000, "name": "started_tracing"},
{"ph": "M", "pid": 23071, "tid": 1, "name": "thread_name", "args": {"name": "1713480 "}},
{"ph": "E", "pid": 23071, "tid": 1, "ts": 61.000000},
{"ph": "B", "pid": 23071, "tid": 1, "ts": 61.000000, "name": "started"},
{"ph": "E", "pid": 23071, "tid": 1, "ts": 64.000000},
{"ph": "B", "pid": 23071, "tid": 1, "ts": 64.000000, "name": "wants_gvl"},
{"ph": "M", "pid": 23071, "tid": 2, "name": "thread_name", "args": {"name": "1713481 "}},
{"ph": "E", "pid": 23071, "tid": 2, "ts": 76.000000},
{"ph": "B", "pid": 23071, "tid": 2, "ts": 76.000000, "name": "started"},
{"ph": "E", "pid": 23071, "tid": 2, "ts": 77.000000},
{"ph": "B", "pid": 23071, "tid": 2, "ts": 77.000000, "name": "wants_gvl"},
{"ph": "M", "pid": 23071, "tid": 3, "name": "thread_name", "args": {"name": "1713482 "}},
{"ph": "E", "pid": 23071, "tid": 3, "ts": 86.000000},
{"ph": "B", "pid": 23071, "tid": 3, "ts": 86.000000, "name": "started"},
{"ph": "E", "pid": 23071, "tid": 3, "ts": 87.000000},
{"ph": "B", "pid": 23071, "tid": 3, "ts": 87.000000, "name": "wants_gvl"},
{"ph": "M", "pid": 23071, "tid": 4, "name": "thread_name", "args": {"name": "1713483 "}},
{"ph": "E", "pid": 23071, "tid": 4, "ts": 95.000000},
{"ph": "B", "pid": 23071, "tid": 4, "ts": 95.000000, "name": "started"},
{"ph": "E", "pid": 23071, "tid": 4, "ts": 96.000000},
{"ph": "B", "pid": 23071, "tid": 4, "ts": 96.000000, "name": "wants_gvl"},
{"ph": "M", "pid": 23071, "tid": 5, "name": "thread_name", "args": {"name": "1713484 "}},
{"ph": "E", "pid": 23071, "tid": 5, "ts": 105.000000},
{"ph": "B", "pid": 23071, "tid": 5, "ts": 105.000000, "name": "started"},
{"ph": "E", "pid": 23071, "tid": 5, "ts": 106.000000},
{"ph": "B", "pid": 23071, "tid": 5, "ts": 106.000000, "name": "wants_gvl"},
{"ph": "E", "pid": 23071, "tid": 0, "ts": 146.000000},
{"ph": "B", "pid": 23071, "tid": 0, "ts": 146.000000, "name": "stopped_tracing"},
{"ph":"M","pid":23071,"tid":1713480,"name":"thread_name","args":{"name":"worker-1 from concurrent-ruby"}},
{"ph":"M","pid":23071,"tid":1713481,"name":"thread_name","args":{"name":"worker-2 from concurrent-ruby"}},
{"ph":"M","pid":23071,"tid":1713482,"name":"thread_name","args":{"name":"worker-3 from concurrent-ruby"}},
{"ph":"M","pid":23071,"tid":1713483,"name":"thread_name","args":{"name":"worker-4 from concurrent-ruby"}},
{"ph":"M","pid":23071,"tid":1713484,"name":"thread_name","args":{"name":"worker-5 from concurrent-ruby"}}
{"ph": "M", "pid": 44888, "tid": 476837, "name": "thread_name", "args": {"name": "476837 "}},
{"ph": "E", "pid": 44888, "tid": 476837, "ts": 2.000000},
{"ph": "B", "pid": 44888, "tid": 476837, "ts": 2.000000, "name": "started_tracing"},
{"ph": "M", "pid": 44888, "tid": 476842, "name": "thread_name", "args": {"name": "476842 "}},
{"ph": "E", "pid": 44888, "tid": 476842, "ts": 66.000000},
{"ph": "B", "pid": 44888, "tid": 476842, "ts": 66.000000, "name": "started"},
{"ph": "E", "pid": 44888, "tid": 476842, "ts": 69.000000},
{"ph": "B", "pid": 44888, "tid": 476842, "ts": 69.000000, "name": "wants_gvl"},
{"ph": "M", "pid": 44888, "tid": 476843, "name": "thread_name", "args": {"name": "476843 "}},
{"ph": "E", "pid": 44888, "tid": 476843, "ts": 82.000000},
{"ph": "B", "pid": 44888, "tid": 476843, "ts": 82.000000, "name": "started"},
{"ph": "E", "pid": 44888, "tid": 476843, "ts": 85.000000},
{"ph": "B", "pid": 44888, "tid": 476843, "ts": 85.000000, "name": "wants_gvl"},
{"ph": "M", "pid": 44888, "tid": 476844, "name": "thread_name", "args": {"name": "476844 "}},
{"ph": "E", "pid": 44888, "tid": 476844, "ts": 93.000000},
{"ph": "B", "pid": 44888, "tid": 476844, "ts": 93.000000, "name": "started"},
{"ph": "E", "pid": 44888, "tid": 476844, "ts": 94.000000},
{"ph": "B", "pid": 44888, "tid": 476844, "ts": 94.000000, "name": "wants_gvl"},
{"ph": "M", "pid": 44888, "tid": 476845, "name": "thread_name", "args": {"name": "476845 "}},
{"ph": "E", "pid": 44888, "tid": 476845, "ts": 102.000000},
{"ph": "B", "pid": 44888, "tid": 476845, "ts": 102.000000, "name": "started"},
{"ph": "E", "pid": 44888, "tid": 476845, "ts": 103.000000},
{"ph": "B", "pid": 44888, "tid": 476845, "ts": 103.000000, "name": "wants_gvl"},
{"ph": "M", "pid": 44888, "tid": 476846, "name": "thread_name", "args": {"name": "476846 "}},
{"ph": "E", "pid": 44888, "tid": 476846, "ts": 111.000000},
{"ph": "B", "pid": 44888, "tid": 476846, "ts": 111.000000, "name": "started"},
{"ph": "E", "pid": 44888, "tid": 476846, "ts": 112.000000},
{"ph": "B", "pid": 44888, "tid": 476846, "ts": 112.000000, "name": "wants_gvl"},
{"ph": "E", "pid": 44888, "tid": 476837, "ts": 153.000000},
{"ph": "B", "pid": 44888, "tid": 476837, "ts": 153.000000, "name": "stopped_tracing"},
{"ph": "M", "pid": 44888, "tid": 476842, "name": "thread_name", "args": {"name": "worker-1 from concurrent-ruby"}},
{"ph": "M", "pid": 44888, "tid": 476843, "name": "thread_name", "args": {"name": "worker-2 from concurrent-ruby"}},
{"ph": "M", "pid": 44888, "tid": 476844, "name": "thread_name", "args": {"name": "worker-3 from concurrent-ruby"}},
{"ph": "M", "pid": 44888, "tid": 476845, "name": "thread_name", "args": {"name": "worker-4 from concurrent-ruby"}},
{"ph": "M", "pid": 44888, "tid": 476846, "name": "thread_name", "args": {"name": "worker-5 from concurrent-ruby"}}
]
2 changes: 1 addition & 1 deletion lib/gvl-tracing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def aggreate_thread_list(list)
list.each_with_object([]) do |t, acc|
next unless t.name

acc << "{\"ph\": \"M\", \"pid\": #{Process.pid}, \"tid\": #{t.native_thread_id}, \"name\": \"thread_name\", \"args\": {\"name\": \"#{thread_label(t)}\"}}"
acc << " {\"ph\": \"M\", \"pid\": #{Process.pid}, \"tid\": #{t.native_thread_id}, \"name\": \"thread_name\", \"args\": {\"name\": \"#{thread_label(t)}\"}}"
end
end

Expand Down

0 comments on commit c1baf71

Please sign in to comment.